tunafish24
tunafish24

Reputation: 2469

Wix msi updated property value not working during installation

Working with Wix in Visual Studio. I have a public property defined in Product node of wxs file.

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

The property value is passed as commandline argument to a deferred custom action executable. I'm able to receive it in the exe as well. The problem is even if I update the Property using vbs (verified through vbs select as well), when I launch the msi, it still passes the default/original value (123456789) to the custom action executable.

Also tried msiexec.exe /i myinstaller.msi MYPROP=SomeOtherValue

I'm still seeing the original value. What's wrong?

Upvotes: 1

Views: 870

Answers (2)

tunafish24
tunafish24

Reputation: 2469

When an msi is run, windows caches the msi file in %windows%\Installer folder. When that msi is run again, windows checks if an msi with identical PackageCode exists in the cache, if so then it uses the cached msi file instead.

PackageCode: identifies each unqiue msi installer package - even if it only has different properties.

In short, when a property is updated using a vbscript etc, then the PackageCode has to be updated as well. This will ensure that after updating msi, the same msi can be used on the same system and windows will not use the cached msi.

Upvotes: 0

Stein &#197;smul
Stein &#197;smul

Reputation: 42136

Maybe try this simple thing first:

<Property Id="MYPROP" Secure="yes" Value="123456789"/>

Essentially you need to add a property to the SecureCustomProperties list to have them pass properly to deferred mode in secure desktop environments.

See more information on SecureCustomProperties here. The technical details here are a little bit in flux because of Windows changes, so please just try this first - there could be several other reasons.

How do you use this property? What does it do?

Upvotes: 1

Related Questions