How do I pass a default 'install location' to the RtfLicense bootstrapper?

做~自己de王妃 提交于 2019-12-06 20:58:08

问题


I'm using an rtflicence standard bootstrapper to install dotnet before my poject msi in a chain.

I noticed that there's an 'options' button which displays an install location dialog and allows the user to change the default installation directory.

I need to either:

  1. Prevent this options button from being displayed, or
  2. Populate the install location with a default path, and pass this back to the installer should the user change it.

I read that it's possible to pass Burn variables to msipackages from bootstrapper but I haven't found any further details and would appreciate being pointed in the right direction.

Thanks


回答1:


To go with option 1, you'd have to roll your own BootstrapperApplication and remove the options button from the menu.

Option two is significantly easier to implement. The bootstrapper uses a special Burn variable called InstallFolder to get and set what is in the text block on that view, which you can assign inside the Bundle element.

<Variable Name="InstallFolder" Type="string" Value="[ProgramFilesFolder]"/>

The constant ProgramFilesFolder will set the value of that text block when the program starts, and if the user browses to a different directory, it will be stored in that same variable. To pass it to the MSI, in your chain, you pass the InstallFolder using the MsiProperty tag (INSTALLLOCATION is the name of the property in your WiX project).

<MsiPackage Vital="yes" DisplayName="Your Name" Id="MsiId" SourceFile="path/to/file.msi">
    <MsiProperty Name="INSTALLLOCATION" Value="[InstallFolder]" />
</MsiPackage>



回答2:


I just discovered the SuppressOptionsUI option that addresses your Option 1 without rolling your own BootstrapperApplication:

<?xml version="1.0" encoding="UTF-8"?>

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
 xmlns:bal="http://schemas.microsoft.com/wix/BalExtension">

   <Bundle>
      <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense">
         <bal:WixStandardBootstrapperApplication LicenseFile="..\eula.rtf" SuppressOptionsUI="yes"/>
      </BootstrapperApplicationRef>

      <Chain>
      </Chain>
    </Bundle>
</Wix>



回答3:


I think you can try removing the options button by creating a theme. I haven't had to use themes myself but here are two related SO links that may get you pointed in that direction:

WiX bootstrapper theme file?

Theme for my WiX Installer



来源:https://stackoverflow.com/questions/13085051/how-do-i-pass-a-default-install-location-to-the-rtflicense-bootstrapper

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