Is it possible to use Wingdings in an MSI with Wix? - wix

I am trying to use Wingdings in my Wix installer, specifically the characters at 0xFB and 0xFC. I tried unicode variants of these (✗, ✓), but since Wix/MSI requires a specific codepage, these do not work.
My TextStyle is:<TextStyle Id="Wingdings_Font_Normal" FaceName="Wingdings" Size="8" />
My control is: <Control Id="TestResult_Success" Type="Text" X="140" Y="237" Width="24" Height="24" Text="{\Wingding_Font_Normal}ü">
In my UI, a raw ü is rendered, rather than the Wingdings glyph for that character.
Is there some way to get Wingdings working with Wix/MSI?
EDIT:
After having a peek with Orca inside my compiled MSI, I've found that my TextStyle table is being generated correctly:
And the relevant lines of the control table:
I manually added a new TextStyle and changed the Text to use the new TextStyle, but was unable to get any Winding symbols to appear in my installer.

I don't have a citation to share but I'm 99.9% certain the answer is no. Windows Installer native/internal UI is about 16 years old and limited in numerous ways. To create a better UI experience you'd need to provide an external UI handler using a tool such as WiX Burn. This is how WiX provides it's enhanced UI experience. If you don't mind taking a dependency on .NET 3.0+ (which was included in Windows Vista and beyond by default ) you could go as far as use WPF to do the UI work.

You can do it by doing the following:
Create a new entry in the TextStyle table, like this for example:
After this you can reference to the new TextStyle in the Control Table (column "Text") just like this: {\WixUI_Font_Wingdings}YourAwesomeText

Related

add hyperlink in wix installer error message

I'm trying to add hyperlink inside of DisallowUpgradeErrorMessage (from here http://wixtoolset.org/documentation/manual/v3/xsd/wix/majorupgrade.html):
<MajorUpgrade AllowDowngrades="no"
DisallowUpgradeErrorMessage='Older version of MWL installed. Please follow https://example.com/uninstall.html'
/>
I already try to create HTML hyperlink inside message, but got error, something like
"invalid character inside of attribute"
I replace <> characters with < and >, but it not work (shown as plain text). Is there any other ways to do this?
The default WiX dialogs do not support hyperlinks in their text so you will have to create your own custom UI rather than relying on the condition elements. You can find an example of how to do this here.
However, for the case you have mentioned you can have WiX automatically uninstall the previous version of your software. In cases such as this I have found the Upgrade element to be more useful than MajorUpgrade, it allows for granular control of conditions and actions. You can view an example of using the Upgrade element as well as forcibly removing existing products here.

Creating Element as first item within another element using Wxs (Windows Installer)

I am using Wix installer for an application and one of the scenarios I am trying to handle is changes to a .config file when the application is upgraded.
Essentially, I would want to add an Xml Element within another Xml Element.
For instance, the original .config file that was shipped with application looked like this
<root-element>
<sub-element-1/>
<sub-element-2/>
</root-element>
During app lifetime, it was updated to as below at some point.
<root-element>
<sub-element-0/>
<sub-element-1/>
<sub-element-2/>
</root-element>
For handling this case , where I need to add <sub-element-0/> under <root-element>, I tried this Wxs code.
<util:XmlFile Id="MyConfig"
File="[fileidOfMyConfigFile]"
Action="createElement"
Name="sub-element-0"
ElementPath="root-element"
Sequence="1"/>
The above formulation does add the sub-element-0 under root-element , however as the last item under the root-element.
like so
<root-element>
<sub-element-1/>
<sub-element-2/>
<sub-element-0/>
</root-element>
I couldn't find any resources on adding it as first element as I want it to be.
Any suggestions on how it could be accomplished?
Note: The above is a simplified version of my use case. The reason order is important in my case is due to a limitation on the framework that some elements need to occur before other elements in the .config

WiX: returning a value from exepackage

I have been asked to add a function to an existing WiX package.
Specifically, I need to run a small c# application and return a single int back to WiX to conditionally control further actions.
I can see from ExePackage help that there is an ExitCode, but this is an enumeration of success, error, scheduleReboot or forceReboot.
I have googled quite a bit and I am wondering if I am missing the point. I can probably implement the C# process internally within WiX to get the user to provide the information I need, but the existing package already has custom ExePackages written in C# with a particular style, so I'd like to stay with that if I can. (The existing packages don't return any needed values)
Can I do this, or do I need to try and operate entirely within WiX?
For reference, one of the existing packages looks like this:
<ExePackage
SourceFile="..."
DisplayName="License Key"
InstallSize="0"
Permanent="yes"
InstallCommand="/ignoreIfLicensed"
RepairCommand="/ignore"
UninstallCommand="/ignore"
/>
The reference to <ExePackage ...> implies you want the condition to operate in a WIX bundle. In this scenario I think your options are limited and you can only map the return value of an ExePackage to global behaviour like forceReboot.
Do you have any <MsiPackage...> references? If you have, you could move the conditional behaviour inside each <MsiPackage...> using a Custom Action to call the exe and set a property. The property can then be used as a condition in each <component...> you want to conditionally install. See Using a WiX custom action to set a property's value for more information on custom actions setting properties.

What are the binary references in WIX?

I've used the dark.exe to create a WXS file from my 'old' Visual Studio 2010 msi file.
When I open the created WXS file, It has binary references on the top of the file that I can't explain. Can somebody tell me about it? And where can I find some documentation about it?
<Binary Id="InstallUtil" SourceFile="C:\Temp\Binary\InstallUtil" />
<Binary Id="MSVBDPCADLL" SourceFile="C:\Temp\Binary\MSVBDPCADLL" />
<Binary Id="VSDNETCFG" SourceFile="C:\Temp\Binary\VSDNETCFG" />
<Binary Id="DefBannerBitmap" SourceFile="C:\Temp\Binary\DefBannerBitmap" />
<Binary Id="UpFldrBtn" SourceFile="C:\Temp\Binary\UpFldrBtn" />
<Binary Id="NewFldrBtn" SourceFile="C:\Temp\Binary\NewFldrBtn" />
The top three are giving me the most questions because I don't where there for and what they do.
Short answer - these files are used in ui dialogs, custom actions, all places where some files are applicable to the functionality of the setup itself, but the product it installs.
In your case, the first three are DLLs used by Visual Studio Setup Projects to perform custom actions - MSI extensibility blocks. The last three are the icons used in UI dialogs later in code.
To get the files themselves, you should use export binaries parameter for Dark.exe.
Now, your options here depend on what you want to achieve. If your task is just upgrade your setup to VS2012, quick and dirty, then use the exported files as they were, it should work.
If, however, you want to do it clean and nice, or you should update your setup with new features, then you will have to rewrite these.
For UI: if your project does not contain custom UI, I suggest switching to WIX UI library - nice and built-in. If you have custom UI, you may extend it, but it is a lot more work. There are visual UI editors for WIX.
For custom actions: custom action is something you use when MSI/WIX abilities do not give you enough. To upgrade these, you should look where these first three binaries are used, and how they are called. Usually, the meaning of custom action may be devised from its name. Then, you have to replace these custom actions with your own (or ready-made by others or WIX team) that do the same. Then you may remove the unused binaries.

Overriding banner image in Wix 3.5 Wixlib doesn't work in actual MSI

I am using several articles and other questions in order to override the banner bitmap images for a binary wixlib that I am using in 20+ other installers. This library provides our own custom UI, some custom dialogs, common resources, binaries, custom actions, etc.
Here is the code I am using in the wixlib to override the images:
<Binary Id="WixUI_Bmp_Banner" SourceFile="Bitmaps\bnnrbmp.bmp/>
<Binary Id="WixUI_Bmp_Dialog" SourceFile="Bitmaps\dlgbmp.bmp/>
But when I reference my wixlib in my actual MSI project, everything works except for the UI banner image overrides (my custom dialogs fire, process works, common binaries get installed, etc.). Is there something special I need to do in my binary wixlib project to override the UIExtension.wixlib default images in my own binary wixlib?
I saw this question here: Can WixUiBannerBmp be set in a wixlib?, however the answer to that question didn't answer the question, it was directly related to an icon and I'm not sure this guy was using a binary wixlib (re-distributable). My add/remove programs icon embedded in the wixlib already works just fine.
Images are specified via bind-time variables, not Binary elements. Your .wixlib can contain the variable values. The approach used in Can WixUiBannerBmp be set in a wixlib? doesn't use a .wixlib, but otherwise is the same. (A .wixlib is just a collection of .wixobj files.)
The WiX help file documents the variables in "Customizing Built-in WixUI Dialog Sets":
Replacing the default bitmaps
The WixUI dialog library includes default bitmaps for the background of the welcome and completion dialogs and the top banner of the other dialogs. You can replace those bitmaps with your own for product branding purposes. To replace default bitmaps, specify WiX variable values with the file names of your bitmaps, just like when replacing the default license text.
Example:
<WixVariable Id="WixUIBannerBmp" Value="banner.bmp" />
<WixVariable Id="WixUIDialogBmp" Value="dialog.bmp" />