View Single Post
Old 17th June 2008, 04:27   #6
Hichhiker
Junior Member
 
Join Date: Jun 2008
Posts: 6
OK, I am not sure if there is something is wrong with this method, but I came across this and have not seen a reference to it anywhere on NSIS forum. I think it is way easier than anything else proposed here and seems to work great.

Basically the "Run As Administrator" is simply a registry value stored in "Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\layers" , so you can use:

code:

WriteRegStr HKLM "Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\layers" \
"$MY_SHORCUT_OR_EXE" "RUNASADMIN"



Obviously replace $MY_SHORCUT_OR_EXE with your executable or shortcut. You can replace HKLM with HKCU for user specific setting instead of all users.


I figured I'd share.

-HH
Hichhiker is offline   Reply With Quote