简体   繁体   中英

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

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.

This link explains how to do it in simple way.

link UIRef

IsWiX supports this feature. Take a look at:

IsWiXMerges.wxs

IsWiXInstaller.wxs

The trick is that I'm using a Directory named INSTALLLOCATION along with a UIRef of WiXUI_*. This is what the WiXUI uses similar to the way InstallShield uses INSTALLDIR and Visual Studio uses TARGETDIR.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM