I'm trying to write a property, correctly passed by burn, to the registry in my MSI
Here there is the code from the bootstrapper
<Variable Name="REFERAL" Type="string" bal:Overridable="yes" Persisted="yes" Value="REFERAL__123456" />
.
.
.
<MsiProperty Name="REFERAL" Value="[REFERAL]" />
Here there is the code from MSI
<Fragment>
<DirectoryRef Id="INSTALLFOLDER">
<Component Id="Main" Guid="138feeae-f687-4973-8d94-2bfaa2ddec38">
<RegistryValue Root='HKCU' Key='Software\[Manufacturer]\[ProductName]' Name='REFERER' Type='string' Value='[REFERER]' />
.
.
.
</Component>
</DirectoryRef>
</Fragment>
Logs report that the property REFERER is correctly changed
bootstrap burn
[25E4:2464][2013-10-23T10:18:04]i323: Registering package dependency provider: {A7E4C8A8-DC93-431F-A48C-8DAB6D766C5A}, version: 1.0.0.16052, package: app.msi
[25E4:2464][2013-10-23T10:18:04]i301: Applying execute package: app.msi, action: Install, path: C:\Users\Daniele\AppData\Local\Package Cache\{A7E4C8A8-DC93-431F-A48C-8DAB6D766C5A}v1.0.0.16052\app.msi, arguments: ' ARPSYSTEMCOMPONENT="1" MSIFASTINSTALL="7" REFERAL="REFERAL__123456"'
[25E4:2464][2013-10-23T10:18:07]i319: Applied execute package: app.msi, result: 0x0, restart: None
msi
MSI (s) (9C:64) [10:18:05:690]: Command Line: ARPSYSTEMCOMPONENT=1 MSIFASTINSTALL=7 REFERAL=REFERAL__123456 REBOOT=ReallySuppress CURRENTDIRECTORY=C:\Users\Daniele\Sviluppo\c#\app\installer-bootstrap\bin\x86\ReleaseForPublish CLIENTUILEVEL=3 MSICLIENTUSESEXTERNALUI=1 CLIENTPROCESSID=9700
.
.
.
MSI (s) (9C:64) [10:18:05:692]: PROPERTY CHANGE: Modifying REFERAL property. Its current value is 'none'. Its new value: 'REFERAL__123456'.
.
. here it doesn't write the value
.
MSI (s) (9C:64) [10:18:06:800]: Executing op: RegAddValue(Name=REFERER,,)
You want the Value to be "REFERAL__123456". Your MsiProperty
element assigns this value to the MSI property named REFERAL
, yet in your RegistryValue
element you use the value REFERER
. Change it to REFERAL
and you're good to go. You should also specify the Action attribute, to make clear what you are doing with this element:
<Fragment>
<DirectoryRef Id="INSTALLFOLDER">
<Component Id="Main" Guid="138feeae-f687-4973-8d94-2bfaa2ddec38">
<RegistryValue Root='HKCU' Key='Software\[Manufacturer]\[ProductName]' Action='write' Name='REFERER' Type='string' Value='[REFERAL]' />
.
.
.
</Component>
</DirectoryRef>