Hello René,
or I would need to find a way to transfer the data already present in the MainMSI to the SubMSI via a CustomAction.
The properties are properly passed to the SubMsi, the problem here comes from the fact that the properties are empty during the upgrade because we no longer set them via command line.
The properties you are setting have no initial value. The first time we install, we pass the values and they are propagated correctly.
On upgrade, if you do not provide any values, the setup will get the values from the
Properties page, which is an empty value - this is normal behavior.
We can avoid this by setting the properties as persistent - this will ensure the properties are repopulated with the previous values in V2.
Now, in V2, if you provide the property values and the properties are persistent, the property value will be overwritten by the previous value becuase that is how persistent properties work.
Unfortunately, although the scenario is valid, this is a corner case here.
To overcome this, as I said, we would need a custom action that handles the two scenarios above.
Here would be the logic:
- first, we need to save the properties in the registry (via
Registry page) at install time

- Screenshot_108.png (21.86 KiB) Viewed 6284 times
Note: or we can have the written into a TXT file in %temp% so it does not require admin privileges.
- in v2, we can have a custom action that searches those values, retrieves them and then compares with the value of the property
example for a PowerShell custom action:
Code: Select all
# we do the search and retrieve the value in the $service_password variable
# we then retrieve the value of the property passed or not passed by the user
$serivce_password_prop = AI_GetMsiValue SERVICE_PASSWORD
# we now handle the two cases
# case 1 if the prop is empty, we set the value of SERVICE_PASSWORD to the previous value retrieved
AI_SetMsiProperty SERVICE_PASSWORD $service_password
# 2nd case would be if the values are different, in which we set SERVICE_PASSWORD to the desired value
AI_SetMsiProperty SERVICE_PASSWORD $service_password_prop
Hope this helps!
Best regards,
Catalin
FOLLOW US