4

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.

Mat Rat
  • 105
  • 1
  • 11

3 Answers3

4

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"/>
...
Ruben Helsloot
  • 12,582
  • 6
  • 26
  • 49
KargWare
  • 1,746
  • 3
  • 22
  • 35
  • You can also have a look to the wix v3 docu on github: [Changing the UI sequence of a built-in dialog set](https://github.com/wixtoolset/wix3/blob/develop/src/chm/documents/wixui/WixUI_customizations.html.md#changing-the-ui-sequence-of-a-built-in-dialog-set) and [Inserting a custom dialog into a built-in dialog set](https://github.com/wixtoolset/wix3/blob/develop/src/chm/documents/wixui/WixUI_customizations.html.md#inserting-a-custom-dialog-into-a-built-in-dialog-set) – KargWare Apr 14 '20 at 06:22
  • Doing so with the WixUI_Minimal page I have a lot of errors like: "This typically means that an Id is duplicated. Check to make sure all your identifiers of a given type (File, Component, Feature) are unique." and "Location of symbol related to previous error." – Mat Rat Apr 14 '20 at 07:10
  • @MatRat you are right. But you can prefix / postfix your doublicated thing, like the IDs of CustomAction. Properties and WixVariables were fine for me. – KargWare Apr 14 '20 at 07:12
  • I don't know if I understood you correctly. I probably do something wrong, but it still doesn't work. I added the word "second" to "        1 "and now I have this error" Suppression State Error Unresolved reference to the symbol 'Dialog: ErrorDlgSecond 'in section' Fragment " – Mat Rat Apr 14 '20 at 07:23
  • Is ErrorDlgSecond also a file ErrorDlgSecond.wxs? You need to create the dialog and add the file to your project. Copy [ErrorDlg.wxs](https://github.com/wixtoolset/wix3/blob/develop/src/ext/UIExtension/wixlib/ErrorDlg.wxs) and change the ` – KargWare Apr 14 '20 at 07:29
  • It's terribly problematic, after adding these dialogues, in them the next things do not see other dialogues. Nevertheless, thanks for answering and trying to help. I will test it and think about what to do. – Mat Rat Apr 14 '20 at 08:02
  • Can you share (here or on e.g. GitHub) the code? What you have reached / tried? Maybe working on a shared code base is easier to help – KargWare Apr 14 '20 at 08:06
  • A copy that and change Name/ID https://github.com/AnalogJ/Wix3.6Toolset/blob/master/RC0-source/wix36-sources/src/ext/UIExtension/wixlib/WixUI_Minimal.wxs. Next I copy from this all needed dialogs https://github.com/AnalogJ/Wix3.6Toolset/tree/master/RC0-source/wix36-sources/src/ext/UIExtension/wixlib. And i change names for this dialogs. But still throw duplicated errors for because it isnt exist and throw need duplicate excetion in created dialogs. – Mat Rat Apr 14 '20 at 08:22
  • I don't want to wast your time. I need to talk to my supervisor and make a decision. If I still have to fight it and cannot cope, I will write to you. Thanks – Mat Rat Apr 14 '20 at 08:23
  • 1
    You are never wasting my time. I accept the challenge and create a [GitHub GIST](https://gist.github.com/N7K4/8b146328db03484a61543c4f612c5dd3) – KargWare Apr 21 '20 at 11:15
  • Wow, great job it will very useful for me. – Mat Rat Apr 21 '20 at 11:28
1

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.

Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164
  • Would it be a good solution to create a wpf application that would follow all these steps, and only use wix for one step, i.e. installation in the right places of projects? – Mat Rat Apr 14 '20 at 07:13
1

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

Christopher Painter
  • 54,556
  • 6
  • 63
  • 100