I have a package that contains 1st run settings for an app. I have this app configured to use active setup and it will write a ton of registry entries for each user. There is one part of the registry that is named for the username i.e. HKCU\SOFTWARE\BOBSMITH\VALUES - I set it up in WPS to use the value [%USERNAME] so it pulls the username from the env variables. This seems to work fine and dandy. When I push this out through GPO, it seems that this key is trying to be created and is giving me a error 1402

Error 1402. Could not open key: HKEY_CURRENT_USER\Software\Hummingbird\PowerDOCS\Core\Plugins\Fusion\Settings\REDList\\HOWARDBH.

Right after REDList is where the username should appear but doesn't.

There is also mention of a permission issue in the event log.
System error 87. Verify that you have sufficient access to that key, or contact your support personnel.

Obviously if I execute manually while I am logged on, everything is fine. I took this one key out and everything works fine. What is happening to cause this and how can I correct it?

Jimm
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
[%USERNAME]

Can you just try using [USERNAME] instead of [%USERNAME] in the registry and see if it works
Answered 09/09/2009 by: rmroshan
Senior Yellow Belt

Please log in to comment
0
That won't work unless there is a property called USERNAME. You are probably thinking of the LOGONUSER property. Try that instead.
Answered 09/09/2009 by: VBScab
Red Belt

Please log in to comment
0
Wise doesn't seem to like that at all. Any other ideas?

Jimm
Answered 09/09/2009 by: JimmPanik
Orange Belt

Please log in to comment
0
'LogonUser' is case-sensitive I believe. The 'Key' column in your Registry table should look like this:

Software\Hummingbird\PowerDOCS\Core\Plugins\Fusion\Settings\REDList\[LogonUser]\HOWARDBH
Answered 09/09/2009 by: captain_planet
Second Degree Brown Belt

Please log in to comment
0
Good catch, Cap'n, thank you.
Answered 09/09/2009 by: VBScab
Red Belt

Please log in to comment
0
[LogonUser] is right. Does work with my script, too.

Cheers
Answered 09/09/2009 by: McRip
Orange Senior Belt

Please log in to comment
0
right. Does work with my script, too.

Still testing here.... but it looks good.

Jimm
Answered 09/09/2009 by: JimmPanik
Orange Belt

Please log in to comment
0
If you're still having problems, here's something else to consider. If the GPO is deployed at machine startup rather than at user logon, then there's no current user at this point. The installation will have completed prior to any user logging in. So the installation is trying to access a registry hive (HKCU) and an environment variable (USERNAME) that haven't been defined yet. That's also why the package works perfectly well when you run it while logged in, there exists at this point a Current User with an HKCU registry hive and a defined USERNAME environment variable.
Answered 09/09/2009 by: davidkevanian
Senior Yellow Belt

Please log in to comment
0
Worked perfectly. Thanks for the assistance. Any ideas why %USERNAME worked originally then stopped? I ran it that way in my testing probably a dozen times.
Answered 09/09/2009 by: JimmPanik
Orange Belt

Please log in to comment
0
Any ideas why %USERNAME worked originally then stopped?

you mean %USERNAME% as a property not %USERNAME
Answered 09/09/2009 by: cygan
Fifth Degree Brown Belt

Please log in to comment
Answer this question or Comment on this question for clarity