-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with Special Characters in WixSharp Bootstrapper Custom BA after Upgrading from Wix3 to Wix4 #1736
Comments
Hallo, i dont know, but i found this one on wix toolset website. https://wixtoolset.org/docs/tools/preprocessor/#escaping |
Hey Torchok! Thanks for the input and yes it's german based :) I found a way with WixSharp to get it working. I just re-save the public class Program
{
private static void Main()
{
// If you are using WiX5 tools then your Custom BA needs to be built as a separate assembly because WiX5 uses a completely different hosting model.
// See this sample for WiX5 Custom BA https://github.com/oleg-shilo/wixsharp/tree/master/Source/src/WixSharp.Samples/Wix%23%20Samples/Bootstrapper/WiX5-Spike/WixToolset.WixBA
WixTools.SetWixVersion(Environment.CurrentDirectory, "4.0.6");
WixTools.WixExtensionsDir = "%userprofile%\\.nuget\\packages".ExpandEnvVars();
WixExtension.NetFx.PreferredVersion = "4.0.6";
WixExtension.Bal.PreferredVersion = "4.0.6";
WixExtension.Util.PreferredVersion = "4.0.6";
WixExtension.UI.PreferredVersion = "4.0.6";
var productMsi = BuildMsi();
var bootstrapper =
new Bundle("MyProdÜÄct",
new MsiPackage(productMsi)
{
Id = "MyProductPackageId",
DisplayInternalUI = true
});
bootstrapper.Copyright = @"® My Company 2016";
bootstrapper.Version = new Version("1.0.0.0");
bootstrapper.UpgradeCode = new Guid("25f7a758-751a-4aeb-8ccd-742a9fd35867");
bootstrapper.Application = new ManagedBootstrapperApplication("%this%");
bootstrapper.WixSourceSaved += BootstrapperOnWixSourceSaved;
bootstrapper.Build("MyProduct.exe");
}
private static void BootstrapperOnWixSourceSaved(string filename)
{
var fileContent = System.IO.File.ReadAllText(filename, Encoding.Default);
System.IO.File.WriteAllText(filename, fileContent, Encoding.UTF8);
}
private static string BuildMsi()
{
var project = new Project("MyProduct",
new Dir(@"%ProgramFiles%\My Company\My Product",
new File("Program.cs")));
project.GUID = new Guid("25f7a758-751a-4aeb-8ccd-742a9fd35867");
return project.BuildMsi();
}
} Result:
It appears that the compiler consistently utilizes Encoding.Default to write the initial .wxs file. |
…m BA after Upgrading from Wix3 to Wix4
The The fix will be available in the very next release. |
- #1736: Issue with Special Characters in WixSharp Bootstrapper Custom BA after Upgrading from Wix3 to Wix4 - Improved positioning of the background images for WPF UI Dialogs - WIP: Added support for modern style folder selection dialog (triggered by #1734 discussion) - Added a more convenient option to play dialogs in demo mode during development
Done. |
Hi Oleg, Thank you for the fast package update! It works perfectly. 😊 Also, thanks to @Torchok19081986 for your valuable input. I especially appreciate the change to UTF-8 encoding for the bundle. This improvement means I no longer need to specify anything about the encoding inside the bootstrapper, which is fantastic. Best regards, |
Yes, indeed it wasn't the best choice of the default value. Glad the problem has been discovered and fixed. And indeed thank you @@Torchok19081986 for attending this ticket. |
Hello 🙂
I have a problem after updating my WixSharp Bootstrapper from Wix3 to Wix4.
In Wix 3, it was possible to use
©
for the copyright. However, in Wix 4, when using©
, I get the following error:WIX0104: Not a valid source file; detail: Invalid character in the given encoding. Line 2, position 39. (The position of the
©
in the .wxs)Is there a way to get around this? I also encounter this problem when using characters like
ä
,ü
, and so on.I replicated the error with the WixSharp Boostrapper Custom BA (Wix4):
Any help or suggestions would be greatly appreciated!
The text was updated successfully, but these errors were encountered: