Writing to HKEY_USERS/.DEFAULT
Hi all,
I asked this question a while back somewhere and I believe there were some pitfalls, but I'm wondering....
Instead of writing user specific values to HKCU, why instead couldn't I write them to HKEY_USERS/.DEFAULT? That way, they would be available for non-installing users that log on and run our app. Windows Installer wouldn't kick off a repair if one of the keys previously written to HKCU was a component key. At least that is how I think it would work.
My goal would be to move away from having repair run for non-installing users. Are app needs some stuff in HKCU and we're hesitant to move them to HKLM with stricter security on more recent OSs.
When I got a reply last time (I think it was an old post in a Wise forum when we used that product.) it wasn't so much that there were pitfall mentioned, I don't think, but it wasn't a common practice. I think that was the jist of the reply, but it was way back.
Just wondering if anyone undertakes this practice. I posted this same inquiry at Flexerasoftware/InstallShield as well. Sorry if you see both. [:-]
Any information or tips would be greatly appreciated.
I asked this question a while back somewhere and I believe there were some pitfalls, but I'm wondering....
Instead of writing user specific values to HKCU, why instead couldn't I write them to HKEY_USERS/.DEFAULT? That way, they would be available for non-installing users that log on and run our app. Windows Installer wouldn't kick off a repair if one of the keys previously written to HKCU was a component key. At least that is how I think it would work.
My goal would be to move away from having repair run for non-installing users. Are app needs some stuff in HKCU and we're hesitant to move them to HKLM with stricter security on more recent OSs.
When I got a reply last time (I think it was an old post in a Wise forum when we used that product.) it wasn't so much that there were pitfall mentioned, I don't think, but it wasn't a common practice. I think that was the jist of the reply, but it was way back.
Just wondering if anyone undertakes this practice. I posted this same inquiry at Flexerasoftware/InstallShield as well. Sorry if you see both. [:-]
Any information or tips would be greatly appreciated.
0 Comments
[ + ] Show comments
Answers (8)
Please log in to answer
Posted by:
i@mJonny
9 years ago
Hi, I don't know if the issue's resolved (or even what platform you're on), but this (Toussaint OTTAVI's Win7 ProfileTool) may prove to be of interest
Blurb:
With the good old Windows XP, there was a feature called "copy profile". You just had to define your standard settings just like a standard user would do, then copy this user profile into the "default user" profile, so that all the future users of the machine will get all your settings automatically.
Unfortunately, Microsoft removed this feature in Windows 7. Don't try to understand why. The official answer is : "You should not use the copy profile feature, you should use the deployment tools instead". This is a very common behavior from this company. Microsoft usually tries to impose their vision of things instead of proposing it.
Of course, Microsoft proposes a lot of tools / features to achieve the same goal. Among them : SysPrep, Group Policies, Logon scripts. All these are complex tools, that suit complex needs, if you have several hundreds of machines, and maybe several hundreds of hours to spend. But none of them can do simple things, such as setting up quickly a few machines.
That's the reason why I decided to write this tool.
Posted by:
habeebtc
10 years ago
Posted by:
dyehardfan
13 years ago
I use the following script to do something similar to what you are talking about:
This being the portion that loads the hive you're referencing:
'Load the Default User profile registry hive
objWshShell.Run ("reg.exe load HKEY_USERS\CustomizeDefaultUserProfile """ & strUserProfilesDefaultFolder & "Default User\NTuser.dat"""), 0, True
dim strAllUsersDesktopPath, strUserProfilesDefaultFolder, strUserProfilesAdminFolder, strFileExt, strSharWiz, strCheckBox
dim objWshShell
Set objWshShell = WScript.CreateObject("WScript.Shell")
strAllUsersDesktopPath = objWshShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Common Desktop")
' Attempts to configure Windows 2000/XP paths.
strUserProfilesDefaultFolder = Mid(strAllUsersDesktopPath,1,InStr(strAllUsersDesktopPath, "\All Users"))
If strUserProfilesDefaultFolder = "" Then
' Attempts to configure Windows Vista/7 paths.
strUserProfilesDefaultFolder = Mid(strAllUsersDesktopPath,1,InStr(strAllUsersDesktopPath, "\Public"))
End If
'Load the Default User profile registry hive
objWshShell.Run ("reg.exe load HKEY_USERS\CustomizeDefaultUserProfile """ & strUserProfilesDefaultFolder & "Default User\NTuser.dat"""), 0, True
'Set the registry key to turn off the Hidden File Extension folder option
objWshShell.RegWrite "HKEY_USERS\CustomizeDefaultUserProfile\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\HideFileExt", "0","REG_DWORD"
'Set the registry key to turn off the Sharing Wizard folder option
objWshShell.RegWrite "HKEY_USERS\CustomizeDefaultUserProfile\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\SharingWizardOn", "0","REG_DWORD"
'Set the registry key to turn off Use Check Boxes to Select Items
objWshShell.RegWrite "HKEY_USERS\CustomizeDefaultUserProfile\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\AutoCheckSelect", "0","REG_DWORD"
'Set the registry key to remove Default Programs from the Start Menu
objWshShell.RegWrite "HKEY_USERS\CustomizeDefaultUserProfile\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Start_ShowSetProgramAccessAndDefaults", "0","REG_DWORD"
'Set the registry key to Show Recent Documents in the Start Menu
objWshShell.RegWrite "HKEY_USERS\CustomizeDefaultUserProfile\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Start_ShowRecentDocs", "1","REG_DWORD"
'Set the registry key to Hide My Music from the Start Menu
objWshShell.RegWrite "HKEY_USERS\CustomizeDefaultUserProfile\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Start_ShowMyMusic", "0","REG_DWORD"
'Set the registry key to Hide My Games from the Start Menu
objWshShell.RegWrite "HKEY_USERS\CustomizeDefaultUserProfile\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Start_ShowMyGames", "0","REG_DWORD"
'Set the registry key to Show Downloads on the Start Menu
objWshShell.RegWrite "HKEY_USERS\CustomizeDefaultUserProfile\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Start_ShowDownloads", "0","REG_DWORD"
'Set the registry key to Hide My Pictures from the Start Menu
objWshShell.RegWrite "HKEY_USERS\CustomizeDefaultUserProfile\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Start_ShowMyPics", "0","REG_DWORD"
'Set the Control Panel View to Small Icons
objWshShell.RegWrite "HKEY_USERS\CustomizeDefaultUserProfile\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel\StartupPage", "1","REG_DWORD"
'Show My Computer on All User's Desktop
objWshShell.RegWrite "HKEY_USERS\CustomizeDefaultUserProfile\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel\{20D04FE0-3AEA-1069-A2D8-08002B30309D}", "0","REG_DWORD"
'Show On Screen Keyboard on Right Side of Screen
objWshShell.RegWrite "HKEY_USERS\CustomizeDefaultUserProfile\Software\Microsoft\TabletTip\1.7\EdgeTargetOnLeft", "0","REG_DWORD"
'Unload the Default User profile registry hive
objWshShell.Run ("reg.exe unload HKEY_USERS\CustomizeDefaultUserProfile"), 0, True
'Make Changes to the Installation (Administrator) Account
'Set the registry key to turn off the Hidden File Extension folder option
objWshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\HideFileExt", "0","REG_DWORD"
'Set the registry key to turn off the Hidden File Extension folder option
objWshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\HideFileExt", "0","REG_DWORD"
'Set the registry key to turn off the Sharing Wizard folder option
objWshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\SharingWizardOn", "0","REG_DWORD"
'Set the registry key to turn off Use Check Boxes to Select Items
objWshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\AutoCheckSelect", "0","REG_DWORD"
'Set the registry key to Show Downloads on the Start Menu
objWshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Start_ShowDownloads", "0","REG_DWORD"
'Set the registry key to Hide My Pictures from the Start Menu
objWshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Start_ShowMyPics", "0","REG_DWORD"
'Set the Control Panel View to Small Icons
objWshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel\StartupPage", "1","REG_DWORD"
'Show My Computer on Desktop
objWshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel\{20D04FE0-3AEA-1069-A2D8-08002B30309D}", "0","REG_DWORD"
'Show On Screen Keyboard on Right Side of Screen
objWshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\TabletTip\1.7\EdgeTargetOnLeft", "0","REG_DWORD"
This being the portion that loads the hive you're referencing:
'Load the Default User profile registry hive
objWshShell.Run ("reg.exe load HKEY_USERS\CustomizeDefaultUserProfile """ & strUserProfilesDefaultFolder & "Default User\NTuser.dat"""), 0, True
Posted by:
anonymous_9363
13 years ago
Posted by:
Superfreak3
13 years ago
Yes, I was pointed to an Active Setup post here on AppDeplooy. I'm a bit confused with it though. Is it just a way to side-step or an alternative to having Windows Installer just run the repair visibly?
My app currently is launched from an Advertised Shortcut so I'm wondering, if Active Setup is deemed a good approach, if I would have to change the shorcut back to a non-advertised shortcut.
Or, is this how the whole thing works... User logs in, the two registry entries are compared, if needed a repair is run. After this, the user then could launch from whatever type of shortcut and and all HKCU keys will be in place so another repair wouldn't be fired. If this is how it works, I would think this might enongate the login time a bit.
I also read that you could fire off an .exe installed with the product instead of doing a full repair. If this is possible I would think it might be quicker than a full repair -> exe to just directly write the registry stuff needed. What context would this be running in at this point?
There were some posts on flexerasoftware regarding alternatives and one of them was to write a Custom Action to push user 'stuff' to each individual profile/HKCU area. That could work, if its possible, but I would have to hunt down some code samples to do that. I guess I could then fire that off in system context.
An uninstall action would then be needed to clean up everything not meant to be permanent.
The only user specific stuff we have is some registry keys and a folder that is created in the users profile. This directory contains a desktop.ini file to display an icon folder.
Any points to some code is greatly appreciated!
My app currently is launched from an Advertised Shortcut so I'm wondering, if Active Setup is deemed a good approach, if I would have to change the shorcut back to a non-advertised shortcut.
Or, is this how the whole thing works... User logs in, the two registry entries are compared, if needed a repair is run. After this, the user then could launch from whatever type of shortcut and and all HKCU keys will be in place so another repair wouldn't be fired. If this is how it works, I would think this might enongate the login time a bit.
I also read that you could fire off an .exe installed with the product instead of doing a full repair. If this is possible I would think it might be quicker than a full repair -> exe to just directly write the registry stuff needed. What context would this be running in at this point?
There were some posts on flexerasoftware regarding alternatives and one of them was to write a Custom Action to push user 'stuff' to each individual profile/HKCU area. That could work, if its possible, but I would have to hunt down some code samples to do that. I guess I could then fire that off in system context.
An uninstall action would then be needed to clean up everything not meant to be permanent.
The only user specific stuff we have is some registry keys and a folder that is created in the users profile. This directory contains a desktop.ini file to display an icon folder.
Any points to some code is greatly appreciated!
Posted by:
anonymous_9363
13 years ago
Posted by:
Superfreak3
13 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.