Hello,
First of all, please keep in mind that properties referenced by
PseudoFormatted (the ones containing vertical pipes) data types are resolved at
build time.
In order to achieve what you want, you can create a property based folder instead of a regular folder.
Here is a step-by-step which will help you achieve those said above:
1) First, we need to create the property which will store the path. To do this, you can go to "Install Parameters" page and click on the
"New Property" button from the toolbar. Set its name to, for example,
PV (product version) and its value to
0.
2) Now we will need to set our earlier created property value to have the value of the
[APPDIR] property. In order to do so, you can use a
"Set Property" custom action with the following arguments:
-Property: PV (our earlier created property)
-Value: [APPDIR]
-Execution Time: Immediately
2.1) As a side note, please keep in mind that in order for this to be achievable, we have to place the above specified custom action after the
"SET_APPDIR" standard action. The
"SET_APPDIR" standard action takes place before the
"Cost Initialize" action, thus we will need to place our custom action after the
"Cost Initialize" and before the
"FileCost" standard actions. In order to do so, you can go to
"Custom Actions" page --> right click on any action group from
"Install Execution Stage" -->
"Show Standard Action" -->
"Paths Resolution" --> click on
"Cost Initialize". Now repeat the steps presented earlier for the
"FileCost" standard action.
After doing so, drag and drop the earlier created
"Set Property" custom action between the
"Cost Initialize" and
"FileCost" standard actions.
3) Now we have to create the script which will create the major.minor folder under the application folder. Here is an example of a visual basic script which takes only the first two digits (the major and minor version) of the
"ProductVersion" property:
Code: Select all
Dim token
productversion = Session.Property("ProductVersion")
token = split(productversion, ".")
Session.Property("PV") = Session.Property("APPDIR") & "\" & token(0) & "_" & token(1)
4) Now we have to share the earlier created custom actions between
"Install Execution Stage" and
"Wizard Dialogs Stage". In order to achieve this,
Shift + Drag and Drop the custom actions from "Install Execution Stage" to "Wizard Dialogs Stage". Please make sure that the custom actions from the
"Wizard Dialogs Stage" also take place between
"CostInitialize" and
"FileCost" standard actions as presented in point 2.1)
5) The last step is to create the "Property Based" folder. In order to do so, you can go to
"Files and Folders" page --> right click on
"Application Folder" -->
"New Folder" -->
"Property Based" --> select the property you created at point 1) and click
"Ok".
6) Build and run.
Let me know if this helps!
Regards,
Catalin