Closed nagilson closed 1 day ago
Tagging subscribers to this area: @vitek-karas, @agocke, @vsadov See info in area-owners.md if you want to be subscribed.
The InstallLocation
value is always written to the 32-bit registry:
https://github.com/dotnet/runtime/blob/e33be4d53ab951272c9161c50b549e5e7db60262/src/installer/pkg/sfx/installers/host.wxs#L35-L39
That is what the host uses when determining registered installs. It does not look under the 64-bit hive or at ...\sharedhost\Path
.
Or, Is this design / spec wrong and needs to be updated?
Added a clarification to the design doc: https://github.com/dotnet/designs/pull/325
WoW Node Missing Path Key
Looking at the setup authoring, the sharedhost\Path
key is used to add to the PATH
environment variable. It is only added for the native machine architecture, so will not exist in the WoW node / 32-bit hive on a 64-bit machine.
https://github.com/dotnet/runtime/blob/e33be4d53ab951272c9161c50b549e5e7db60262/src/installer/pkg/sfx/installers/host.wxs#L41-L55
dotnet --info
says there is an x86 dotnet registered atInstallLocation
, but that doesn't exist on my registry
Can you check the 32-bit view?
Can you check the 32-bit view?
Aha, thank you -- they are under the node here!
I assume it's also under the 32-bit view on arm64, but I'll verify that with a VM.
Looking at the setup authoring, the sharedhost\Path key is used to add to the PATH environment variable. It is only added for the native machine architecture, so will not exist in the WoW node / 32-bit hive on a 64-bit machine.
Awesome, that's super helpful to know as well. My understanding, then, is that InstallLocation
stores all of the possible installs, and the sharedhost\Path
key is used for PATH
lookup / should theoretically be the default host when calling dotnet on the terminal.
Knowing that will always be in that location is great.
This was super helpful. Thank you. I think updating the doc is good, so I'll add that tag to this issue.
Description
sharedhost has Path but InstallLocation does not, and does not exist
My understanding based on this spec is that the registry should contain a path key to the dotnet host. I looked at my registry to see if that was valid. I was able to find a Path key under a location very similar to what the spec stated, but it was in
sharedhost
, which seems to be inconsistent with the design decision determined in https://github.com/dotnet/designs/blob/main/accepted/2021/install-location-per-architecture.md#:~:text=On%20Windows%20the,arch%3E%5CInstallLocation, whereInstallLocation
is mentioned as the place in which the install location is stored.On my machine, this is stored in
sharedhost
, notInstallLocation
. My machine is Win 11 and x64.https://github.com/dotnet/runtime/blob/e33be4d53ab951272c9161c50b549e5e7db60262/src/installer/pkg/sfx/installers/dotnet-host.proj#L11
That seems to be what the code does as well. I didn't see any reference to InstallLocation as mentioned in the doc. I also didnt see a new doc describing this
sharedhost
behavior. Is that expected? Or, Is this design / spec wrong and needs to be updated? Or am I confused and this Path key is for something else, and there never was a place where the path to .NET is marked in the registry?WoW Node Missing Path Key
There is also information that can be put in the Wow Node. For this information, it doesn't appear to have a
Path
key? Is that expected?Registry Inconsistency with
--info
Here's another interesting observation. My 9.0.0-preview.7.24405.7 host running
dotnet --info
says there is an x86 dotnet registered atInstallLocation
, but that doesn't exist on my registry. It's got asharedhost
key, though. The registry above showshostfxr
under theInstalledVersions
node and some other installation information which is good, but none of those seem to store the path. IsInstalledVersions
a placeholder text, then, and substitutable forhostfxr
,sharedhost
, etc?cc @elinor-fung @richlander
Reproduction Steps
Install .NET 9 or .NET 8 preview host on various machines and observe regedit behavior can be different. Install the .NET 9 host and see sharedhost is used instead of InstallLocation.
Expected behavior
Should it not be in
InstallLocation
?Actual behavior
See above.
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response