My installer must copy and rename a file if a condition is met.
The file to copy is included in the installer project as a temporary file with the name "template.par". It should be copied and renamed to a directory and a file name that depend on user input. The destination directory and name are generated by a PowerShell script which processes user input and other criteria. The script creates the properties PARFILE_PATH, PARFILE_DIR, and PARFILE_NAME which contain the full path, the directory, and the name & extension of the copy/rename target. The same script also creates the PARFILE_ACTION property. The file copy/rename action should only be executed if this property has the value "CREATE". (Adding the condition to the action is the easy part.)
I tried it to copy the file with a "Copy/Move File" custom action but it failed with an unclear error situation. I assume the destination of this operation must be a directory name, not a directory and file name.
I also tried to add a "File Copy/Move" action to the "Files and Folders" page but I got lost when I tried to specify the destination folder. Further, I am unsure whether or not I can use properties in this place.
What is the best way to achieve what I want to do, other than writing another PowerShell script?
Hans
FOLLOW US
Get the latest news in Application Packaging