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: AddFolderIcon fodler shortcut
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 03, 2008
09:26 AM
AddFolderIcon fodler shortcut
Hi,
I am wanting to add a shortcut to a folder that is installed as part of the program, however, from using the help documentation the code they give does not work (no real surprise!!)
This is what they suggested, with a few changes as theirs didn't compile!!
Anyone have a way that works to do this?
Thanks,
Rich
I am wanting to add a shortcut to a folder that is installed as part of the program, however, from using the help documentation the code they give does not work (no real surprise!!)
This is what they suggested, with a few changes as theirs didn't compile!!
ProgDefGroupType(COMMON);
szFolder = Directory + "\\Program Name\\";
LongPathToQuote(szFolder, TRUE);
AddFolderIcon( ProgramMenuFolder + "\\Company Name\\", "Shortcut Name", szFolder, "", "", 0, "", NULL );
Anyone have a way that works to do this?
Thanks,
Rich
(5) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 07, 2008
10:50 AM
No one has done this before???
Rich
Rich
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 07, 2008
12:26 PM
What does the shortcut point to after it was created? Maybe the path is invalid.
E.g. make sure that the Directory variable doesn't end on a backslash already and you end up with a double backslash in your string. If you use the ^ instead of + "\\" it'll take care of that automatically.
I'd suggest changing the code to something like this and try again.
ProgDefGroupType(COMMON);
szFolder = Directory ^ IFX_PRODUCT_NAME;
LongPathToQuote(szFolder, TRUE);
AddFolderIcon( FOLDER_PROGRAMS ^ IFX_COMPANY_NAME, "Shortcut Name", szFolder, "", "", 0, "", NULL );
-Sandra
E.g. make sure that the Directory variable doesn't end on a backslash already and you end up with a double backslash in your string. If you use the ^ instead of + "\\" it'll take care of that automatically.
I'd suggest changing the code to something like this and try again.
ProgDefGroupType(COMMON);
szFolder = Directory ^ IFX_PRODUCT_NAME;
LongPathToQuote(szFolder, TRUE);
AddFolderIcon( FOLDER_PROGRAMS ^ IFX_COMPANY_NAME, "Shortcut Name", szFolder, "", "", 0, "", NULL );
-Sandra
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 08, 2008
05:09 AM
SMadden wrote:
What does the shortcut point to after it was created? Maybe the path is invalid.
E.g. make sure that the Directory variable doesn't end on a backslash already and you end up with a double backslash in your string. If you use the ^ instead of + "\\" it'll take care of that automatically.
I'd suggest changing the code to something like this and try again.
ProgDefGroupType(COMMON);
szFolder = Directory ^ IFX_PRODUCT_NAME;
LongPathToQuote(szFolder, TRUE);
AddFolderIcon( FOLDER_PROGRAMS ^ IFX_COMPANY_NAME, "Shortcut Name", szFolder, "", "", 0, "", NULL );
-Sandra
Hi,
Thanks for the reply,
The code that you have makes a link to the main exe file and tries to run that instead of opening a folder.
With the code I gave it creates the shortcut and the link is correct but it does not pick it up for some reason. Looking at a shortcut to the same folder which I manually create is exactly the same in the properties.
Thanks,
Rich
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 08, 2008
05:08 PM
you might have found a bug. I just created two test projects, one pure InstallScript with the code above and one Basic MSI using an InstallScript custom action using the code above.
the shortcut to the folder was successfully created with the pure InstallScript one, but failed when using the MSI with InstallScript custom action.
Sandra
the shortcut to the folder was successfully created with the pure InstallScript one, but failed when using the MSI with InstallScript custom action.
Sandra
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 08, 2008
07:31 PM
If the sample doesn't even compile, would you please file a doc bug with them? So that they will become aware of the problem, and can address this in the future release.
You can try creating a shortcut as mentioned here.
You can try creating a shortcut as mentioned here.