View Full Version : How do I make a user level have admin rights during installation?
13th April 2009, 07:05
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...
13th April 2009, 10:17
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.
15th April 2009, 04:50
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.
15th April 2009, 08:47
Your installer is just as broken on XP, it's just that most people run as admin there (but not everyone)
15th April 2009, 09:47
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...
15th April 2009, 10:57
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
15th April 2009, 11:02
I understand, but that's not what i want to do... :) I want to be able to install to any folder... :D
15th April 2009, 22:31
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/windows/cc507861.aspx
16th April 2009, 01:25
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
16th April 2009, 02:24
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?
16th April 2009, 03:05
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.
16th April 2009, 08:54
single user is single user, does not matter if you are admin or not
17th April 2009, 11:44
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.
20th April 2009, 02:19
Yes I did, it was the very first thing I considered actually. :D
20th April 2009, 05:57
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.
20th April 2009, 09:17
Do you guys know how to create a software updater? one that silently installs...
22nd April 2009, 08:44
I just figured how to... thanks... :D
30th April 2009, 09:26
hi bedbuffer, would you show how to do it?
6th May 2009, 06:21
yes, just check the vpatch sample included in the nsis package. That's how I made the updater...
6th May 2009, 06:58
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....
vBulletin® v3.8.6, Copyright ©2000-2013, Jelsoft Enterprises Ltd.