コード例 #1
0
        public static ActionResult CaActiveSetup_RemoveHKCU(Session session)
        {
            Action action = () =>
            {
                var registryAbstractor = new RegAbs(session);

                //Set the Active Setup ot IsInstalled = 0 and change the StubPath
                var caParams = CustActParameters.ExtractFromSession(session);
                registryAbstractor.DeleteHkcuKey(caParams.RegistrySubKey);
            };

            var runner = new CustActRunner(session);

            return(runner.RunAction(action, "CaActiveSetup_RemoveHKCU"));
        }
コード例 #2
0
        public static ActionResult CaActiveSetup_SetHKLM(Session session)
        {
            Action action = () =>
            {
                var registryAbstractor = new RegAbs(session);
                var caParams           = CustActParameters.ExtractFromSession(session);

                //install the active setup that will set the OPEN key.
                using (RegistryKey hklmKey = registryAbstractor.OpenOrCreateHklmKey(caParams.RegistrySubKey))
                {
                    UpdateActiveSetupHklmKey(hklmKey, caParams.Default, caParams.CreateComponentId, caParams.CreateCommand, caParams.RemoveCommand, caParams.Version, true);
                }
            };

            var runner = new CustActRunner(session);

            return(runner.RunAction(action, "CaActiveSetup_SetHKLM"));
        }
コード例 #3
0
        public static ActionResult CaActiveSetup_SetHKCU(Session session)
        {
            Action action = () =>
            {
                var registryAbstractor = new RegAbs(session);

                //Set the Active Setup ot IsInstalled = 0 and change the StubPath
                var caParams = CustActParameters.ExtractFromSession(session);
                using (RegistryKey hkcuKey = registryAbstractor.OpenOrCreateHkcuKey(caParams.RegistrySubKey))
                {
                    UpdateHkcuActiveSetupKey(hkcuKey, caParams.Version);
                }
            };

            var runner = new CustActRunner(session);

            return(runner.RunAction(action, "CaActiveSetup_SetHKCU"));
        }
コード例 #4
0
        public static ActionResult CaActiveSetup_RemoveHKLM(Session session)
        {
            Action action = () =>
            {
                var registryAbstractor = new RegAbs(session);

                //Set the Active Setup ot IsInstalled = 0 and change the StubPath
                var caParams = CustActParameters.ExtractFromSession(session);
                using (RegistryKey createHklmKey = registryAbstractor.OpenOrCreateHklmKey(caParams.RegistrySubKey))
                {
                    UpdateActiveSetupHklmKey(createHklmKey, caParams.Default, caParams.CreateComponentId,
                                             caParams.CreateCommand, caParams.RemoveCommand, caParams.Version, false);
                }
            };

            var runner = new CustActRunner(session);

            return(runner.RunAction(action, "CaActiveSetup_RemoveHKLM"));
        }