How to create a bootstrapper with a log window - wix

Currently I'm using the standard WixStandardBootstrapperApplication.HyperlinkLicense bootstrapper theme.
This theme doesn't show much information during installation. I was wondering if there is a theme that shows the log output of each installer it executes. Maybe after clicking an advanced button. I've seen this in a few installers but of course I do not know for sure if these were made with Wix.
I've tried inspecting the existing themes with ThmViewer.exe but unfortunately this program either crashes, or displays no preview window.
I've found a reference to something called the ExecuteProgressActionDataText here
<Text Name="ExecuteProgressActionDataText" X="11" Y="163" Width="-11" Height="17" FontId="3" DisablePrefix="yes" />
But unfortunately I cannot get my bootstrapper to launch if I use the supplied theme file. I think I need a complete theme file, but I'm not sure where to find the original one for the WixStandardBootstrapperApplication.HyperlinkLince theme.
Any thoughts on how to create a bootstrapper with a log window?
Update:
I've found the original xml of the HyperLink theme here. Using that I've added the ExecuteProgressActionDataText element to my UI. Its a single label that displays a lot of events. But unfortunately its not a listbox or something like that which makes it quite useless. (There are way too many messages per second to make sense of them in a single label).
The theme file seems to be driven by WixStandardBootstrapperApplication.cpp and unfortunately I do not see any other variables defined there that have a name that indicates that they do what I want :(.

You have to modify the bootstrapperapplication.cpp to implement the listview yourself. You can add the view in the wix theme I believe but you would have to alter OnExecuteMsiMessage so that instead of using ThemeSetTextControl(....) you have to add a new list item to the listview. You should be able to do anything you want in the bootstrapper application with regards to the UI just need to figure out how

Related

How to override default WinUI 2.x styles in Blend?

Previously I had asked where to find the default styles for the WinUI 2.x controls, and was pointed to the appropriate repository in GitHub where those could be found. Thanks! However, what I really want is to be able to override some of the styles. I was expecting that I would be able to do so in Blend, but I have not been able to figure out how to do that.
For example, when I load my project in Blend and then try to edit the templates for the ContentDialog, I am offered the option to apply an existing style, but not to create a new one. I was expecting I could create a copy, which would give me the default styling as a starting point and allow me to make the small modifications I require. Regarding buttons, I was able to edit a copy of the template, but that only gave me access to the ControlTemplate where I want access to the equivalent of DefaultButtonStyle.
It has been a while since I've used Blend, so perhaps I am mis-remembering how the tool works. But in previous versions of our app I was able to generate resources that included the full styling of the controls that I was using, such as buttons and content dialogs. Can I do the same for our current app that uses WinUI 2.x? If so, how? And if not, what are my alternatives? I have considered copying the default templates I am interested in into the resources of my project and making modifications that way, but I am hopeful that there is a better way.
Rich
I am offered the option to apply an existing style, but not to create a new one
This is expected. For example, both the Visual Studio or the Blend for Visual Studio can't directly create a default DropDownButton style of WinUI. You need to manually copy the WinUI style from Github and put the style in your XAML.
For native UWP controls, you could just generate a copy of the style automatically.

How can I use WixUI to select a server to run a script on Installation

Im using Wix# to deploy our software which needs to run an SQL script to install the database on installation.
However I would like to give the user the option to select the server to install the database on, or install a new server instance to run the script on.
I have looked into creating custom UI for the installer, as well as running SQL scripts and chaining other installations with the setup, but so far I couldn't figure out how to make the UI communicate with the setup.
Thanks in advance!
All data you're working with you can store in properties. Here's stackoverflow question about setting properties and binding them to controls.
So if you want user to type name of database - just do it as described.
But if you wat to show combobox with server list - it will be little bit harder. You should add combo box element, for example:
<Control Type="ComboBox" Id="id" Width="10" Height="10" X="10" Y="10" Property="SELECTED_SERVER">
And after that you'll have two options:
Here's an option to manually populate it
Here's an option to populate it dynamically. In this case you should run that custom action before you show combo box - for example on next click of previous window or after installer was just started.
Anyway, your property (SELECTED_SERVER) will be binded to that control and you can easily use it in your script or custom action later.

How can I get more text onto the WelcomeDlg?

I've got some verbose text that's being truncated on my WelcomeDlg:
Clearly there's loads of room in the dialog for the extra lines of text, but the text box is too small. How can I make it larger?
You can take a look at the source for the WelcomeDlg to see what is happening. The text you are displaying is the <Control Id="Description" .... />, but you'll notice there is also another text field below it for describing a patch if it is being applied.
You can customize the WelcomeDlg by following the instructions in the last couple of section of this page in the manual. Here are some quick steps:
Copy the fragment for the WelcomeDlg into your own project from the Wix sources.
Change the Id attribute of the Dialog tag to be unique. You can then make any changes to the dialog you need (such as making the patch description field smaller and the description field taller).
Copy the fragment that defines your UI sequence from the Wix sources into your project. If you were using the WixUI_InstallDir sequence you would copy this file.
In your custom dialog sequence file you need to change the Id attribute of the UI tag to be unique and any references to WelcomeDlg to the Id you put on your custom WelcomeDlg.
In your main package change your <UIRef Id="..." /> tag to reference the custom dialog sequence.
Not to dismiss your requirement outright, but I would keep in mind that the attention span of a user running an installer is about that of a 2 year old. They likely won't read whatever you are putting there in the first place. Same goes for that EULA that management always wants to make sure the user scrolled all the way through before being allowed to click I Accept.
I follow a minimalist approach when creating installer UI. Next, Next (if needed), Install, Finish. Still don't quite like the Install Finish pattern but some do.

How to reference an icon resource file reference in XAML

I'm trying to get a button to display an icon in XAML. Initially I wanted to paste a character instead, but vb Express 2008 would not recognise it being a symbol as it is not a regular character. Then I created an icon and tried to set the button image property to reference it, but this does not exist, so more misery. Now I've used the project resources to add the icon file which it has shoved in the project resources directory.
What I want to do is use XAML to display the icon, in this tag:
<Button>
<Image Source="{StaticResource UpArrow}"/>
</Button>
I ideally want to have the image in a separate file and reference it by the project. I am a bit confused by the content/resource issue.
I tried to access it using:
<UserControl.Resources>
<BitmapImage x:Key="UpArrow" _
UriSource="Resources/_25B2_Triangle__black__up_pointing.ico" />
</UserControl.Resources>
I've read some stuff about the pack assembly which is massive and confusing. Surely, putting an icon into the resources file should make it easy to reference using /Resources or similar, instead of the absolute file path, otherwise, what is the point of it?
I am wanting to do it all in XAML rather than code-behind because then this work would all be done by the client, but maybe I am not undestanding when to use code behind. With WPF, there is very little written about what you are trying to do at the large scale and why you would want to do it, apart from MS constant refrain of how 'cool' it is, -which is not very helpful.
Thanks..
The easiest way to do this is:
<Button>
<Image Source="Resources/_25B2_Triangle__black__up_pointing.ico"/>
</Button>
The important thing to remember is to make sure that your icon file is recognized as a valid Resource by your application. With WPF, there is one more step you need to take versus the old winforms way of doing it.
In your Solution Explorer, expand the 'Resources' folder, then click on the "_25B2_Triangle_black_up_pointing.ico" file. Then press F4 for properties. Make sure that the 'Build Action' property is set to 'Resource'.

WiX Show Dialog Based on Feature to be Installed

Let me be upfront I am novice with WiX. I have a custom dialog CustomSetupTypeDlg.wxs that changes the Typical/Custom/Complete to Desktop/Server/Suite. It sets WixUI_InstallMode to InstallDesktop, InstallServer and InstallSuite appropriately.
I need to have the user browse for an installation folder depending upon what feature is to be installed. If InstallDesktop or InstallSuite is selected the user has to select two different paths for DESKTOPINSTALLDIRECTORY and SERVERINSTALLDIRECTORY. However if the install mode is InstallServer only SERVERINSTALLDIRECTORY choice should be presented.
I am uncertain on how to go about doing this.
You want to have actions in your InstallExecute sequence that display the dialogs you need. Inside the tag you provide a conditional, which, when true, causes the action to actually happen. See this tutorial, specifically section 5.3 for a list of conditionals.
I decided to simplify the project by splitting the desktop and server features into two separate installers.