Hello,
I'm trying to create a shortcut that contains the version number of my project. I started with "MyApp v[|ProductVersion]" as the name of the shortcut.
Please note that the name of a shortcut can be at least referenced by a
PseudoFormatted data type and it will be resolved at build time.
As a workaround you can add your own deferred custom action that will set the shortcut name with the value of
ProductVersionShort property. You can add this custom action in the “Install Execution Stage” >> “Add Resources” action group.
You can also take a look on
Custom Action Properties article which may be useful to you.
But now I'd like to change it to use only the first two parts of the version number (eg., "1.2" instead of "1.2.0"). To do this I created a new property called ProductVersionShort and created a custom action that calls VBS code, like this:
Function GetVersionNumberShort()
fullVersion = Session.Property("ProductVersion")
'get trimmed version
Session.Property("ProductVersionShort") = trimmedVersion
End Function
The code runs without error, but the value of ProductVersionShort isn't changed after my function is called. Any ideas?
It seems ok your script code. Please make sure that you set the
ProductVersionShort property with the desired value, only the first two fields, so make sure the
trimmedVersion property only contains the first two fields of the
ProductVersion.
You can also take a look on the following code:
Code: Select all
MsgBox Session.Property("ProductVersion")
Session.Property("test") = Left(Session.Property("ProductVersion"), InStrRev(Session.Property("ProductVersion"), ".")-1)
MsgBox Session.Property("test")
Please note that the script code was used in an
Execute inline script predefined custom action with sequence. You can add this custom action in “Install Execution Stage” >> “Searches” action group. You can also duplicate it in the “Wizard Dialogs Stage” by a drag-and-drop operation while the “SHIFT” key is pressed. You can also edit its
Advanced execution Scenarios properties.
If you have any more questions, please let us know.
Best regards,
Dan
FOLLOW US
Get the latest news in Application Packaging