leonkrown Absent Member.
Absent Member.
3665 views

Registry Edit - Adding Key/Value to HKLU

We're trying to deploy a piece of software that requires a registry key/value in HKCU\Software\restofpath\.

It seems whether we put the registry edit directly in the MSI/MST or try and do it after the MSI is installed via a registry edit action, it is not putting the key/value in the right spot. The key/value is being created in HKU\.Default\Software\restofpath\

Are we not understanding how that registry edit action works, etc...?

When creating the registry edit, we've tried importing the setting or creating it manually with no luck. We place it in the HKLU\Software\restofpath, but it always puts it in the HKU\.Default\Software\restofpath

Ideas?

Thanks!
Labels (2)
0 Likes
11 Replies
Micro Focus Expert
Micro Focus Expert

Re: Registry Edit - Adding Key/Value to HKLU

Look on the Advanced Tab of the Action.
There is a checkbox that says to use the User's hive instead of .Default

On 6/28/2012 2:36 PM, leonkrown wrote:
>
> We're trying to deploy a piece of software that requires a registry
> key/value in HKCU\Software\restofpath\.
>
> It seems whether we put the registry edit directly in the MSI/MST or
> try and do it after the MSI is installed via a registry edit action, it
> is not putting the key/value in the right spot. The key/value is being
> created in HKU\.Default\Software\restofpath\
>
> Are we not understanding how that registry edit action works, etc...?
>
> When creating the registry edit, we've tried importing the setting or
> creating it manually with no luck. We place it in the
> HKLU\Software\restofpath, but it always puts it in the
> HKU\.Default\Software\restofpath
>
> Ideas?
>
> Thanks!
>
>



--
Craig Wilson - MCNE, MCSE, CCNA
Novell Knowledge Partner

Novell does not officially monitor these forums.

Suggestions/Opinions/Statements made by me are solely my own.
These thoughts may not be shared by either Novell or any rational human.
0 Likes
leonkrown Absent Member.
Absent Member.

Re: Registry Edit - Adding Key/Value to HKLU

Hi Craig,

We had seen that and tested accordingly, however the result was still in the wrong place.
We added the registry edit manually to a machine, exported the key, imported it in for the bundle and tried it with that option both ways. Interestingly when creating an MST to try and apply this same registry key that way, it still adds it to the .DEFAULT and not the HKLU.

We read over the documentation and feel we understand the options available, but it doesn't appear to function correctly. We have full debugging turned on and we're not really seeing anything that could point us to why that would install to the wrong area of the registry. Since it is actually adding it to the registry (MST or the bundle action) there are no errors thrown.

Thanks.

LK
0 Likes
Micro Focus Expert
Micro Focus Expert

Re: Registry Edit - Adding Key/Value to HKLU

Are you doing this when a user is logged into the device?
If So, I would recommend an SR.
I've never heard this issue before except when not selecting that option.

On 6/28/2012 6:26 PM, leonkrown wrote:
>
> Hi Craig,
>
> We had seen that and tested accordingly, however the result was still
> in the wrong place.
> We added the registry edit manually to a machine, exported the key,
> imported it in for the bundle and tried it with that option both ways.
> Interestingly when creating an MST to try and apply this same registry
> key that way, it still adds it to the .DEFAULT and not the HKLU.
>
> We read over the documentation and feel we understand the options
> available, but it doesn't appear to function correctly. We have full
> debugging turned on and we're not really seeing anything that could
> point us to why that would install to the wrong area of the registry.
> Since it is actually adding it to the registry (MST or the bundle
> action) there are no errors thrown.
>
> Thanks.
>
> LK
>
>



--
Craig Wilson - MCNE, MCSE, CCNA
Novell Knowledge Partner

Novell does not officially monitor these forums.

Suggestions/Opinions/Statements made by me are solely my own.
These thoughts may not be shared by either Novell or any rational human.
0 Likes
leonkrown Absent Member.
Absent Member.

Re: Registry Edit - Adding Key/Value to HKLU

In testing, the local admin was logged in. At the time we'd actually push the application, it would be after hours with no one logged in.

After thinking about this last night, it appears that the registry entries where this key is supposed to go are not created until the program is launched. I moved the registry edit action to the launch action to see if that would set it up, but it doesn't.

I installed the software manually on a machine, launched the application and closed it. The registry entries were present. Then I pushed a test bundle with just the registry edit and it still put it in the wrong spot. As a test, instead of putting the key in the HKLU, I created it in the HKLM as a dummy entry and it added that correctly. It just seems something with the HKLU and HKU are not working as I would expect.

I'll open a SR.

Thanks Craig.
0 Likes
Micro Focus Expert
Micro Focus Expert

Re: Registry Edit - Adding Key/Value to HKLU

The HKCU Keys are User Specific.
They apply to whoever is logged into the PC at that time.

The Registry Key for "Nobody Logged On" is actually .Default.

To fully understand this, try editing that portion of the registry to
set a ScreenSaver and a short timeout.

Then logoff and you will see that you now have a new screen saver when
nobody is logged in.

This is why it always went to that key.


Also, there is no such think as HKLU it's HKLM or HKCU.
And those settings are generally not interchangeable.

It's possible that a particular program may read both to allow for a
default and a user specific over-ride, but that is generally not the
norm and fully application specific.


On 6/29/2012 9:26 AM, leonkrown wrote:
>
> In testing, the local admin was logged in. At the time we'd actually
> push the application, it would be after hours with no one logged in.
>
> After thinking about this last night, it appears that the registry
> entries where this key is supposed to go are not created until the
> program is launched. I moved the registry edit action to the launch
> action to see if that would set it up, but it doesn't.
>
> I installed the software manually on a machine, launched the
> application and closed it. The registry entries were present. Then I
> pushed a test bundle with just the registry edit and it still put it in
> the wrong spot. As a test, instead of putting the key in the HKLU, I
> created it in the HKLM as a dummy entry and it added that correctly. It
> just seems something with the HKLU and HKU are not working as I would
> expect.
>
> I'll open a SR.
>
> Thanks Craig.
>
>



--
Craig Wilson - MCNE, MCSE, CCNA
Novell Knowledge Partner

Novell does not officially monitor these forums.

Suggestions/Opinions/Statements made by me are solely my own.
These thoughts may not be shared by either Novell or any rational human.
0 Likes
leonkrown Absent Member.
Absent Member.

Re: Registry Edit - Adding Key/Value to HKLU

HKLU was a typo. I meant HKCU. 🙂

I understand the differences in the various registry hives; what I don't understand is why the key is not created where I tell it to be in the first place whether I use ZEN or a MST. Either method places the key in the .Default. If the key is manually added, the program finds it and it works as it should.

According to the details for this program, it looks specifically for this value in HKCU\Software\Vendor\SoftwareName\. I figured by moving the registry edit action to the launch set it would check for and populate that key for anyone that would launch the program if it was missing. Even that action under the launch still places it in the HKU for which the program doesn't find there.

We're just looking for a way to populate that path with a certain value via ZEN or in the MST. The MST is applying correctly all of the other settings, just not the registry portion. For the MST, I can see if the main keys for the program are not created yet, it wouldn't set that, but for ZEN not being able to set that even on the launch is strange.

Unless I am completely off base here with what I am expecting... I'll open a SR to see if it is something else.

Thanks.
0 Likes
Micro Focus Expert
Micro Focus Expert

Re: Registry Edit - Adding Key/Value to HKLU

IT DOES put it in the correct location.

The HKCU is different FOR EVERY USER.

On Some Networks, that could be 50,000 different locations stored across
500 servers.

You stated you are running this when nobody is logged in.

The PRECISE and SPECIFIC and EXACT location for HKCU for "Not Logged in"
is .DEFAULT

..DEFAULT == "Not Logged In"

ZCM is doing exactly what you stated.
And why MSIs act the same.




On 6/29/2012 10:46 AM, leonkrown wrote:
>
> HKLU was a typo. I meant HKCU. 🙂
>
> I understand the differences in the various registry hives; what I
> don't understand is why the key is not created where I tell it to be in
> the first place whether I use ZEN or a MST. Either method places the key
> in the .Default. If the key is manually added, the program finds it and
> it works as it should.
>
> According to the details for this program, it looks specifically for
> this value in HKCU\Software\Vendor\SoftwareName\. I figured by moving
> the registry edit action to the launch set it would check for and
> populate that key for anyone that would launch the program if it was
> missing. Even that action under the launch still places it in the HKU
> for which the program doesn't find there.
>
> We're just looking for a way to populate that path with a certain value
> via ZEN or in the MST. The MST is applying correctly all of the other
> settings, just not the registry portion. For the MST, I can see if the
> main keys for the program are not created yet, it wouldn't set that, but
> for ZEN not being able to set that even on the launch is strange.
>
> Unless I am completely off base here with what I am expecting... I'll
> open a SR to see if it is something else.
>
> Thanks.
>
>



--
Craig Wilson - MCNE, MCSE, CCNA
Novell Knowledge Partner

Novell does not officially monitor these forums.

Suggestions/Opinions/Statements made by me are solely my own.
These thoughts may not be shared by either Novell or any rational human.
0 Likes
leonkrown Absent Member.
Absent Member.

Re: Registry Edit - Adding Key/Value to HKLU

I am testing this with a user logged in while the bundle is being deployed to the device and installed.
I said, "At the time we'd actually push the application, it would be after hours with no one logged in."

So when we are ready to deploy we would do it when no on is logged in. Currently during testing, the local admin account is logged in during the time of the bundle doing it's work.

So, how do we set the bundle to put that registry key for any user that would login to HKCU? As you say, it won't put it in the correct spot if we deploy it after hours because no on will be logged in. So if we deploy after hours, how would we populate that value in HKCU? Via the launch actions? It does the same under that tab as well.
0 Likes
leonkrown Absent Member.
Absent Member.

Re: Registry Edit - Adding Key/Value to HKLU

Craig,

I apologize if we're not on the same page with this. Starting fresh...

My only problem with deploying this software is trying to figure out how to set a particular key value for any user that logs into the machine. The application doesn't write it's registry information to HKCU until it is launched per user. This is to be expected because the data is being written to HKCU (that for each user), correct? So it would appear that populating the HKCU with the key value I need for each user can not be done during deployment of the bundle?

What are my options for creating this key value for each user that is on the machine (existing or new) so that the registry location is populated prior to the application launching? I thought putting the registry edit action on the launch would work, but that appears to only be true if the program is launched from the ZEN window (which we don't use) and not the application itself (in the start menu)? We don't use the launch tab for our bundles, so I am not 100% sure of it's usage.

I appreciate your time and help.

Thanks.
LK
0 Likes
Micro Focus Expert
Micro Focus Expert

Re: Registry Edit - Adding Key/Value to HKLU

Here comes a long winded answer just to cover a million bases.
I'm sure 95% does not matter.

It's HARD to populate HKCU stuff at deployment time.
Generally, If it's required it's handled by the MSI.

The method in which it's handled is that a "Mini-verify" kicks off each
time you start the app.

Not 100% sure MS Office Still does it, but I recall that even if I
modified HKCU Office settings, altered File Associations, etc....

Every Time I launched Office, it would auto-correct itself.

I know that you can configure this in the MSIs, but I'm not enough of an
MSI expert to really help out there.

WHen Deploying an MSI, They can run as "Per User" or "Per Device".
Generally "Per Device" is best, but it requires the MSI to be installed
as a true administrator.

ZCM can generally install all MSIs even if a normal user is logged on
when set to run as logged on user. However, the install may drop down
to a "Per User Install" vs a "Per Machine" install. The vast percentage
of the time, there is no difference but sometimes per machine really
helps with certain apps. I've never seen a case where "per user" was
actually my preferred method.

So, If the MSI installs well outside of ZCM as a local administrator,
when creating the MSI install set it to run as a dynamic administrator
and not "System" or "logged on user".

If you see the same behavior outside of ZCM it will not matter since ZCM
will not be able to IMPROVE the behavior.


Jumping ship over to Regedit Commands, make sure that HKCU actions run
as Logged on User. It can be set to other impersonations, but this will
be the simplest. HKLM will need to be System or Administrator in most
cases.

I really don't know why Regedits are not working for you.
I'm stumped and have not seen this issue.
An SR may be able to figure it out.
Short of an SR, you could create a bundle action that called a REG file
as the logged on user. (There are numerous ways to do this.)
However, this still needs to be done as the user doing the logging in.


If you configure the Bundle to have a Launch Action as well and have the
users launch it from there, you can also set your HCKU settings there.


Super advanced options included a method I used in the past where I
wrote a little tool that i no longer have that would stamp the currently
logged in users registry and then actually open up each and every
profile on the PC (Including the Default User's profile which is
different than .default) This way every current account on the PC would
be changed as well as any future accounts. Of course this would not
work if roaming profiles are used.


I'm a big fan of having users launch apps from ZCM icons because it
gives me lots of run time control.





On 6/29/2012 1:06 PM, leonkrown wrote:
>
> Craig,
>
> I apologize if we're not on the same page with this. Starting fresh...
>
> My only problem with deploying this software is trying to figure out
> how to set a particular key value for any user that logs into the
> machine. The application doesn't write it's registry information to HKCU
> until it is launched per user. This is to be expected because the data
> is being written to HKCU (that for each user), correct? So it would
> appear that populating the HKCU with the key value I need for each user
> can not be done during deployment of the bundle?
>
> What are my options for creating this key value for each user that is
> on the machine (existing or new) so that the registry location is
> populated prior to the application launching? I thought putting the
> registry edit action on the launch would work, but that appears to only
> be true if the program is launched from the ZEN window (which we don't
> use) and not the application itself (in the start menu)? We don't use
> the launch tab for our bundles, so I am not 100% sure of it's usage.
>
> I appreciate your time and help.
>
> Thanks.
> LK
>
>



--
Craig Wilson - MCNE, MCSE, CCNA
Novell Knowledge Partner

Novell does not officially monitor these forums.

Suggestions/Opinions/Statements made by me are solely my own.
These thoughts may not be shared by either Novell or any rational human.
0 Likes
leonkrown Absent Member.
Absent Member.

Re: Registry Edit - Adding Key/Value to HKLU

Craig,

Thanks for the thorough response. We can always learn something.

There was a script I came across that works similar to the tool you mentioned. I'll have to see how it works and run it through some tests. I think that may be my only option at this point as the program is very picky. Maybe I could convince the application developers to have it read from HKLM instead! (unlikely) 🙂

I'll have to look into how I can make use of launching the applications from the ZEN application window. We could always use the extra flexibility.

Thanks again!
LK
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.