64-bitowy rejestr maszyn SetValue

Chcę ustawić wartość „NoModify” w ścieżce rejestru poniżej. „HKEY_LOCAL_MACHINE OPROGRAMOWANIE Microsoft Windows CurrentVersion Odinstaluj XXXX”

Używam poniższego kodu i działa on tylko na maszynach X86. Czy widzisz jakiś powód, dla którego nie działa to dla maszyn x64?

// This value is correct
RegistryView registryView = releaseFlags.Contains("PLATFORM_X86") ? RegistryView.Registry64 : RegistryView.Registry32;

    using (RegistryKey hkeyLocalMachine = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, registryView))
    {
        RegistryKey noModifyKey = hkeyLocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{xxxx}", true); //SL: Key Name

        if (noModifyKey != null)
        {
            noModifyKey.SetValue("NoModify", 0);
            noModifyKey.Flush();
        }
    }

questionAnswers(3)

yourAnswerToTheQuestion