HKCU Key Routine

Got a problem you cannot solve? Try here.
Post Reply
jdeleon7010
Posts: 27
Joined: Thu Jul 26, 2012 2:23 pm

HKCU Key Routine

Post by jdeleon7010 »

When we build wrappers, we usually check if the user has admin rights, if not, the wrapper will relaunch itself using an admin account.

We have some reg keys that need to be written to HKCU and because the application is elevated, all HKCU keys will be written to the admin account's hive.

Is there an easier way to write reg keys to HKCU other than applying the keys prior to Run as command?
FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: HKCU Key Routine

Post by FrancescoT »

Dear User,

I'm sorry but I'm not sure if I follow your question.

Do you want to write to HKCU (under the user account that launched the setup package ... not the admin) before executing a Run As command?

I'm correct?

Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
jdeleon7010
Posts: 27
Joined: Thu Jul 26, 2012 2:23 pm

Re: HKCU Key Routine

Post by jdeleon7010 »

I want to write to the HKCU thats currently logged into the machine.
FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: HKCU Key Routine

Post by FrancescoT »

Dear User,

if it is that, try the following:

Code: Select all

Set Variable NATIVE_ENGINE to TRUE
Write Registry Key HKCU\\, 
Set Variable NATIVE_ENGINE to FALSE
Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
jdeleon7010
Posts: 27
Joined: Thu Jul 26, 2012 2:23 pm

Re: HKCU Key Routine

Post by jdeleon7010 »

Thank you for the reply, but once the installer is elevated as a different user, will this write to the elevated user hive?
FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: HKCU Key Routine

Post by FrancescoT »

That's correct ... but probably you should require elevation only for your wrapped packages.

Regards.
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Post Reply