Adding first custom Dialog Box to WIX in VisualStudio environment
Asked Answered
C

1

4

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. I think from the two articles below, I understand how to do it - after I get my environment set up:

http://blog.torresdal.net/2008/10/24/WiXAndDTFUsingACustomActionToListAvailableWebSitesOnIIS.aspx and http://www.merlinia.com/mdt/WiXTutorial2.msl

I downloaded the source, and I see 35 *.wxs file in this directory wix35-sources.zip\src\ext\UIExtension\wixlib

This is where I'm starting to get lost.

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

  2. 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?

I included these lines in my Product.wxs, and it gave me the user interface at execution time:

    <UIRef Id="WixUI_Mondo" />
    <UIRef Id="WixUI_ErrorProgressText" />

Thanks,

Neal

Cathryncathy answered 12/1, 2010 at 22:2 Comment(0)
R
5

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.

Rostellum answered 12/1, 2010 at 22:25 Comment(2)
Thanks for the clear explanation. On the first build after copying the file, renaming, and updating id, I get: error LGHT0094: Unresolved reference to symbol 'WixUI:WixUI_WCFCustomUI' in section 'Product:{guid...}'.I already had Visual Studio project reference to WixUIExtension to get the Mondo to work.Cathryncathy
Have you added the wxs file to your visual studio project? The error seems to indicate that the copied wxs file is not added to the project, or the Id in the UI and UIRef elements doesn't match.Rostellum

© 2022 - 2024 — McMap. All rights reserved.