0

I have an WiX installer configured like this:

<Property Id="MY_PROPERTY">

...

<Registry Name="MyValue" Type="multiString" Value="[MY_PROPERTY]" />

Now I want to pass this property value at the command line as a list:

MsiExec.exe /i MyInstaller.msi /qb MY_PROPERTY="One[~]Two[~]Three"

However, the installer does not split the values into a list and the literal value is written instead.

If I hard code the element it works properly:

<Registry Name="MyValue" Type="multiString" Value="One[~]Two[~]Three" />

Does anyone know how to specify a list of values at the command-line for a multiString registry value? Thanks in advance

1 Answers1

2

Better late than never! This can be achieved using a Custom Action.

Follow this MS document carefully: https://learn.microsoft.com/en-us/windows/win32/msi/registry-table

In your custom action, insert the registry value into MSI table from your property as follows,

Set db = Session.Database
set oView = db.OpenView("INSERT INTO `Registry` (`Registry`,`Root`,`Key`,`Name`,`Value`,`Component_`) VALUES ('reg_MY_PROPERTY', -1,'Software\Company\Product','MyValue','" & _
                            Session.Property("MY_PROPERTY") & "','CM_CP_BlahBlah') TEMPORARY")
oView.Execute
oView.Close

CM_CP_BlahBlah is your WIX component Registry values are attached to.

Please note "custom action must come before the RemoveRegistryValues and WriteRegistryValues actions in the action sequence"

<InstallExecuteSequence>
    <Custom Action="SetMyPropertyCustomAction" Before="RemoveRegistryValues">NOT REMOVE</Custom>
</InstallExecuteSequence>