2

I am creating a Bundle installer, using WiX standard bootstrapper in order to install .NET Framework 4.5 (if not yet installed) and my application in the user's computer. The bundle installer also allows the user to set the installation path for the application, and uses WiX standard bootstrapper's UI only (no other installers' interfaces are shown to the user).

Right now I'm struggling to allow the user to launch my application at the end of the installation.

Closest related anwers I could find use a variable named LaunchTarget, which causes WiX standard bootstrapper to display a "Launch" button in the end of the installation.

Given solutions and why I wasn't able to use them follow:

  • Answer "A" suggests setting the LaunchTarget variable to the exact folder inside "Program Files" folder where the application should be installed. This doesn't work for me, because I want to allow the user to specify the target installation folder (application can be installed outside of the "Program Files" folder).

  • Answer "B" suggests setting the LaunchTarget variable by using the InstallFolder variable to determine where the user configured the standard bootstrapper to install the software to. This seemed perfect for my case, but after setting the LaunchTarget value simply to "[InstallFolder]" I verified that pressing the "Launch" button in the standard bootstrapper's UI actually opens the folder where the installer is running, and not the folder where the user chose to install the software, as I expected. (is that a bug?)

Question is: how can I correctly set the LaunchTarget variable to the right path, considering that the user can modify the installation folder through WiX standard bootstrapper's UI?

The code for the Bunde follows.

<?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 Name="My Game Trainer" Manufacturer="MY_MANUFACTURER_ID_HERE" UpgradeCode="MY_GUID_HERE" Version="!(bind.packageVersion.TrainerMsiPackage)" DisableModify="yes">
    <Variable Name="LaunchTarget" Value="[InstallFolder]" />

    <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLargeLicense">
      <bal:WixStandardBootstrapperApplication ShowVersion="yes" LicenseFile="PATH_TO_MY_LICENSE.rtf" />
    </BootstrapperApplicationRef>

    <Chain>
      <PackageGroupRef Id="NetFx45Web"/>
      <MsiPackage Id="TrainerMsiPackage" SourceFile="$(var.SetupMSI.TargetPath)" DisplayInternalUI="no">
        <MsiProperty Name="TRAINER_INSTALL_DIR" Value="[InstallFolder]"/>
      </MsiPackage>
    </Chain>
  </Bundle>
</Wix>

Using WiX Toolset v3.11.1 (+Visual Studio 2017 Extension).

vinicius.ras
  • 1,516
  • 3
  • 14
  • 28
  • I think this was asked [before - the accepted answer in the link you already mentioned](https://stackoverflow.com/a/15682656/4634044). The solution was to add another `MSIPackage` in the `Chain` which only use was to start the application using a custum action – ChristianMurschall Sep 17 '18 at 14:33
  • I might be wrong, but to my understanding this solution would not display a "Launch" button integrated to the UI of my bootstrapper application (it would require me to create and launch a separate UI in the new MSI package just to ask the user if he/she wants to run the application). I'd like to have a "Launch" option in my bootstrapper UI, preferrably without having to write a custom bootstrapper for that (i.e. using WiX Standard Bootstrapper). – vinicius.ras Sep 17 '18 at 15:14
  • 1
    Oh, that's right. I forgot about the launch button. Two more ideas: (1) store the install location in the registry, and in your burn project query it with a `RegistrySearch` (2) Very stupid but did you try ``? – ChristianMurschall Sep 17 '18 at 15:18

0 Answers0