Page 1 of 1

Troubles with file paths

Posted: Wed Apr 05, 2006 10:36 am
by MikeFieger
Bug in command 'Extract File Folder: TARGETDIR'
Value of TARGETDIR before command: "C:\\Programme\\Our Program\\File.exe"
Value of TARGETDIR after command: "C:\\Programme\\Our Program
Note the missing " at the end...


Bug in command 'Does File Exist $FILETOSEARCH$ (get result into variable FILEEXISTS)'
If FILETOSEARCH is C:\\Programme\\Our Program\\File2.exe then FILEEXISTS=TRUE.
If FILETOSEARCH is "C:\\Programme\\Our Program\\File2.exe" then FILEEXISTS=FALSE.


Note the great combination of the two bugs!
Set Variable FILETOSEARCH to $TARGETDIR$File2.exe
results in FILETOSEARCH being
"C:\\Programme\\Our Program\\File2.exe

Again the missing " at the end of course prevents us from finding the file.
Adding a " at the end still doesn´t work... (very annoying!)
Removing a " at the beginning with 'Parse String...' works but I´m not sure what would happen if there were none at the beginning.....
And anyway this is a very dirty hack....

I hope you can fix those two bugs soon.


PS: I get the TARGETDIR with the "" from the command 'Find All Files in path ...' so please don´t suggest using a string without "".

Posted: Wed Apr 05, 2006 1:42 pm
by MichaelNesmith
You cannot use quotes with these functions. Quotes are returned in the Find All Files function to help delimit returned lists of files:

This command searches for files matching a wildcard specification on the target system, and returns results in a string variable. If multiple file names match, the returned file names are delimited by the | character. If some of the returned files contain embedded spaces, those file names will additionally be wrapped inside double quote " characters.

They are invalid and illegal in file names.

You should obtain the file you want, then get rid of the quotes. If you are obtaining only a single file, use the Replace String command to eliminate the quotes right away.

Posted: Thu Apr 06, 2006 4:09 am
by MikeFieger
Well, I am using the 'Replace String' command now, thanks.

But it would be great if you could add a note in the help about the command 'Does File Exist' always returning FALSE if the given file contains illegal characters (like the " wich came directly from another installaware command).

You must admit that this seems to be somewhat inconsistent: one command returning a path in a format that the oter command doesn´t accept. This error was hard to find and a good software also needs a good documentation...

Posted: Thu Apr 06, 2006 1:27 pm
by MichaelNesmith
Thanks for the suggestion!