validate commandline

Got a problem you cannot solve? Try here.
Ton_B
Posts: 115
Joined: Wed Nov 16, 2005 8:34 am
Location: Netherlands
Contact:

validate commandline

Postby Ton_B » Wed Mar 15, 2006 5:01 am

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(\\)?

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Wed Mar 15, 2006 12:34 pm

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!
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 185 guests