Hello
Can i define a folder name , something like "MyFolder version[ver]"
and define the ver as a property
Thanks in advance
Yaniv
Yes, you can, but you need to use a Custom Action as follows:Can i define a folder name , something like "MyFolder version[ver]"
and define the ver as a property
Code: Select all
msiexec /i package.msi MYVER="1.9"Code: Select all
AlterTargetPath("folder_DIR"), " version", "MYVER"
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Function that will alter the TargetPath for a specified folder
'
' @param strFolderId The ID of the folder as it appears in the
' Directory table (from the MSI database)
' @param strAppend String that will be appended to the folder name
' @param strVerProp The name of the Property whose value will be
' appended to the folder name after strAppend
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Function AlterTargetPath(strFolderId, strAppend ,strVerProp)
Dim strTarget, strTemp
' Get the TargetPath for the given folder
strTarget = Session.TargetPath(strFolderId)
' Remove the trailing "\" if necessary
If Right(strTarget,1) = "\" Then
strTemp = Left(strTarget,Len(strTarget)-1)
End If
' Set the TargetPath by appending strAppend
' and the value of the Property strVerProp
Session.TargetPath(strFolderId) = _
strTemp & strAppend & Session.Property(strVerProp)
' Useful for debugging, comment it when releasing the package
MsgBox Session.TargetPath(strFolderId)
End Function
FOLLOW US
Get the latest news in Application Packaging