PDA

View Full Version : Setting User Full Control


strager
10-08-2008, 02:31 PM
Hi everyone,

Anyone know how to set Full User Control in the registry when installing on a Windows Vista Machine?

Thanks

Sheri

jassing
10-08-2008, 03:32 PM
Hi everyone,

Anyone know how to set Full User Control in the registry when installing on a Windows Vista Machine?

Thanks

Sheri

do you mean disable UAC?

strager
10-08-2008, 03:52 PM
In a way yes,

I have been trying to get my program to run on Vista.
It is an older program written in VB 6 and it uses an MS Access backend.
My current setup asks the user to select the install path for their database.
Then when the program first runs, it asks the user to select the db and then it writes this information to the registry under HKEY_USERS\.default\Software.
The program installed fine but when they would run it and select the database, it would not write the location to the registry.
I tried typing the location in the registry, but my program couldn't read it.
So I right clicked on my programs folder in the registry and changed permissions for users to full control and my program worked.
I thought if I could change that in my setup, I could get a successfull installation.

Thanks,

Sheri

jassing
10-08-2008, 04:02 PM
Honestly; you're trying to work around vista security; it'll be easier just to say "I will disable uac" and disable it.
A suprising number of my clients are going that route... especially VBers since they don't get the seperation of application and data that is required in vista. ("we" were supposed to be doing it in WinXP but not many did)

While this is related to files; it might work, or at least get you started.
http://support.microsoft.com/kb/257206

strager
10-08-2008, 04:17 PM
How do you disable this functionlity in a setup?

jassing
10-08-2008, 04:21 PM
How do you disable this functionlity in a setup?

You mean disable uac?
You need to make a registry change & then force a reboot.



Key: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Pol icies\System
Value: EnableLUA
Data: 0 (DWORD)

strager
10-08-2008, 04:27 PM
Thank you, I will give this a try

integral
10-09-2008, 02:55 AM
Wouldn't it be better if you create a manifest, that says that your program requires administrator privileges?

(Or better yet, just ask for the path during installation instead, or store it in the "current user" path)

Anyhow, if you create a text file, with the following contents:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="NAME OF YOUR PROGRAM" type="win32"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>

and name that file "yourprogram.exe.manifest", and save it in the same folder as yourprogram.exe.

That should make the UAC ask you when you start the program.

Your program will then be run at administrator privileges, and will have write access to the registry.

That's far better than completely disabling the UAC, I think.

jassing
10-09-2008, 07:58 AM
Going the manifest route has pluses & minuses.
The pluses are you can do whatever you want; just like uac being disabled, you can leave your program alone (data in where ever). The minuses are that the user is asked each and everytime the application is run, people get a "sense" that the app wants to do something it shouldn't, which leaves them uneasy.
In my experience, most home users are grateful to reg rid of the uac msgs.

The proper way; but most access/vb coders "dont' get it" is to seperate out the data from application. The downside to this is most vb/access apps require a major bit of updating & re-testing that delays updates.

I have clients with apps that cost well over $1000 per user and even tho we go over this, they opt for uac being disabled... and I'm talking major apps that are used in business, not just an end user type application. They sell and have no real desire to "fix" their application to actually be "vista compliant".