Rainer
Rainer

Reputation: 356

WiX CustomAction: How to get bootstrapper location from msi

For a custom action I need the location of the installers bootstrapper path.

session["SourceDir"] gives me:

C:\ProgramData\Package Cache\{67668D1E-88B7-4D10-B1B5-98D42AA088E5}\...
but my setup during my test is located in C:\Temp which is what I would expect.

Upvotes: 2

Views: 1700

Answers (1)

Erti-Chris Eelmaa
Erti-Chris Eelmaa

Reputation: 26268

You need to pass bootstrapper variable into MSI.

The variables you can pass: http://wixtoolset.org/documentation/manual/v3/bundle/bundle_built_in_variables.html

This seems what you want: WixBundleOriginalSource - gets the source path from where the bundle originally ran.

How can you pass it from the bootstrapper:

<MsiPackage SourceFile='ProductSetup.msi' DisplayInternalUI='yes'>
   <MsiProperty Name='CONFIGFILELOCATION' Value='[WixBundleOriginalSource]' />
</MsiPackage>

This will make CONFIGFILELOCATION property available in your ProductSetup.msi file, which you then can access.

Upvotes: 3

Related Questions