Mat Rat
Mat Rat

Reputation: 125

Add pages to installer -Wix Toolset

I'm looking for a way to add new pages to installer with its own interface. Ultimately, I would like my installer to do many things in turn, enabling the user to go to the next pages and check or set subsequent configurations.

But at the moment I'm looking for how to add an additional page that would run before installation and check if the computer has the required programs to install the application. I would like to attach my ready code to c # to check if these programs are installed on the given computer.

By using this tutorial: https://www.youtube.com/watch?v=6Yf-eDsRrnM&t=7195s I created the basic version of the installer. In the tutorial we create installer by using WixUI_Minimal.

I have looked through the documentation and it is written that you can create your own pages, but I can't find anywhere. For example there https://wixtoolset.org/documentation/manual/v3/wixui/ is Customizing Built-in WixUI Dialog Sets but they dont show how do that.

Upvotes: 4

Views: 2379

Answers (3)

Stein Åsmul
Stein Åsmul

Reputation: 42126

Overall Advice: It is generally an anti-pattern - as of this IT-epoch - to do too much with your setup GUI. In particular it is better to do per-user configuration as part of the application launch.

Rule of Thumb: You should limit setup-GUI to genuinely shared settings that need to be written with admin or elevated rights to per-machine locations (inaccessible for normal users). Set everything else from application launch. This can also help QA personnel with their testing.

Burn: Burn is the WiX toolkit's setup.exe creator. It is a bootstrapper, chainer, downloader, installer, etc... construct. Hello-Burn sampler here. And about replacing Burn's default GUI.


WiX MSI GUI: I have a minimalistic sample here for how to change your MSI installer GUI: https://github.com/glytzhkof/WiXCustomDialog. This is the GUI embedded inside your actual MSI. There are other possibilities with GUI.

GUI: You can replace the GUI inside each MSI with a GUI from a Burn setup.exe. There are some details here. This GUI you can implement as a normal executable with all the bells and whistles that allows. The MSI GUI is rudimentary and old. There is another answer here on how to change installer GUI.

Upvotes: 1

KargWare
KargWare

Reputation: 2183

Update 21th April 2020

I have created a public GitHub Gist, which explains the steps and even include a customized Dialog PrerequisitesDlg.wxs with up to 5 Prerequisites, which can be configured as WiX Properties (text and condition). The whole sequence is wrapped in WixUI_KargWareFeatureTree.wxs.

Text before 20th April 2020

The element you need is UIRef Element, Wix Toolset v3 Documentation.

Wix Toolset is an open source project, so you can review it on GitHub, Wix Toolset v3.

The dialoges which are embed in Wix Toolset are listed here, Source Code of the Default UI-Dialoges of Wix ToolSet. I would use the WixUI_Advanced one, but you can pick all others or start even from scratch.

  1. Download the WixUI_Advanced.wxs from GitHub
  2. Copy the wxs file to the root of your msi-project (where the *.wixproj os placed) and name it to e.g. MyWixToolsetPages.wxs
  3. Edit the name of the UI xml element inside MyWixToolsetPages.wxs (near to line 50)
  4. Add the MyWixToolsetPages.wxs to your wixproject
  5. Replace or add the UIRef reference element in the product.wxs to <UIRef Id="WixUI_MyWixToolsetPages"/>
  6. Add your new dialog as <DialogRef Id="myNewPage" />
  7. Customize the order of the pages with Control Next / Back and Event NewDialog
  8. Be aware to test your sequence in both directions (next, next, next, end) and (end, back, back, back)

Change <UI Id="WixUI_Advanced"> to <UI Id="WixUI_MyWixToolsetPages"> inside your MyWixToolsetPages.wxs (copied from the original WixUI_Advanced.wxs)

...
<UI Id="WixUI_MyWixToolsetPages">
...

Replace the UIRef inside the product.wxs

...
<UIRef Id="WixUI_MyWixToolsetPages"/>
...

Upvotes: 5

Christopher Painter
Christopher Painter

Reputation: 55571

I maintain an open source wix authoring tool that enables you to do this by uncommenting one line of XML. The trick is to insert additional rows into the ControlEvent table causing existing paths to be overridden.

https://github.com/iswix-llc/iswix/blob/master/Application/IsWiXNewAddIn/MSISolutionTemplate/SetupProjectTemplate/UI.wxs

https://github.com/iswix-llc/iswix/blob/master/Application/IsWiXNewAddIn/MSISolutionTemplate/SetupProjectTemplate/UI-CustomDialog.wxs

Upvotes: 1

Related Questions