Visual Studio Setup Project - Per User Registry Settings

I'm attempting to keep a Setup Project in Visual Studio 2003 (of course, it's a heritage application). The trouble we contend the minute is that we require to write registry access to HKCU for every single customer on the computer system. They require to be in the HKCU as opposed to HKLM due to the fact that they are the default customer setups, and also they do transform per customer. My sensation is that

  1. This isn't feasible
  2. This isn't something the installer should be doing, yet something the application should be doing (nevertheless what takes place when a customer account is developed after the install?).

With that said in mind, I still intend to transform just feasible in the application, so my inquiry is, is it feasible to add registry access for every single customer in a Visual Studio 2003 arrangement task?

And also, presently the task details 5 registry origin keys (HKEY_CLASSES_ROOT, HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE, HKEY_USERS, and also User/Machine Hive). I do not actually recognize anything concerning the Users root key, and also have not seen User/Machine Hive. Can any person inform me on what they are? Probably they can address my trouble over.

2019-05-03 18:06:42
Source Share
Answers: 4

First : Yes, this is something that belongs in the Application for the specific reson you defined : What takes place after new customer accounts are developed? Certain, if you're making use of a domain name it's feasible to have actually some things placed in the registry on production, yet this is not actually an usage instance. The Application needs to examine if there are seetings and also make use of the default setups otherwise.

That being claimed, it IS feasible to transform various other customers Keys via the HKEY_USERS Hive.

I have no experience with the Visual Studio 2003 Setup Project, so below is a little (entirely unconnected ) VBScript code that could simply offer you a suggestion where to look :

const HKEY_USERS = &H80000003
strComputer = "."
Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = ""
objReg.EnumKey HKEY_USERS, strKeyPath, arrSubKeys
strKeyPath = "\Software\Microsoft\Windows\CurrentVersion\WinTrust\Trust Providers\Software Publishing"
For Each subkey In arrSubKeys
    objReg.SetDWORDValue HKEY_USERS, subkey & strKeyPath, "State", 146944

(Code Courtesy of Jeroen Ritmeijer )

2019-05-07 20:02:47

I'm presuming that due to the fact that you intend to set it for all users, that you're on some sort of shared computer system, which is possibly running under a domain name?


Let's say Joe and also Jane consistently log onto the computer system, after that they will certainly each have 'computer system registries'.

You'll after that install your application, and also the installer will certainly use large hacks and also horrible points to set things under HKCU for them.

AFTER THAT, bob will certainly come and also browse through (he, and also 500 other individuals have accounts in the domain name therefore can do this ). He's never ever utilized this computer system prior to, so he has no registry. The very first time he visits, windows develops him one, yet he will not have your setup.

Your application after that tips over or acts inaccurately, and also bob whines noisally concerning those bad items from raynixon included.

The proper solution is to simply have some default setups in your application, which can write them to the registry if it does not locate them. It's basic excellent technique that your application need to never ever rely on the registry, and also need to create points as required, for any kind of registry access, not simply HKCU, anyhow

2019-05-07 19:56:40

Despite what the MSDN article Archive of MSDN Article claims concerning User/Machine Hive, it does not contact HKEY_USERS. Instead it contacts HKCU if you select Just Me and also HKLM if you select every person.

So my remedy is mosting likely to be to make use of the User/Machine Hive, and afterwards in the application it examines if the registry access remain in HKCU and also otherwise, duplicates them from HKLM. I recognize this possibly isn't one of the most excellent means of doing it, yet it has the least quantity of adjustments.

2019-05-07 16:32:47

I'm partway to my remedy with this access on MSDN (do not recognize just how I could not locate it prior to ).

User/Machine Hive
Subkeys and also values gotten in under this hive will certainly be mounted under the HKEY_CURRENT_USER hive when a customer picks "Just Me" or the HKEY_USERS hive or when a customer picks "Everyone" throughout installation.

Registry Editor Archive of MSDN Article

2019-05-07 16:30:37