This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Help with AddFolderIcon
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
‎May 30, 2008
09:21 AM
Help with AddFolderIcon
Hi,
On the function OnFirstUIAfter, i created a custom dialog to allow the end-user to add or not a desktop shortcut.
The dialog contains a checkbox. Everything is working fine, but for an unknown reason, LongPathToQuote doesn't seem to add quotation marks. This make my shortcut not working.
anyone knows what i'm doing wrong. The shortcut is only executing the .exe the install create.
The path itself is ok, only the quotation mark missing.
I've put message box before and after to check if it was changing anything.
On the function OnFirstUIAfter, i created a custom dialog to allow the end-user to add or not a desktop shortcut.
The dialog contains a checkbox. Everything is working fine, but for an unknown reason, LongPathToQuote doesn't seem to add quotation marks. This make my shortcut not working.
anyone knows what i'm doing wrong. The shortcut is only executing the .exe the install create.
The path itself is ok, only the quotation mark missing.
I've put message box before and after to check if it was changing anything.
#define CD_CUSTOMENDING "CustomEnding"
#define CD_CUSTOMENDINGID 1337
#define CD_CBOX_SHORTCUT 33
#define PROGRAM TARGETDIR ^ "Jnes.exe";
szDlg = CD_CUSTOMENDING;
szProgramFolder = FOLDER_DESKTOP;
szItemName = "xxxx";
szProgram = PROGRAM;
MessageBox(szProgram,SEVERE);
LongPathToQuote(szProgram,FALSE);
szCommandLine = szProgram;
szWorkingDir = "";
szIconPath = SRCDIR ^ "xxx.ico";
nIcon = 0;
szShortCutKey = "";
MessageBox(szProgram,SEVERE);
if (EzDefineDialog( szDlg, "", "", CD_CUSTOMENDINGID ) = DLG_ERR) then
MessageBox("Not able to load CustomEnding Dialog", SEVERE);
abort;
endif;
// Disable( BACKBUTTON );
while(!bDone)
nCmdValue = WaitOnDialog(szDlg);
switch(nCmdValue)
case DLG_INIT:
hwndDlg = CmdGetHwndDlg(szDlg);
SetWindowText(hwndDlg,"xxxx - InstallShield Wizard");
case IDCANCEL:
Do(EXIT);
case SD_PBUT_CONTINUE:
bDone = TRUE;
if (CtrlGetState( szDlg, CD_CBOX_SHORTCUT) = BUTTON_CHECKED) then
//Insert shortcut here
if (AddFolderIcon (szProgramFolder, szItemName, szCommandLine, szWorkingDir,
szIconPath, nIcon, szShortCutKey, REPLACE) < 0) then
MessageBox ("AddFolderIcon failed.", SEVERE);
endif;
(3) Replies
‎May 30, 2008
09:26 AM
The second argument to LongPathToQuote should be TRUE if you want quotes added to the path. FALSE removes them.
‎May 30, 2008
09:27 AM
What if you set the second argument of LongPathToQuote to TRUE? The documentation has more information.
(As an aside, SdFinish has an option to display a check box, and there are other check box dialog boxes, so perhaps you could get by without a custom dialog...)
(As an aside, SdFinish has an option to display a check box, and there are other check box dialog boxes, so perhaps you could get by without a custom dialog...)