PDA

View Full Version : Granting access to registry key



NewsArchive
08-10-2007, 01:59 PM
Hi Friedrich,

I want to grant all users read access to a certain HKLM registry key.
I'm using the latest build (just downloaded build 1953) and it asks
for domain and user. Since I have no idea what those would be on the
destination computer, I'm unsure how this should work and I need to
set it for all users...

Any pointers on how to use this?

Best regards,

Arnór Baldvinsson
Icetips Creative, Inc.
San Antonio, Texas, USA
www.icetips.com


Subscribe to information from Icetips.com:
http://www.icetips.com/subscribe.php

NewsArchive
08-10-2007, 02:05 PM
Hi Arnór,

On Friday, June 08, 2007, I posted the following "Vista: Write to
HKEY_LOCAL_MACHINE and C:\Program Files\YourApp under Vista" message.

Perhaps the demo script already helps?

Friedrich

---

All,

I know that quite a few of you are having a hard time converting existing
applications to Vista.

Under Windows XP, most users normally live in Administrator login mode.
This is not the case in Vista - UAC mode allows you to login as a Standard
User, but still perform admin tasks. It's very important to provide a
"mixed mode" application (runs fine as Administrator and Standard User) for
Vista because most users live in Standard Mode. Your application should
always work fine in a "locked environment" and should never request
administrator execution level privileges.

An application should request "asInvoker" execution level privileges. Such
applications cannot write to a protected resource, such as Program Files or
HKEY_LOCAL_MACHINE in the Registry.

If "virtualization" is not an option for you or does not work and time is
an issue, we may have a solution powered by SetupBuilder 6.5. Microsoft
does not like that workaround at all and it should only be used as a
temporary workaround or as a "lifesaver"! We have tested this on both
Vista-32 and Vista-64 machines.

Download the following demo files:

1. Vista-aware "asInvoker" Clarion Demo Application (144 KB)

http://www.lindersoft.com/vista.zip

This includes a simple "vista.exe" Clarion 6.3 build 9056 test executable.

2. SetupBuilder 6.5 Demo Installer (142 KB)

http://www.lindersoft.com/UAC_Workaround_Bin.zip

This includes a simple SetupBuilder 6.5 installer (code-signed).

3. (optional) SetupBuilder 6.5 Project Script (full source code) (88 KB)

http://www.lindersoft.com/UAC_Workaround_Script.zip

This includes a the project script (source code) for SetupBuilder 6.5
Developer Edition. It does *not* work for SetupBuilder 6.5 Professional
Edition!

---

Okay, "virtualization is not an option and we would like to write from our
application to the "ServerName" value in the
HKEY_LOCAL_MACHINE\JoeUserSoftware
key (protected resource).

*** First Try (will fail)

1. On Vista (UAC enabled, Administrator or Standard User), start vista.exe
by double-clicking the file name. Do not "Run as administrator"

2. Because HKEY_LOCAL_MACHINE\JoeUserSoftware is a protected resource,
you'll get a "Unable to set the ServerName" error.

*** Second Try (the workaround)

1. Start the UAC_Workaround.exe SetupBuilder application and install it.

2. Start vista.exe again by double-clicking the file name. Do not "Run as
administrator"

3. This time your asInvoker application was able to write to
HKEY_LOCAL_MACHINE\JoeUserSoftware and update the ServerName value. You
can use RegEdit to check this.

In other words, your application can write to HKEY_LOCAL_MACHINE now. The
same can be done with C:\Program Files\YourApp

4. Uninstall the demo by running UAC_Workaround.exe again - select Remove
(uninstall) in the maintenance dialog.

Use it at your own risk. Feel free to discuss Pros and Cons. You should
always try to follow the new Vista rules, but I know (from 80-90 private
emails) that sometimes it's not easy or even impossible to do so.

Friedrich

Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder 6.5
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
08-10-2007, 02:41 PM
Hi Friedrich,

>On Friday, June 08, 2007, I posted the following "Vista: Write to
>HKEY_LOCAL_MACHINE and C:\Program Files\YourApp under Vista" message.
>
>Perhaps the demo script already helps?

Thanks! I thought this had popped up but couldn't find it. Since my
program only ever needs to read the key (right now I'm actually
pursuing a command line parameter to pass the two pieces of info I
need) I should be fine writing to HKLM from the setup and read it from
the program.

Getting this vista stuff up to snuff is a lot of work, thanks MS<g>

Best regards,

Arnór Baldvinsson
Icetips Creative, Inc.
San Antonio, Texas, USA
www.icetips.com


Subscribe to information from Icetips.com:
http://www.icetips.com/subscribe.php

NewsArchive
08-10-2007, 02:50 PM
Hi Arnór,

>
> Getting this vista stuff up to snuff is a lot of work, thanks MS<g>
>

I agree 100% ;-)

Just found a Vista-incompatibility in the SetupBuilder IDE (documentation
update checking does not work in Standard User mode because asInvoker does
not allow Winsock access). There is no way around this other than doing the
documentation update in Administrator mode.

Friedrich