Exemple #1
0
        private ComponentTask SetRegistry_ScheduleResolutionSetter()
        {
            bool runOnce = true;

            RegistryUtil.StartupRegistryHives startupRegistryHive = RegistryUtil.StartupRegistryHives.CURRENT_USER;
            string registryKeyValueName = "TBInstaller_SetResolution";

            CLICommand sleepCommand = new CLICommand
            {
                Program = "sleep"
            };

            sleepCommand.Options.Add(new CommandOption("3"));

            CLICommand qresCommand = CMDCommands.QRes(SetupProperties.DisplayWidth, SetupProperties.DisplayHeight);

            CLICommand taskkillCommand = CMDCommands.TaskKill("explorer.exe");

            CLICommand startCommand = CMDCommands.Start("explorer.exe");

            CLICommand[] commands = new CLICommand[] { sleepCommand, qresCommand, taskkillCommand, startCommand };

            StringComparison validationStringComparison = StringComparison.OrdinalIgnoreCase;

            return(ComponentTaskPresets.SetRegistryRunCommand(
                       runOnce,
                       startupRegistryHive,
                       registryKeyValueName,
                       commands,
                       validationStringComparison));
        }
Exemple #2
0
        private ComponentTask SetRegistry_ScheduleWindowsTempFolderFilesCleanup()
        {
            bool runOnce = true;

            RegistryUtil.StartupRegistryHives startupRegistryHive = RegistryUtil.StartupRegistryHives.LOCAL_MACHINE;
            string registryKeyValueName = "TBInstallerCleanup_WindowsTempFolderFiles";

            bool   force = true;
            bool   deleteFromSubfolders = true;
            bool   quiet    = true;
            string filePath = StringUtil.DQuote(@"C:\Windows\Temp\*");

            CLICommand command =
                CMDCommands.Del(
                    force,
                    deleteFromSubfolders,
                    quiet,
                    filePath);

            StringComparison validationStringComparison = StringComparison.OrdinalIgnoreCase;

            return(ComponentTaskPresets.SetRegistryRunCommand(
                       runOnce,
                       startupRegistryHive,
                       registryKeyValueName,
                       command,
                       validationStringComparison));
        }
Exemple #3
0
        private ComponentTask SetRegistry_ScheduleWindowsTempFolderFoldersCleanup()
        {
            bool runOnce = true;

            RegistryUtil.StartupRegistryHives startupRegistryHive = RegistryUtil.StartupRegistryHives.LOCAL_MACHINE;
            string registryKeyValueName = "TBInstallerCleanup_WindowsTempFolderFolders";

            CMDForLoopCommand command = new CMDForLoopCommand();

            command.ForSwitch     = new CommandOption("/", "d");
            command.LoopParameter = "%x";
            command.InParameter   = StringUtil.DQuote(@"C:\Windows\Temp\*");

            CLICommand loopedCommand = new CLICommand();

            loopedCommand.Program = "@rd";
            loopedCommand.Options.Add(new CommandOption("/", "s"));
            loopedCommand.Options.Add(new CommandOption("/", "q"));
            loopedCommand.Options.Add(new CommandOption(StringUtil.DQuote("%x")));

            command.LoopedCommand = loopedCommand;

            StringComparison validationStringComparison = StringComparison.OrdinalIgnoreCase;

            return(ComponentTaskPresets.SetRegistryRunCommand(
                       runOnce,
                       startupRegistryHive,
                       registryKeyValueName,
                       command,
                       validationStringComparison));
        }
Exemple #4
0
        private ComponentTask SetRegistry_ScheduleTBInstallerDeletion()
        {
            bool runOnce = true;

            RegistryUtil.StartupRegistryHives startupRegistryHive = RegistryUtil.StartupRegistryHives.LOCAL_MACHINE;
            string registryKeyValueName = "TBInstallerCleanup_DeleteInstaller";

            bool   force = true;
            bool   deleteFromSubfolders = false;
            bool   quiet    = true;
            string filePath = StringUtil.DQuote(Path.Combine(SystemPathConstants.StartupPath, "FirstSetup.exe"));

            CLICommand command =
                CMDCommands.Del(
                    force,
                    deleteFromSubfolders,
                    quiet,
                    filePath);

            StringComparison validationStringComparison = StringComparison.OrdinalIgnoreCase;

            return(ComponentTaskPresets.SetRegistryRunCommand(
                       runOnce,
                       startupRegistryHive,
                       registryKeyValueName,
                       command,
                       validationStringComparison));
        }
Exemple #5
0
        private ComponentTask JavaX86Installation()
        {
            Func <bool> isChocoInstalled =
                () => ChocoUtil.IsChocoInstalled();

            /* Update to use non-default argument list to specifically get x86 version */
            Action installJavaX86 =
                () => ComponentTaskPresets.InstallWithChoco(Architectures.X86, "Java 8 (32-bit)", "jre8", "Java 8 Update *$", false);

            Func <bool> isX86Java8Installed =
                () => JavaInstallUtil.IsJavaInstalled(Architectures.X86, 8);

            return(new ComponentTask(
                       new SetupTask(
                           isChocoInstalled,
                           installJavaX86,
                           isX86Java8Installed,
                           false),
                       null));
        }
Exemple #6
0
        private ComponentTask SetRegistry_ScheduleTBInstallerExecutionFolderDeletion()
        {
            bool runOnce = true;

            RegistryUtil.StartupRegistryHives startupRegistryHive = RegistryUtil.StartupRegistryHives.LOCAL_MACHINE;
            string registryKeyValueName = "TBInstallerCleanup_ScriptFolder";

            CLICommand command = new CLICommand();

            command.Program = "rmdir";
            command.Options.Add(new CommandOption("/", "s"));
            command.Options.Add(new CommandOption("/", "q"));
            command.Options.Add(new CommandOption(StringUtil.DQuote(SetupProperties.ExecutionPath)));

            StringComparison validationStringComparison = StringComparison.OrdinalIgnoreCase;

            return(ComponentTaskPresets.SetRegistryRunCommand(
                       runOnce,
                       startupRegistryHive,
                       registryKeyValueName,
                       command,
                       validationStringComparison));
        }
Exemple #7
0
        private ComponentTask SetRegistry_ScheduleChocolateyLocalTempFolderCleanup()
        {
            bool runOnce = false;

            RegistryUtil.StartupRegistryHives startupRegistryHive = RegistryUtil.StartupRegistryHives.LOCAL_MACHINE;
            string registryKeyValueName = "TBInstallerCleanup_ChocolateyLocalTempFolder";

            CLICommand command = new CLICommand();

            command.Program = "rmdir";
            command.Options.Add(new CommandOption("/", "s"));
            command.Options.Add(new CommandOption("/", "q"));
            command.Options.Add(new CommandOption(StringUtil.DQuote(ChocoUtil.ChocolateyLocalTemp)));

            StringComparison validationStringComparison = StringComparison.OrdinalIgnoreCase;

            return(ComponentTaskPresets.SetRegistryRunCommand(
                       runOnce,
                       startupRegistryHive,
                       registryKeyValueName,
                       command,
                       validationStringComparison));
        }
Exemple #8
0
 private ComponentTask PinFirefoxToTaskbar()
 {
     return(ComponentTaskPresets.PinProgramOrShortcutToTaskbar(@"C:\Program Files\Mozilla Firefox\firefox.exe"));
 }
Exemple #9
0
 private ComponentTask FirefoxInstallation()
 {
     return(ComponentTaskPresets.InstallWithChoco(Architectures.X64, "Mozilla Firefox", "firefox", "Mozilla Firefox * (x64 *)", false));
 }
Exemple #10
0
 private ComponentTask WinRARInstallation()
 {
     return(ComponentTaskPresets.InstallWithChoco(Architectures.X64, "WinRAR", "winrar", "WinRAR *.** (64-bit)", false));
 }
Exemple #11
0
 private ComponentTask VMWareToolsInstallation()
 {
     return(ComponentTaskPresets.InstallWithChoco(Architectures.X64, "VMWare Tools", "vmware-tools", "VMWare Tools", false));
 }
Exemple #12
0
 private ComponentTask JavaX64Installation()
 {
     /* Update to use non-default argument list to specifically get x64 version */
     return(ComponentTaskPresets.InstallWithChoco(Architectures.X64, "Java 8 (64-bit)", "jre8", "Java 8 Update * (64-bit)", false));
 }
Exemple #13
0
 private ComponentTask TeamViewerInstallation()
 {
     return(ComponentTaskPresets.InstallWithChoco(Architectures.X86, "TeamViewer", "teamviewer", "TeamViewer **$", false));
 }