Troubles with file paths

Got a problem you cannot solve? Try here.
MikeFieger
Posts: 52
Joined: Thu Jan 26, 2006 9:09 am

Troubles with file paths

Postby MikeFieger » Wed Apr 05, 2006 10:36 am

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 "".

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Wed Apr 05, 2006 1:42 pm

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.
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/

MikeFieger
Posts: 52
Joined: Thu Jan 26, 2006 9:09 am

Postby MikeFieger » Thu Apr 06, 2006 4:09 am

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...

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Thu Apr 06, 2006 1:27 pm

Thanks for the suggestion!
Michael Nesmith

InstallAware

Home of The Next Generation MSI Installer

Get your free copy today - http://www.installaware.com/


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 171 guests