|
|
|
|
#1 |
|
Junior Member
Join Date: Oct 2010
Posts: 2
|
I need help by my NSIS project.
Is it possible for NSIS to be executed automatically as admin. The problem is on Windows 7 and Vista, there is an error. For my clients it is too complicated to run as Admin. Thanks... Grz Floydmovie |
|
|
|
|
|
#2 |
|
Major Dude
Join Date: Feb 2007
Posts: 672
|
|
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Aug 2007
Location: Paris, France
Posts: 304
|
mmh in this case, Google doesn't give the first trivial answer to floydmovie's question:
Just use RequestExecutionLevel admin in your script and your users will be automatically prompted to let your installer run as admin. No need of plugins for this. My NSIS plug-ins: http://wiz0u.free.fr/prog/nsis.php |
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Oct 2010
Posts: 2
|
Thanks for the quick reply.
Can you do me a small example? |
|
|
|
|
|
#5 | |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,442
|
Quote:
See http://nsis.pastebin.com/63tS3AS2 for a proper example. IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
|
#6 |
|
Senior Member
Join Date: Aug 2007
Location: Paris, France
Posts: 304
|
Oh, I thought floydmovie expected his installer to be run only on Windows 7 & Vista. My bad.
Of course there can be problems with non-admin accounts on prior version of Windows, but floydmovie said he didn't have any problem on prior versions... This is probably because 90% of users of these older versions of Windows have admin accounts. If you want to deal with the 10% users left, you can use the link given by Anders for a solution. My NSIS plug-ins: http://wiz0u.free.fr/prog/nsis.php |
|
|
|
|
|
#7 | |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,442
|
Quote:
IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
|
#8 | |
|
Senior Member
Join Date: Aug 2007
Location: Paris, France
Posts: 304
|
Quote:
I have faced this case, and there is no possibility for an installer to obtain admin rights, even asking for a admin account. So NSIS will fail anyway, sooner or later. If you want to be nice, all you can do is detect this case and display a MessageBox saying "you're screwed!" PS: Of course I'm not talking about programs that can be installed completely using user-only folder/registry My NSIS plug-ins: http://wiz0u.free.fr/prog/nsis.php |
|
|
|
|
|
|
#9 | |
|
Major Dude
Join Date: Oct 2006
Posts: 1,892
|
Quote:
Anders is absolute correct in his statements. |
|
|
|
|
|
|
#10 |
|
Senior Member
Join Date: Aug 2007
Location: Paris, France
Posts: 304
|
Sure, and that's what I personally do in my own installers..
But I just don't expect every NSIS users to be ready to go to this extent of covering every cases, especially this (rare in my opinion) case of a non-admin users trying to install a program while UAC is disabled. My NSIS plug-ins: http://wiz0u.free.fr/prog/nsis.php |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|