|
|||||||
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
|
#1 |
|
Junior Member
Join Date: Apr 2009
Posts: 33
|
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... |
|
|
|
|
|
#2 |
|
Major Dude
Join Date: Jun 2001
Posts: 1,173
|
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. |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Apr 2009
Posts: 33
|
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. |
|
|
|
|
|
#4 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,442
|
Your installer is just as broken on XP, it's just that most people run as admin there (but not everyone)
IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Apr 2009
Posts: 33
|
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... |
|
|
|
|
|
#6 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,442
|
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 IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#7 |
|
Junior Member
Join Date: Apr 2009
Posts: 33
|
I understand, but that's not what i want to do...
I want to be able to install to any folder...
|
|
|
|
|
|
#8 |
|
Major Dude
Join Date: Jan 2005
Location: Oregon Coast
Posts: 737
|
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 |
|
|
|
|
|
#9 |
|
Senior Member
Join Date: Nov 2005
Posts: 115
|
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 |
|
|
|
|
|
#10 |
|
Junior Member
Join Date: Apr 2009
Posts: 33
|
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? |
|
|
|
|
|
#11 | |
|
Senior Member
Join Date: Nov 2005
Posts: 115
|
Quote:
|
|
|
|
|
|
|
#12 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,442
|
single user is single user, does not matter if you are admin or not
IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#13 |
|
Junior Member
Join Date: Oct 2001
Posts: 29
|
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. |
|
|
|
|
|
#14 |
|
Junior Member
Join Date: Apr 2009
Posts: 33
|
nsfis,
Yes I did, it was the very first thing I considered actually.
|
|
|
|
|
|
#15 |
|
Junior Member
Join Date: Apr 2009
Posts: 33
|
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... Last edited by bedbuffer; 20th April 2009 at 07:18. |
|
|
|
|
|
#16 |
|
Junior Member
Join Date: Apr 2009
Posts: 33
|
Do you guys know how to create a software updater? one that silently installs...
|
|
|
|
|
|
#17 |
|
Junior Member
Join Date: Apr 2009
Posts: 33
|
I just figured how to... thanks...
|
|
|
|
|
|
#18 |
|
Junior Member
Join Date: Apr 2009
Posts: 1
|
hi bedbuffer, would you show how to do it?
|
|
|
|
|
|
#19 |
|
Junior Member
Join Date: Apr 2009
Posts: 33
|
yes, just check the vpatch sample included in the nsis package. That's how I made the updater...
|
|
|
|
|
|
#20 |
|
Junior Member
Join Date: Apr 2009
Posts: 33
|
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....
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|