Page 1 of 1

ASP.Net Core Read Registry

Posted: Tue Jun 09, 2020 10:48 am
by ngurram
Hi,
I am trying to use Read Registry for HKEY_LOCAL_MACHINE\SOFTWARE\dotnet\Setup\InstalledVersions\x64\sharedhost like below

Set Variable ASPNet to
Read Registry Key HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x64\sharedhost\Version into ASPNet
MessageBox: ReturnASPNet, $ASPNet$

But the return in the variable is always blank, even though I can see the registry for it on the box exists.
Has anyone else run into this issue? Help please?

Any help is much appreciated.

Re: ASP.Net Core Read Registry

Posted: Tue Jun 09, 2020 12:37 pm
by FrancescoT
Because I suppose you are checking such key on x64 target OS, are you switching to x64 mode before invoking the "Read Registry key" command?

Re: ASP.Net Core Read Registry

Posted: Tue Jun 09, 2020 3:15 pm
by ngurram
Thanks for the reply Francesco. Yes I am looking in x64 OS (Windows Server 2016 / 2019). I am not sure how I should switch to x64 mode though. Is this something to be done in IA?

Thanks

Re: ASP.Net Core Read Registry

Posted: Tue Jun 09, 2020 7:26 pm
by ngurram
I Googled it and I think I got it working. For anyone else who may run into this issue, below seem to work for me.

Set Variable ASPNet to
Set x64 - Native 64 bit Windows, AMD64, EM64T, and ARM64 Architectures - installation mode
Read Registry Key HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x64\sharedhost\Version into ASPNet

Re: ASP.Net Core Read Registry

Posted: Wed Apr 21, 2021 7:43 am
by mdavtec
Don't forget to set the mode back to 32 bit after reading the registry

Set Win32 - Native 32 bit Windows and Windows 32 on Windows 64 (WOW64) - installation mode