Page 1 of 1

Double backslashes removed

Posted: Tue May 27, 2014 4:16 am
by rasmusw
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.

Re: Double backslashes removed

Posted: Tue May 27, 2014 11:44 am
by FrancescoT
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.

Re: Double backslashes removed

Posted: Tue May 27, 2014 12:10 pm
by rasmusw
Hello Francesco,
thank you for your suggestion, I will try it.

Best regards,
Rasmus

Re: Double backslashes removed

Posted: Wed May 28, 2014 10:57 am
by FrancescoT
It should work ... I used the same with a project.

Regards

Re: Double backslashes removed

Posted: Fri Jun 13, 2025 4:59 am
by mihai
Has this been improved in the latest releases, e.g. X17, to turn off the behavior? It's a pain to anticipate this all over an installer and apply workarounds.

Also, the behavior is very annoying when the user tries to actually type double-backslashes.

Re: Double backslashes removed

Posted: Fri Jun 13, 2025 7:49 am
by JohnGaver
This topic applies to InstallAware Multi Platform as well.

Each programming language has its own escape sequence for particular characters, this is simply how it works for InstallAware.

Re: Double backslashes removed

Posted: Fri Jun 13, 2025 9:28 am
by mihai
I'm not necessarily talking about the programming language, but the auto-replacement of the double-backslash in the edit box, as the user types in.

Can that actually be explained by the data flow as the user types, say back and forth from the UI into the variables, and thus the replacement happens?

In any case, you can imagine how annoying this can be for the end user, typing one thing and seeing another. At one point, the cursor even jumps back to the beginning of the string, and typing more backslashes doesn't do anything.

Re: Double backslashes removed

Posted: Sat Jun 14, 2025 8:50 am
by JohnGaver
Oh, most interesting!

Please provide a minimum reproducing project for further research and escalation.

Re: Double backslashes removed

Posted: Mon Jun 16, 2025 4:29 am
by mihai
JohnGaver wrote:Please provide a minimum reproducing project for further research and escalation.

Simply create a new project in X17 and "bind" a user variable to an edit box using the "[Written variable value]" option. The other options there seem fine, like the “Installation Folder“, but are not appropriate for the task at hand.

I'm guessing that the behavior is intentional, but there's a need for a generic option that will allow any input, w/out parsing for escapes.