Page 1 of 1

validate commandline

Posted: Wed Mar 15, 2006 5:01 am
by Ton_B
I've created a unattended setup (Setup.msi).
The default $TARGETDIR$ is "hard coded" inside the IA script.
But you can change this using the CMDLINE.

example:

Code: Select all

 msiexec /i Setup.msi CMDLINE="PATH=C:\\NewDir\\Subdir"


My script will detect if the Targetdir has to be changed to the value given by the commandline.

one problem though:
I need to check if the last character of the string is "\" , if not, add "\" to the variable.
I've tried to use the "Extract File Folder" function, but if the last character of the string is not "\" It will not be recognised as a subdirectory.

For example:
PATH = "C:\\Dir_1\\Dir_2 will result in "C:\\Dir_1\"

How can I check if the last character is a forwardslash(/) of backslash(\\)?

Posted: Wed Mar 15, 2006 12:34 pm
by MichaelNesmith
Hi Ton!

You can just add an additional "\" to the value you read from the command line. InstallAware always eliminates double "\\\" into a single "\" when resolving variables!