Hi,
I need NSIS to create my application's shortcut with "Run as administrator" checked by defaut, because otherwise the application auto-update feature doesn't work (updated .exe cannot be written to C:\Program Files).
I tried to set RequestExecutionLevel admin but it doesn't help.
Is it possible to do that from NSIS? I really don't want to ask customers to manually set this checkbox manually after the installation.
Thanks for your help!
How to create a shortcut with "Run as administrator" checked
8 posts
I'm not sure this is what I need.
The "runas" will ask for administrator password each time the application is launched, right?
I need that application runs as administrator when the user double click on the shortcut, exactly like if he does check the "Run as administrator" from the shortcut properties.
The "runas" will ask for administrator password each time the application is launched, right?
I need that application runs as administrator when the user double click on the shortcut, exactly like if he does check the "Run as administrator" from the shortcut properties.
You may have missed the 2nd link which I added a second later.
Stu
Stu
Thanks for your help, but it still doesn't make it.
I tried to create a shortcut with this:
runas /user:ComputerName\administrator "C:\Program Files\App\App.exe"
When I double click the shortcut, it opens a command line window that asks for my password.
The shortcut is a half part of the problem, because my application is also started with Windows (from the registry's Run key) and it has to start with administrator privileges too.
I tried to create a shortcut with this:
runas /user:ComputerName\administrator "C:\Program Files\App\App.exe"
When I double click the shortcut, it opens a command line window that asks for my password.
The shortcut is a half part of the problem, because my application is also started with Windows (from the registry's Run key) and it has to start with administrator privileges too.
sample code @ http://blogs.msdn.com/oldnewthing/ar...9/6801084.aspx hopefully someone can convert it to system plugin code
Here is the full code with error handling I wrote for that:
It's C++ though. I put that in our dll and simply executed upon successful install using rundll32.
PS. Sorry for bumping an old thread - mistake due to message filtering.
Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.
It's C++ though. I put that in our dll and simply executed upon successful install using rundll32.
PS. Sorry for bumping an old thread - mistake due to message filtering.