- NSIS Discussion
- How do I make a user level have admin rights during installation?
Archive: How do I make a user level have admin rights during installation?
bedbuffer
13th April 2009 08:05 UTC
How do I make a user level have admin rights during installation?
I made an installer that works perfectly with XP. It works with Vista as well but only with administrators.
What if the user wants to install this software but doesn't have the administrator's password (user level at VISTA)? I have tried using the UAC plug in, but this would definitely prompt the user for the admin password.
Is there anyway that could make the installer run by the user as if he's the admin?
Please help... thanks...
Animaether
13th April 2009 11:17 UTC
The entire point of access levels is that a common user can't just simply gain admin level without so much as a prompt for administrator credentials... so, no - you can't have your installer magically gain admin level if the person running the installer only has user level.
If common users should be able to use your installer, you might have to check why your installer needs admin level and see if you can eliminate that need.
bedbuffer
15th April 2009 05:50 UTC
That's right. You have a point. But I was wondering why you can install GTalk even if you only have a user level. I think same goes with yahoo messenger.
I would want to make it work that way if there's any way. I actually made a workaround, you can get to install it but only on the APPDATA folder. I figured you can't install in the PROGRAM files folder if you're only a user.
Anders
15th April 2009 09:47 UTC
Your installer is just as broken on XP, it's just that most people run as admin there (but not everyone)
bedbuffer
15th April 2009 10:47 UTC
Nope, it works perfectly on XP whatever folder you select... I'm only having problems on Vista.
If you can install Gtalk and YM on Vista without having admin rights, that means, there's gotta be a way you could do that on your own installer.
That's what I'm trying to figure out...
Anders
15th April 2009 11:57 UTC
If you try to write to $programfiles without checking for admin rights on XP, your installer is broken!
To install something as non-admin, you must install the program in $localappdata or $appdata
bedbuffer
15th April 2009 12:02 UTC
I understand, but that's not what i want to do... :) I want to be able to install to any folder... :D
Comperio
15th April 2009 23:31 UTC
UAC will also block access to the root of the system drive (C:\ for example) as well as the Windows and Program Files folders. (I'm not totally sure, but I believe the restriction to the root of the system drive might be the difference between XP and Vista.)
MS recommends using the user's profile folder instead if trying to run without elevated permissions. More info here: http://technet.microsoft.com/en-us/w.../cc507861.aspx
redxii
16th April 2009 02:25 UTC
UAC facilitates switching between Administrator and Non-Administrator tokens, in order to temporarily elevate permissions for a program w/o using a separate account. Else, it has to do with file system permissions which should be the same or similar between XP and Vista.
- Cannot write a FILE to root but can create a folder in the root; if another user created that folder then they can add their own files but not modify the other user's files.
- Can write to their profile directory, and the Shared Documents folder (they can add their own files but not modify other users' files).
- Write to HKEY_CURRENT_USER, few exceptions: HKCU\Software\Microsoft\Windows\CurrentVersion\Policies is not writeable by non-admin even though it's under their hive
bedbuffer
16th April 2009 03:24 UTC
If you select "single user" for the install type, that means the application will be installed in the current user's account.
My understanding is that, if you're an admin the application should be written in HKLM which makes it available to all users. And if you're just a user it should be written in HKCU.
My question is, If I'm an admin and I select "single user" will the application installed be available to all users?
redxii
16th April 2009 04:05 UTC
My question is, If I'm an admin and I select "single user" will the application installed be available to all users? [/B]
That depends on where you install it. If you install it within the admin's profile, non-admin users won't be able to access the program. Non-admins also cannot access other users' profiles, via file system permissions and not UAC, if using NTFS as the file system. If it is somewhere where the user can read it then they can open the program.
Anders
16th April 2009 09:54 UTC
single user is single user, does not matter if you are admin or not
nsfis
17th April 2009 12:44 UTC
bedbuffer,
have you tried to set RequestExecutionLevel to "user"? By default, XML manifest is not included and OS decides itself what priviliges are required. It can recognize that EXE is an installer and then requires admin priviliges.
bedbuffer
20th April 2009 03:19 UTC
nsfis,
Yes I did, it was the very first thing I considered actually. :D
bedbuffer
20th April 2009 06:57 UTC
Last Friday, I just finished creating the installer and it works perfectly with Vista and XP. It sets the installation folder depending on the level of priviledge the user has (admin, user, etc...) and it also bypasses the UAC prompt in Vista.
Thanks...
bedbuffer
20th April 2009 10:17 UTC
Do you guys know how to create a software updater? one that silently installs...
bedbuffer
22nd April 2009 09:44 UTC
I just figured how to... thanks... :D
ethanchen
30th April 2009 10:26 UTC
hi bedbuffer, would you show how to do it?
bedbuffer
6th May 2009 07:21 UTC
yes, just check the vpatch sample included in the nsis package. That's how I made the updater...
bedbuffer
6th May 2009 07:58 UTC
also, add a line that would read the registry entry of your app (location of the app) so it would know where to install the updates....