Exemplo n.º 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"));
        }
Exemplo n.º 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"));
        }
Exemplo n.º 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"));
        }
Exemplo n.º 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"));
        }