Registry.GetValue always return null

The statement of Jason is right, the operating system is the problem, the below code will help you to resolve. RegistryKey localKey; if(Environment.Is64BitOperatingSystem) localKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64); else localKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32); string value = localKey.OpenSubKey(“RSA”).GetValue(“WebExControlManagerPth”).ToString();

How to associate application with existing file types using WiX installer?

Here’s a full, complete example with a bit more detail and cleaner code than in the linked question and should provide a better answer. Quite timely as I’ve recently finished porting the code posted previously, to use proper ProgId elements so this is fresh in my mind 😉 In regards to the ‘what here’, you … Read more

Set icon for custom right-click context menu item for all desktop shortcuts (windows explorer)

For Windows 7 & 8 & 10 Add custom item to Context Menu: Sublime Text 3 Path to the application: C:\Program Files\Sublime Text 3\sublime_text.exe. Run regedit.exe (or press Windows Start Button & type: regedit) Goto: HKEY_CLASSES_ROOT\\*\shell (* is right at the top) Right_mouse_click shell in left panel for options to create a new Key: New … Read more

How to add Python to Windows registry

I faced to the same problem. I solved it by navigate to HKEY_CURRENT_USER\Software\Python\PythonCore\3.4\InstallPath and edit the default key with the output of C:\> where python.exe command. navigate to HKEY_CURRENT_USER\Software\Python\PythonCore\3.4\InstallPath\InstallGroup and edit the default key with Python 3.4 Note: My python version is 3.4 and you need to replace 3.4 with your python version. Normally you … Read more

WiX will not add HKLM registry setting during Windows 7 install

I have figured out why this is happening. With the WiX installer being compiled on a x86 platform, Windows 7 picked it up as the 32-bit installer with 32-bit registry keys. Windows 7 64-bit handles 32-bit registry entries by doing just what I saw happening. The program was still registered; it was just not in the … Read more

Registry.LocalMachine.OpenSubKey() returns null

It can happen if you are on a 64-bit machine. Create a helper class first (requires .NET 4.0 or later): public class RegistryHelpers { public static RegistryKey GetRegistryKey() { return GetRegistryKey(null); } public static RegistryKey GetRegistryKey(string keyPath) { RegistryKey localMachineRegistry = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, Environment.Is64BitOperatingSystem ? RegistryView.Registry64 : RegistryView.Registry32); return string.IsNullOrEmpty(keyPath) ? localMachineRegistry : localMachineRegistry.OpenSubKey(keyPath); } public … Read more

tech