Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wix - Custom installation directory

I'm using Wix 3.x and the user should be able to choose the target directory. My Setup.wxs is currently like here: http://pastebin.com/uH1EjbDQ

What is the simplest way to ask the user for a custom target directory? (INSTALLDIR/TARGETDIR?!) I have seen example in which people build there own dialog pages but this isn't really necessary, is it?

Update:

When I add

<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR"/>
<UIRef Id="WixUI_InstallDir" />

after <UIRef Id="WixUI_Mondo" /> but before </Product> I get the following error:

The primary key 'ExitDialog/Finish/EndDialog/Return/1' is duplicated in table 'ControlEvent'. Please remove one of the entries or rename a part of the primary key to avoid the collision. (LGHT0130) - C:\delivery\Dev\wix30_public\src\ext\UIExtension\wixlib\WixUI_Mondo.wxs:44

Now when I remove <UIRef Id="WixUI_Mondo" /> I can build the setup. But the dialog "Choose Setup Type" (Complete, Typical, Custom) is not shown anymore. And another weird thing: Sometimes a dialog pops up, stating it calculates disk space (it has a cancel button), but eventually it never closes by itself. When I close it I can still continue. Is there a way to fix this in a simple manner?

Thanks, Philip

like image 217
Philip Avatar asked Jan 14 '11 16:01

Philip


1 Answers

The UIRef element refers to one of the standard user interface sequences provided by WiX:

  • WixUI_Mondo
  • WixUI_Advanced
  • WixUI_FeatureTree
  • WixUI_InstallDir
  • WixUI_Minimal

You can only use one of these sequences in your installer. Each one of these has a set of dialogs. For information on what dialogs are included in each of these sequences see the WiX documentation.

The WixUI_Mondo allows the user to specify the installation directory if they choose a Custom install. Only WixUI_Mondo allows the user to choose a typical, custom or complete install.

The simplest way to allow the user to choose the installation directory is to use the WixUI_InstallDir dialog sequence.

SharpDevelop's own installer uses the WixUI_FeatureTree dialog sequence.

So if one of the standard sets of dialogs provided by WiX is not what you want you could look at customising the dialog sequence. Creating your own custom dialogs is generally the last resort.

like image 94
Matt Ward Avatar answered Oct 03 '22 03:10

Matt Ward