HKLM registry modification - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

pmalick
Posts: 15
Joined: Fri Jul 10, 2009 4:43 pm

HKLM registry modification

Hello,

I'm facing up a boring problem with UAC and the use of HKLM registry on windows Vista platform.
Keys located in HKLM can be shared between different users unfortunately Vista doesn't allow modification on HKLM (without the use of virtualization)
So where should I place my keys if I want to share them between all the users and give the ability to my software to modify them without the use of virtualization ?
Should I use the HKEY_USERS/.DEFAULT keys ?

Thanks for your help
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: HKLM registry modification

Hi,

What you need to do in order to write directly into HKLM(without virtualization) is to elevate the privileges of your installer and application.
To elevate the privileges of your installer, follow these steps:
- in your AI project, navigate to the Media page, Bootstrapper tab;
- tick the "Create EXE setup file" checkbox;
- further down the pane, in the "Security" section, set the Execution Level to "Require Administrator";

For elevating the privileges of your application, you need to create a manifest file, set the requestedExecutionLevel property to requireAdministrator, and then embed it into your executable. For details on how to do this, please consult the related article on MSDN:
http://msdn.microsoft.com/en-us/library/bb756929.aspx

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
pmalick
Posts: 15
Joined: Fri Jul 10, 2009 4:43 pm

Re: HKLM registry modification

Thanks for your help Gabriel.
My installer has already an administrator level and we are including manifest in our exe (as invoker).
I didn't want to raise the exe execution level to administrator just for writing to the registry !!!!!!
I'm just searching a place in the registry for writing values which are shared between all the users an can be modified during the software use without using virtualization and without raising the execution level to administrator.
What is your opinion about using the HKEY_USER/.DEFAULT place in the registry ?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: HKLM registry modification

Hi,
I'm just searching a place in the registry for writing values which are shared between all the users an can be modified during the software use without using virtualization and without raising the execution level to administrator.
I'm afraid there isn't such a place. All registry locations shared between users require Administrator privileges for writing.
What is your opinion about using the HKEY_USER/.DEFAULT place in the registry ?
This hive requires Administrator privileges for writing.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
stevefal
Posts: 119
Joined: Wed Sep 03, 2008 9:02 pm
Location: Washington USA
Contact: Website

Re: HKLM registry modification

If you have the ability to create the keys using AI, you can create them in HKLM and set their permissions per http://www.advancedinstaller.com/user-g ... ialog.html for full access by Everyone. The installer must run as Administrator to do this.

After doing so, Limited users will be able to Read/Write to the HKLM keys.

I may be wrong, but as I recall, in order to avoid Vista virtualization of HKLM under Vista 64, I had to set the project to mixed 32/64 bit under Install Parameters, and set the Registry component to 64 bit under Organization.
Last edited by stevefal on Fri Jul 24, 2009 2:19 pm, edited 1 time in total.
pmalick
Posts: 15
Joined: Fri Jul 10, 2009 4:43 pm

Re: HKLM registry modification

Thanks Stevefal,

I try to modify the registry permission in HKLM and it works perfectly for all the users. I'm now able to change the HKLM registry values without virtualization.

I do the following settings on my HKLM registry :
I give the ability to modify the registry for "Everyone" and "[USERNAME]"
I give the full registry control to [Administrators]

Just a little aditional question : for who is the "everyone" username used ? only for the guest account ?
stevefal
Posts: 119
Joined: Wed Sep 03, 2008 9:02 pm
Location: Washington USA
Contact: Website

Re: HKLM registry modification

"Everyone" is a special entity that really means <anyone>. When a permission is set for Everyone, that permission will apply to any username that is logged on. If Everyone has full permissions, there's no need for any other rules, since anyone will already be able to do anything with the key.

Return to “Common Problems”