Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 971
adamonstack Avatar asked Oct 26 '12 10:10

adamonstack


2 Answers

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>
like image 93
levarius Avatar answered Nov 03 '22 09:11

levarius


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>
like image 18
Jacob Avatar answered Nov 03 '22 09:11

Jacob