|
|
|
|
#1 |
|
Member
Join Date: Feb 2005
Posts: 51
|
Installation fails for non-admins under WindowsXP
Hi,
I just found out that when a user runs my installer under WindowsXP as a non-Administrator the InstallDir file extraction will fail with some cryptic error message about not being able to write <output_file>. My InstallDir points to a directory in C:\Program Files so I am thinking this is a permissions problem. Fair enough, but then how do I get Windows to elevate my permisions to admin (I suspect this isn't possible in XP)? Alternatively, how do I warn the user on startup that the installer must be run as an admin? This seems like a common problem. I'm rather surprised I haven't found a mention of it on the forums or Google. Thank you, Gili |
|
|
|
|
|
#2 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,442
|
use the userinfo plugin in .onInit or .onGuiInit and show a messagebox and quit if the user is not admin
IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#3 |
|
Major Dude
Join Date: Oct 2006
Posts: 1,892
|
Indeed, you cannot 'automatically' elevate the user to Admin in Windows XP. You need to use the UserInfo plugin (UserInfo::GetAccountType) to determine whether or not the user has Admin access. Typically you can do this in .onInit .
(Note that on Vista/Windows7 you *also* need to use the UserInfo plugin, in case the user has disabled his UAC. So just use it always.) Edit: Heh, too late. |
|
|
|
|
|
#4 |
|
Member
Join Date: Feb 2005
Posts: 51
|
That worked. Thanks!
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|