hobbes487
14th November 2010 18:09 UTC
Setting shortcut to run as Admin
I have search the forum and read all the thread relating to this topic, but cant seem to get it to work. Here is the code I am using:
createShortCut "$SMPROGRAMS\OSA\Manager.lnk" "$INSTDIR\OSAE Manager.exe"
ShellLink::SetRunAsAdministrator "$SMPROGRAMS\OSA\Manager.lnk"
The shortcut is created, but it is not set to run as administrator. I am testing on Windows 7. Do I need to use the UAC plugin?
Anders
14th November 2010 19:06 UTC
Can you do a MessageBox with "$SMPROGRAMS\OSA\Manager.lnk" and make sure the path is correct, if it is not, you have issues with UAC/SetShellVarContext, if it is correct, the problem is with ShellLink::SetRunAsAdministrator
hobbes487
15th November 2010 00:16 UTC
It looks like the path is not correct. what do I need to do to make sure it is pointing to the shortcut?
Anders
15th November 2010 13:49 UTC
Make sure the SetShellVarContext mode is the same before the calls to CreateShortcut and ShellLink::SetRunAsAdministrator