Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   Installation fails for non-admins under WindowsXP (http://forums.winamp.com/showthread.php?t=313495)

cowwoc 7th October 2009 16:25

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

Anders 7th October 2009 16:40

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

MSG 7th October 2009 16:44

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.

cowwoc 8th October 2009 04:00

That worked. Thanks!


All times are GMT. The time now is 17:43.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.