WINAMP.COM | Forums : Powered by vBulletin version 2.3.9 WINAMP.COM | Forums > Developer Center > NSIS Discussion > Installation fails for non-admins under WindowsXP
  Last Thread   Next Thread
Author
Thread Post New Thread    Post A Reply
cowwoc
Junior Member

Registered: Feb 2005
From:

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

__________________
http://www.desktopbeautifier.com/

Quick Link | Report this post to a moderator | IP: Logged

cowwoc is offline Old Post 10-07-2009 04:25 PM
Click Here to See the Profile for cowwoc Click here to Send cowwoc a Private Message Click Here to Email cowwoc Find more posts by cowwoc Add cowwoc to your buddy list Edit/Delete Message Reply w/Quote
Anders
Major Dude

Registered: Jun 2002
From: N/A

use the userinfo plugin in .onInit or .onGuiInit and show a messagebox and quit if the user is not admin

__________________
IntOp $PostCount $PostCount + 1

Quick Link | Report this post to a moderator | IP: Logged

Anders is offline Old Post 10-07-2009 04:40 PM
Click Here to See the Profile for Anders Click here to Send Anders a Private Message Visit Anders's homepage! Find more posts by Anders Add Anders to your buddy list Edit/Delete Message Reply w/Quote
MSG
Senior Member

Registered: Oct 2006
From:

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.

Quick Link | Report this post to a moderator | IP: Logged

MSG is offline Old Post 10-07-2009 04:44 PM
Click Here to See the Profile for MSG Click here to Send MSG a Private Message Find more posts by MSG Add MSG to your buddy list Edit/Delete Message Reply w/Quote
cowwoc
Junior Member

Registered: Feb 2005
From:

That worked. Thanks!

__________________
http://www.desktopbeautifier.com/

Quick Link | Report this post to a moderator | IP: Logged

cowwoc is offline Old Post 10-08-2009 04:00 AM
Click Here to See the Profile for cowwoc Click here to Send cowwoc a Private Message Click Here to Email cowwoc Find more posts by cowwoc Add cowwoc to your buddy list Edit/Delete Message Reply w/Quote
All times are GMT. The time now is 09:01 PM. Post New Thread    Post A Reply
  Last Thread   Next Thread
WINAMP.COM | Forums : Powered by vBulletin version 2.3.9 WINAMP.COM | Forums > Developer Center > NSIS Discussion > Installation fails for non-admins under WindowsXP
Show Printable Version
 | 
Email this Page
 | 
Subscribe to this Thread

Forum Jump:
 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is off
vB code is ON
Smilies are ON
[IMG] code is ON