コード例 #1
0
        ChromiumRegistryInfo IChromiumUpdateEngine.GetChromiumRegistryInfo()
        {
            /*
             * REGEDIT4
             *
             * [HKEY_CURRENT_USER\Software\Chromium]
             * "name"="Chromium"
             * "pv"="5.0.348.0"
             * "InstallerError"=dword:00000002
             * "InstallerSuccessLaunchCmdLine"="\"C:\\Users\\WaSyL\\AppData\\Local\\Chromium\\Application\\chrome.exe\""
             * "usagestats"=dword:00000000
             * "lastrun"="12912477732511850"
             * "InstallerResult"=dword:00000000
             */
            ChromiumRegistryInfo chromiumRegistryInfo = null;

            using (var key = Registry.CurrentUser.OpenSubKey(ChromiumUpdateEngine.ChromiumRegistryKey, false))
            {
                if (key != null)
                {
                    chromiumRegistryInfo = new ChromiumRegistryInfo()
                    {
                        InstallerError  = (int)key.GetValue("InstallerError", 0),
                        InstallerResult = (int)key.GetValue("InstallerResult", 0),
                        InstallerSuccessLaunchCmdLine = (String)key.GetValue("InstallerSuccessLaunchCmdLine", String.Empty),
                        LastRun       = (String)key.GetValue("lastrun", String.Empty),
                        Name          = (String)key.GetValue("name", String.Empty),
                        VersionString = (String)key.GetValue("pv", String.Empty)
                    };
                }
            }
            return(chromiumRegistryInfo);
        }
コード例 #2
0
        ChromiumRegistryInfo IChromiumUpdateEngine.GetChromiumRegistryInfo()
        {
            /*
              REGEDIT4

             [HKEY_CURRENT_USER\Software\Chromium]
             "name"="Chromium"
             "pv"="5.0.348.0"
             "InstallerError"=dword:00000002
             "InstallerSuccessLaunchCmdLine"="\"C:\\Users\\WaSyL\\AppData\\Local\\Chromium\\Application\\chrome.exe\""
             "usagestats"=dword:00000000
             "lastrun"="12912477732511850"
             "InstallerResult"=dword:00000000
              */
             ChromiumRegistryInfo chromiumRegistryInfo = null;
             using (var key = Registry.CurrentUser.OpenSubKey(ChromiumUpdateEngine.ChromiumRegistryKey, false))
             {
                 if (key != null)
                 {
                     chromiumRegistryInfo = new ChromiumRegistryInfo()
                     {
                        InstallerError = (int)key.GetValue("InstallerError", 0),
                        InstallerResult = (int)key.GetValue("InstallerResult", 0),
                        InstallerSuccessLaunchCmdLine = (String)key.GetValue("InstallerSuccessLaunchCmdLine", String.Empty),
                        LastRun = (String)key.GetValue("lastrun", String.Empty),
                        Name = (String)key.GetValue("name", String.Empty),
                        VersionString = (String)key.GetValue("pv", String.Empty)
                     };
                 }
             }
             return chromiumRegistryInfo;
        }