Page 1 of 1

Double Backslash problem

Posted: Thu Mar 12, 2009 1:20 am
by danj6
From reading through a few posts, im lead to believe that if a double backslash appears in a variable InstallAware is clever enough to remove one of the backslashes.
I am setting a variable to the following "$TARGETDIR$\\$FOLDER$"
Yet the variable shows "C:\\PATH\\\\FOLDER"
This is a problem as i'm saving this path to a folder.

What am i doing wrong here?

Posted: Thu Mar 12, 2009 3:04 am
by bokkie
If you debug $TARGETDIR$ you'll see it has a trailing backslash. The following statements will show you what you need to do:

Set Variable FOLDER to Fred
MessageBox: FOLDER, $TARGETDIR$$FOLDER$


Italics, my emphasis.

Posted: Thu Mar 12, 2009 7:41 am
by ulrichard
The command "Extract Path" in the scripting section has an option to "replace \\\\ with \\"

That should fix your problem.

(Too bad we can't use boost::filesystem in msi script ;-)

Rgds
Richard