I need to create a javascript file with the value of $TARGETDIR$ included. Unfortunately in Javascript I need to double the backslashes present in the path of $TARGETDIR$.
e.g. $TARGETDIR$ = C:\Program Files\Test has to become in the Javascript C:\\Program Files\\Test
Is there a way of doing this easily?
Many thanks
escaping backslash for javascript
Re: escaping backslash for javascript
There definitely is - assign the value of $TARGETDIR$ to a temporary variable and use the Replace command on that variable to replace \ with \\ like so:
Set Variable TMP to $TARGETDIR$
Replace \ with \\ in variable TMP
Or paste this in InstallAware:
~InstallAware Clipboard Data~
~Replace String~
~{B63AD60B-788E-43D3-9557-F4364EAFB07C}~
~TMP~
~\~
~\\~
~TRUE~
~TRUE~
~Set Variable~
~{37BEDFD8-27D0-4177-9741-7F12AA0C3E0B}~
~TMP$MYAH$MYAH$FALSE~
~$TARGETDIR$~
Enjoy!
Set Variable TMP to $TARGETDIR$
Replace \ with \\ in variable TMP
Or paste this in InstallAware:
~InstallAware Clipboard Data~
~Replace String~
~{B63AD60B-788E-43D3-9557-F4364EAFB07C}~
~TMP~
~\~
~\\~
~TRUE~
~TRUE~
~Set Variable~
~{37BEDFD8-27D0-4177-9741-7F12AA0C3E0B}~
~TMP$MYAH$MYAH$FALSE~
~$TARGETDIR$~
Enjoy!
Aviv Giladi
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Re: escaping backslash for javascript
Thanks
that worked great.
that worked great.
Re: escaping backslash for javascript
Aviv Giladi
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

