I am creating a desktop shortcut with a custom action, this shortcut's target is the SHORTCUTDIR i.e. clicking on it opens the folder that has all other shotcuts in "C:\Documents and Settings\All Users\Start Menu\Programs\?????.....", these shortcuts are installed by AI. I am creating the desktop shortcut with a custom action because I need to change its icon depending on a radiobutton value selected by user in the welcome screen. Desktop shortcut has to be created on all users desktop, I get the path for this as follows
Code: Select all
Set Shell = CreateObject("WScript.Shell")
DesktopPath = Shell.SpecialFolders("AllUsersDesktop")
I have added custom action under InstallExecuteSequence > InstallFinalize as I need acces to Installer property SHORTCUTDIR in vbscript to set it as the target for shortcut, It all works fine on Windows XP but on Windows 7 VBScript throws an error but if I run the installer exe by right clicking and selecting "Run as Administrator" it works fine, now my guess is that because I am trying to install the shortcut in AllUserDesktop namespace, Windows 7 needs the script to have admin rights.
How can I Install this shortcut on AllUsersDesktop without having to run the installer with "Run as administrator" option.
FOLLOW US
Get the latest news in Application Packaging