Remove \\\\ from path variable

Got a problem you cannot solve? Try here.
zchris
Posts: 92
Joined: Wed Feb 23, 2005 3:16 am
Location: Austria

Remove \\\\ from path variable

Postby zchris » Wed Mar 23, 2005 8:44 am

I found that the TARGETDIR variable will sometimes contain a double \\ (like c:\\Program Files\\\\MyApp)

I don't want to use

Code: Select all

Set Variable TARGETDIR = $PROGRAMFILES$$TITLE$
because I'm not sure that $PROGRAMFILES$ will always end with \\.

As a workaround I tried

Code: Select all

Set Variable TARGETDIR = $PROGRAMFILES$\\$TITLE$\\X
Extract File Folder: TARGETDIR

however this left me with a \\ at the end (c:\\Program Files\\MyApp\\).

So finally

Code: Select all

Set Variable PROGRAMFILES = $PROGRAMFILES$\\X
Extract File Folder: PROGRAMFILES
Set Variable TARGETDIR = $PROGRAMFILES$$TITLE$

seems to do the trick. Did I overlook something?

sinan
Site Admin
Posts: 1020
Joined: Sat Nov 13, 2004 8:12 am
Contact:

Postby sinan » Wed Mar 23, 2005 9:26 am

Very acute observations :D Your methods are 100% correct.

Please note that the double slashes are automatically eliminated by all InstallAware scripting functions (including default InstallAware plug-ins).

So an alternate approach would be, if I am guessing correctly, to handle double slashes in your plugins, replacing each instance of \\\\ with \\, and this would make your setup script look cleaner.

zchris
Posts: 92
Joined: Wed Feb 23, 2005 3:16 am
Location: Austria

Postby zchris » Wed Mar 23, 2005 1:00 pm

Good idea! I'll add that to EditFile.

However it would still be nice to be able to remove the \\\\ from within IA script (I'm using $TARGETDIR$ in a messagebox that informs the user that his old database was renamed).

Could you add either a new command or an option to the Set Variable command?

Thanks.

sinan
Site Admin
Posts: 1020
Joined: Sat Nov 13, 2004 8:12 am
Contact:

Postby sinan » Thu Mar 24, 2005 4:19 am

Good suggestion - a new parameter for Extract File Path maybe?


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 14 guests