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 for all users with MSI
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
‎Jun 18, 2013
04:32 PM
AddFolderIcon for all users with MSI
Hello,
I've been rewriting an old isntallscript installer into a new MSI and have run into an issue with Icons. We build the start menu shortcuts to go to
the standard location using the Shortcuts View (C:\ProgramData\Microsoft\Windows\Start Menu\Programs\My Company\My Folder\)
And then we use AddFolderIcon to create a folder icon that links to the above path but so that we can assign an icon and the user can click on the icon and go into a folder that lists our applications for that area.
The problem I am running into on Windows 8 specefically and probably 7 as well is that when you run it as a MSI you get an access denied error when it tries to write the folder to the common desktop (C:\users\Public\Desktop) but if I launch the setup.exe with elevate privledges the desktop folder creates properly.
Has anyone come across this or have any suggestions?
I could create the Desktop Icons using the Shortcuts View as well but I have not figured out a way to add a icon to the folders that are built which is required.
Thanks
I've been rewriting an old isntallscript installer into a new MSI and have run into an issue with Icons. We build the start menu shortcuts to go to
the standard location using the Shortcuts View (C:\ProgramData\Microsoft\Windows\Start Menu\Programs\My Company\My Folder\)
And then we use AddFolderIcon to create a folder icon that links to the above path but so that we can assign an icon and the user can click on the icon and go into a folder that lists our applications for that area.
The problem I am running into on Windows 8 specefically and probably 7 as well is that when you run it as a MSI you get an access denied error when it tries to write the folder to the common desktop (C:\users\Public\Desktop) but if I launch the setup.exe with elevate privledges the desktop folder creates properly.
Has anyone come across this or have any suggestions?
I could create the Desktop Icons using the Shortcuts View as well but I have not figured out a way to add a icon to the folders that are built which is required.
Thanks
RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE);
RegDBGetKeyValueEx ( "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", "Common Desktop", nvType, svCommonDesktopFolder, nvSize );
szItemName = DESKTOP_SMS;
szCommandLine = ProgramMenuFolder ^ "My Company" ^ "My Folder";
szIconPath = ProgramFilesFolder ^ "My Files\\SMS1.ico";
LongPathToQuote (szCommandLine, TRUE);
// Add the shortcut to the desktop.
nResult = AddFolderIcon (svCommonDesktopFolder, szItemName, szCommandLine, szWorkingDir, szIconPath, nIcon, szShortCutKey, nFlag);
svError = FormatMessage(nResult);
MessageBox(svError,0);
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 18, 2013
06:35 PM
To create a shortcut to a folder, you may find this old thread useful.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 19, 2013
09:34 AM
I haven't tried this yet but I assume this would have the same problem with permissions trying to write to the all users desktop area.