Haphil
Haphil

Reputation: 1250

How to use Burn Built-in Variables in Wix files .wxs

With the installation of my .msi I want to add a shortcut (.lnk) to the windows startup folder. (I do NOT want to add the .lnk to the registry in order to autostart my app! - this would work already, but is not my intent!)

Searching for a solution (btw: I know CustomAction are able to do the trick) I stumbled over Burn's built-in variables. As I understood it burn is used to chain multiple Wix installation packages. I wonder if/how I can use these burn built-in variables inside a .wxs file (shortcut/directory tag) also?

By now I am using a single .wxs file

<Wix ..>
<Product ..>
...

Upvotes: 0

Views: 2512

Answers (1)

Stefan Wanitzek
Stefan Wanitzek

Reputation: 2124

You can pass your variables to the packages via regular MSI-properties. Introduce a public property in your MSI-package and then set it via the MsiProperty-tag in the burn installer.

In the WXS-file of the MSI-packages:

<Property Id="MYPROP" Value="DefaultValue"/>

In the WXS-file of the bootstrapper you can set the variable:

<MsiPackage SourceFile="MyFile.msi">
  <MsiProperty Name="MYPROP" Value="[StartupFolder]" />
</MsiPackage>

You can use this variable inside your MSI-package via the [MYPROP] in many tags.

Note that public properties must be made up of only uppercase letters.

Upvotes: 3

Related Questions