Crjuncher
Crjuncher

Reputation: 3

Identify command line an MSI was installed with

Is it possible to identify which command line an MSI was installed with?

For example i'm passing some custom property in MSI installatin command line. msiexec /i msi1.msi CUSTOMPROPERTY1="Help me!"

After a while i want to update msi1.msi with msi2.msi and want to pass same custom property to the msi2.msi installation command line.

Does the command lines stored anywhere?

The approach i see is to create a reg key in msi1.msi will store the CUSTOMPROPERTY1 value and create an AppSearch entry in msi2.msi to search for this reg entry. In my case i'm not able to use this approach. That is why seaching for other.

Upvotes: 0

Views: 114

Answers (2)

mteodor
mteodor

Reputation: 175

Advanced Installer can also help you with the Set persistent property option. On update you don't need to call or search for those properties, their custom values are fetched automatically from the registry.

Cheers

Upvotes: 1

Christopher Painter
Christopher Painter

Reputation: 55600

Correct. Windows Installer doesn't persist properties for subsequent transactions so you have to do it yourself. Here's a blog talking about it:

The WiX toolset's "Remember Property" pattern.

Personally the above pattern doesn't go far enough. What I do is I read the registry value into a second property and then use a series of conditionalized custom actions to only populate the main value if appropriate. The goal is to enforce a property precedence in the following most to least order:

  1. Value entered by the user via custom controls on a dialog in the UI sequence.
  2. Value passed to the installer via the command line.
  3. Value persisted from a previous installation.
  4. Default value baked into the MSI.

Upvotes: 0

Related Questions