Double backslashes removed

Got a problem you cannot solve? Try here.
rasmusw
Posts: 44
Joined: Tue May 19, 2009 3:06 am

Double backslashes removed

Postby rasmusw » Tue May 27, 2014 4:16 am

Hello,
I understand that InstallAware replaces double backslashes with single ones \\ =>
Can I avoid this behavior?

I have a problem with the Run Program action which should run $TARGETDIR$\postinstaller.exe with command line parameters such as
/install="$TARGETDIR$\config.dll"

When $TARGETDIR$ contains a UNC path (starts with \\ ), the Run Program action can execute the file, but the $TARGETDIR$ variable in the command line parameters is changed, and thus the path in the command line parameters is invalid.

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Double backslashes removed

Postby FrancescoT » Tue May 27, 2014 11:44 am

Dear Rasmusw,

just try to add an additional backslashes to your parameter argument, when the argument variable contains an UNC path (starts with \\ ).

Example;

Code: Select all

Set Variable MY_EXE_PATH to \\PC-NAME\path\myApp.exe
 
if Variable MY_EXE_PATH Contains \\PC-NAME
Set Variable MY_EXE_PATH to \$MY_EXE_PATH$
end
Run Program cmd.exe /k ECHO ON "$MY_EXE_PATH$" (WAIT)

The same as IA clipboard format;

Code: Select all

~InstallAware Clipboard Data~
~Run Program~
~{D3793EA0-A514-4AE5-B329-180F9E54F7A2}~
~cmd.exe~
~FALSE~
~/k ECHO ON "$MY_EXE_PATH$"~
~TRUE~
~~
~End~
~{95590036-9CA9-428E-808E-2E7F8144081A}~
~Set Variable~
~{3F228688-5115-4CB4-A082-70DF5CA2F588}~
~MY_EXE_PATH$MYAH$MYAH$FALSE~
~\$MY_EXE_PATH$~
~If~
~{15E38E3F-33D8-4828-982C-EC2A6126ABC2}~
~MY_EXE_PATH~
~1~
~\\PC-NAME~
~FALSE~
~Comment~
~{BACC8D4A-57A4-4005-8CA7-52DDDA0F8B79}~
~~
~Set Variable~
~{7EF7EB77-25F6-4F06-B8E6-EB8112684FFC}~
~MY_EXE_PATH$MYAH$MYAH$FALSE~
~\\PC-NAME\path\myApp.exe~

With the above code I used "cmd.exe /k ECHO ON", for the sole purpose to print out the effective argument value passed out by "Run Program".

Hope this helps you.

Regards.
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

rasmusw
Posts: 44
Joined: Tue May 19, 2009 3:06 am

Re: Double backslashes removed

Postby rasmusw » Tue May 27, 2014 12:10 pm

Hello Francesco,
thank you for your suggestion, I will try it.

Best regards,
Rasmus

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Double backslashes removed

Postby FrancescoT » Wed May 28, 2014 10:57 am

It should work ... I used the same with a project.

Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE


Return to “Technical Support”

Who is online

Users browsing this forum: Baidu [Spider] and 150 guests