Adding first custom Dialog Box to WIX in VisualStudio environment

前端 未结 1 2083
小蘑菇
小蘑菇 2021-01-06 05:33

I\'m using Visual Studio to build my wix file. So far I have one file Product.wxs and it\'s working for a simple install.

Now I want to add some custom dialogs.

相关标签:
1条回答
  • 2021-01-06 05:45

    Do I need to copy some (only the ones I want to change) or all these files to my VisualStudio Project. Until now, I have been running with none of these source files.

    Since you are already using WixUI_Mondo, I assume you want to customize that UI. Locate WixUI_Mondo.wxs in the wix sources, and copy that to your visual studio project. Rename the file to WixUI_MyCustomUI.wxs and change the UI Id attribute inside the file to Id="WixUI_MyCustomUI". You don't need to copy any other files yet; the dialogs referenced in the copied UI sequence are compiled into the wix tools as resources, so wix "knows" these dialogs by name.

    In your product.wxs file, change the UI reference to <UIRef Id="WixUI_MyCustomUI" />. If you now rebuild your setup, the UI should still look exactly as WixUI_Mondo as we haven't customized anything yet.

    If that worked, you'll probably want to customize or add a dialog. Again, you can start from an existing dialog by copying it from the wix sources. You'll also have to edit the WixUI_MyCustomUI.wxs file so that it uses your new dialog. Take a look at this other answer I wrote for an example.

    How does my Product.wxs know to use these files? Does it look at local directory first? Or do I have to rebuild some C# modules?

    You do not have rebuild any C# modules. The only reason you downloaded the wix sources is because the existing UI sequences and dialogs are good examples to start from. In principle you could also ignore the wix sources and write these wxs files for the UI sequence and dialog definitions from scratch.

    When you use the command line tools, you combine multiple wxs files by simply passing multiple file arguments and they will be compiled and linked together. If you use wix with visual studio, you just have to add the wxs file to the project. A non-trivial wix setup will typically be defined by many wxs files.

    The content of a wxs file can container references to elements in other wxs files through elements such as UIRef, ComponentRef, ComponentGroupRef, DirectoryRef etcetera.

    0 讨论(0)
提交回复
热议问题