0

I am creating an installer for an application that is broken into two parts. The first part is an MSI file that is installed on a server. It includes all of the product executables and data files as well as the installer for the client application. This was easily created using WiX (v3.7). The client installer (to be run from network workstations) simply needs to install a prerequisite component on the workstation and then create shortcuts to the applications on the network drive. I use Burn to create the client installer, but I can't get the shortcuts created.

My problem is that I don't know how to get the client installer (MSI) to know about the network directory where the applications reside. It is the directory were the bootstrapper is located, but the contained client installer doesn't run from that directory.

How do I get this directory or is there perhaps a better way to approach to whole installation sequence?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131

2 Answers2

0

With a custom Bootstrapper Application DLL (BA), you can set a Burn variable by getting the path to the process's entry module. Then in your Bundle, define the burn variable, and pass it to the Windows Installer package as a property. Use the property in your setup project.

To set up a custom BA project, it is far easier to create a .NET project [tutorial].

<Variable 
  Name="BootstrapperDirectory" 
  Persisted="yes" 
  Type="string" 
  bal:Overridable="yes" 
  Value='BootstrapperDirectory not set. Try passing it on the 
  command line like "BootstrapperDirectory=%cd%" 
  or writing a custom BA to set it programmatically. 
  It must also be declared with bal:Overridable="yes".' />

<Chain>
  <MsiPackage SourceFile="$(var.SetupProject1.TargetPath)" DisplayInternalUI="yes">
    <MsiProperty Name="BOOTSTRAPPERDIR" Value="[BootstrapperDirectory]" />
  </MsiPackage>
</Chain>
Tom Blodget
  • 20,260
  • 3
  • 39
  • 72
0

You could get the directory from the built-in Burn Variable WixBundleOriginalSource and pass that into your MSI using the MsiProperty element as Tom suggested.

That gives you the complete path to the setup executable though. From there, you could use a custom action to extract the part of the path you need and set a Msi property for your shortcuts to use.

Dave Andersen
  • 5,337
  • 3
  • 30
  • 29