Old 29th May 2012, 12:48   #1
Junior Member
Join Date: May 2012
Posts: 1
Exclamation FileOpen as admin

I am trying to open a file during the installation that needs to be run as an administrator. currently my code looks like this:

#find the Configure Virtual Printer File and run it
${FindIt} "C:" "ConfigureVirtualPrinter.exe" "$R0"
FileOpen $4 "$R0" w
FileRead $4 $1
FileClose $4

I do not want a box to popup asking for username and password credentials. I want the same effect as either right clicking on the program and saying run as admin or going into the command line and typing it. Is this possible to be done during the installation process when I open the file?
helpPlease is offline   Reply With Quote
Old 29th May 2012, 14:44   #2
Major Dude
Join Date: Oct 2006
Posts: 1,892
You cannot launch something as admin if you're not admin yourself. It is 100% impossible, unless you count zero-day exploits. The right-click 'run as admin' also pops a user/pass dialog. If you're using UAC on Vista or higher, and you're already an admin user, this box is replaced by a simple 'Yes/No' popup. But it's still the same thing.

To run an exe as admin, try searching the nsis forums for 'run as admin' for example, or just use runas.exe.
MSG is offline   Reply With Quote
Go Back   Winamp & SHOUTcast Forums > Developer Center > NSIS Discussion

fileopen, run as admin

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump