Page 1 of 1

HKCU Key Routine

Posted: Fri Aug 10, 2012 9:11 am
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?

Re: HKCU Key Routine

Posted: Fri Aug 10, 2012 9:27 am
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

Re: HKCU Key Routine

Posted: Fri Aug 10, 2012 12:30 pm
by jdeleon7010
I want to write to the HKCU thats currently logged into the machine.

Re: HKCU Key Routine

Posted: Mon Aug 13, 2012 6:54 am
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

Re: HKCU Key Routine

Posted: Mon Aug 13, 2012 9:34 am
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?

Re: HKCU Key Routine

Posted: Mon Aug 13, 2012 10:02 am
by FrancescoT
That's correct ... but probably you should require elevation only for your wrapped packages.

Regards.