Page 1 of 1

Parse String, Read from textfile(READALL) and UNC

Posted: Tue Jul 01, 2008 7:03 am
by Damocles
I safe the target dir in a config file so the line might look like this:

<PathToRemoteConfig>\\\\server\\...\\user\\Dir</PathToRemoteConfig>
or
<PathToRemoteConfig>c:\\...\\Dir</PathToRemoteConfig>

I wanted to use 'read from text file' and 'parse string' to search for <PathToRemoteConfig> and use whats in the middle, but somehow parse string eliminates the first '\\'.

Don't tell me thats the way it is supposed to work.

~InstallAware Clipboard Data~
~Parse String~
~{A12D89DD-F300-4480-86F1-564C1D989E64}~
~$confdir$~
~<PathToRemoteConfig>~
~~
~ConfDIR~
~0~
~FALSE~
~FALSE~

While there might be a workaround by asking if there is one \\ in the first place and adding another, the next one is really bad:

Read from textfile:

~InstallAware Clipboard Data~
~Read from Text File~
~{0316FB86-103A-4B64-83AA-5E68FF9EFB98}~
~#ReadALL\\\\\\server\\...\\ldb_global.xml~
~CONFDIR~
~~
as well as
with
#ReadALL\\\\server\\...\\ldb_global.xml

reads nothing at all while


~InstallAware Clipboard Data~
~Read from Text File~
~{0316FB86-103A-4B64-83AA-5E68FF9EFB98}~
~\\\\server\\...\\ldb_global.xml~
~CONFDIR~
~~

reads the first line

So when reading the file:
#READALL\\\\\\server\\...
#READALL\\\\server\\...
they both read nothing
\\\\server\\...
reads one line

However i'm not interested in the first line....

Posted: Tue Jul 01, 2008 6:40 pm
by Alex_Ronquillo
InstallAware eliminates double back-slashes and reduces
them into a single backslash, so for example when you say:

Set Variable TARGETDIR to $PROGRAMFILES$\\My Folder

The resulting typical value of

C:\\Program Files\\\\My Folder

becomes

C:\\Program Files\\My Folder

($PROGRAMFILES$ already has a \\ at the end)

So 5 slashes in the READALL now become 3, and the code works...

example:

#READALL\\\\\\\\\\Server\\Shared\\TextFile.txt