示例#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"));
        }