Beispiel #1
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"));
        }
Beispiel #2
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"));
        }