Unable to read registry key in Vista...
I am using the follow code in my app and it works fine in XP however when the app is run on Vista is returns no value, I'm not sure what is wrong...
Code:
Dim MISInstallPath As String = ""
MISInstallPath = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\Software\MyCompany\MySoftware", "Path", Nothing)
Thanks
Simon
Re: Unable to read registry key in Vista...
I would say it is either because that registry value does not exist or it is because of the new security features in Vista. If you go into your Project properties and click the Application tab, there should be a button labelled View UAC Settings (not sure if this button appears if you are not developing on a Vista machine though..). If you click that then it will take you to the app.manifest file which is where you can change settings that dictate whether or not registry virtualisation is used etc.
This is what is in the app.manifest file by default:
Quote:
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC Manifest Options
If you want to change the Windows User Account Control level replace the
requestedExecutionLevel node with one of the following.
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
If you want to utilize File and Registry Virtualization for backward
compatibility then delete the requestedExecutionLevel node.
-->
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
</security>