Add pages to installer -Wix Toolset

时光毁灭记忆、已成空白 提交于 2020-04-16 02:16:45

问题


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.


回答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/all/tree/master/WiXCustomDialog (zip version here). 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.




回答2:


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




回答3:


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"/>
...


来源:https://stackoverflow.com/questions/61138797/add-pages-to-installer-wix-toolset

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!