Hi Paul,
What you need can be done by using two "
Property set with formatted"
custom actions. The path of "Application Folder" from the "Files and Folders" page is stored in the APPDIR property. The value of this property can be easily changed at the beginning of the installation through custom actions.
The two custom actions can be scheduled under
"InstallUISequence" -> "Begin" and they should look like this:
Custom Action 1:
Code: Select all
Property Name: APPDIR
Formatted Text: [ProgramFilesFolder][Manufacturer]\[ProductName]
Expression: VersionNT=501 (this is in the "Execution Condition" section)
Custom Action 2:
Code: Select all
Property Name: APPDIR
Formatted Text: [WindowsVolume]ProgramData\[Manufacturer]\[ProductName]
Expression: VersionNT=600 (this is in the "Execution Condition" section)
The
VersionNT property will determine which of the two custom actions will run. To make sure that the custom actions will be executed even if no UI is used for the installation, you can do this:
- use the "
Show Standard Action" button on the toolbar of the "Custom Actions" page to show the
"InstallExecuteSequence" -> "Begin" standard action
- select the first custom action
- while the SHIFT key is pressed, drag the custom action from
"InstallUISequence" -> "Begin" to
"InstallExecuteSequence" -> "Begin" (this will share the custom action between the two sequences)
- in the
Custom Action Properties page select the "Execute only once if present in both sequence tables" option
Regards,
Cosmin
FOLLOW US
Get the latest news in Application Packaging