PDA

View Full Version : AddFolderIcon



SamGardner
11-29-2005, 11:56 AM
Hi,

I am trying to create a short cut to my application using AddFolderIcon, but the shortcut is unable to find my .exe because it is not in TARGETDIR but in a sub-directory (bin). However, I do specify the full path. Here is my code:

svPath = TARGETDIR ^ "\\bin\\DrawProg.exe";
LongPathToQuote ( svPath , TRUE );
AddFolderIcon ( FOLDER_DESKTOP, "DrawProg",
svPath , "" , "" , 0 , "" , REPLACE );

I am using version 5.10.130. Any ideas?

Regards,

Sam.

catriona
11-29-2005, 04:49 PM
I think you may have too many "\\"

^ adds a "\\" for you so you try one of the following

svPath = TARGETDIR ^ "bin\\DrawProg.exe";
or
svPath = TARGETDIR + "\\bin\\DrawProg.exe";

TsungH
12-01-2005, 06:54 PM
The following code is fine. ^ operator will automatically checks to see if you have added the proper number of backslashes when appending a file name or a subdirectory to a path.

svPath = TARGETDIR ^ "\\bin\\DrawProg.exe";The code snippet looks correct. To help troubleshoot, you can print out the value of svPath before and after calling LongPathToQuote function. Also, try it on a clean machine that doesn't already have an shortcut of the same name on desktop.

BTW, from the version you mentioned, you are probably using InstallShield Professional 5.1. If that's the case, you will want to post your questions here (http://community.installshield.com/forumdisplay.php?f=58) in the future.