public async Task <bool> DeployToDevice()
        {
            try
            {
                await deploy.SimplePSExecCommand(deploy.GetString("gk_client"), "Gatekeeper Client Install");

                await deploy.SimplePSExecCommand(deploy.GetString("gk_update"), "Gatekeeper Update Install");

                deploy.LogMessage("Applying Gatekeeper Registry Fix...");
                deploy.LogMessage("Starting remote session and invoking script...");

                var regFixCommand = GetRegFixCommand();

                if (await deploy.SimplePowerShellCommand(regFixCommand))
                {
                    deploy.LogMessage("GK Registry fix applied!");
                }
                else
                {
                    deploy.LogMessage("Failed to apply GK Registry fix!");
                    deploy.UserPrompt("Error occurred while executing command!", "Gatekeeper Deployment Error");
                    return(false);
                }

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
        public async Task <bool> DeployToDevice()
        {
            try
            {
                deploy.LogMessage("Installing VPN Client... (Remember to open client and set FCBDD Profile to 'Public')");
                await deploy.SimplePSExecCommand(deploy.GetString("vpn_install"), "VPN Client Install");

                return(true);
            }
            catch (Exception)
            {
                deploy.LogMessage("##### NOTE:  Errors are expected due to the installation causing the device to momentarily disconnect.");
                // Return true because errors are expected and we don't want to stop any proceeding deployments.
                return(true);
            }
        }
        public async Task <bool> DeployToDevice()
        {
            deploy.LogMessage("Enabling Local Admin Account...");
            deploy.LogMessage("Starting remote session and invoking commands...");

            if (await deploy.SimplePowerShellCommand(GetSetLocalAdminCommands()))
            {
                deploy.LogMessage("Local Admin enabled!");
            }
            else
            {
                deploy.LogMessage("Failed to enable local Admin!");
                deploy.UserPrompt("Error occurred while executing command!");
                return(false);
            }
            return(true);
        }
        public async Task <bool> DeployToDevice()
        {
            var filePush = deploy.NewFilePush(deploy.GetString("clickonce_cert"), @"\Temp\Deploy\ClickOnce\");

            deploy.LogMessage("Pushing files...");
            if (await filePush.StartCopy())
            {
                deploy.LogMessage("Push successful!");
                filePush.Dispose();
            }
            else
            {
                deploy.LogMessage("Push failed!");
                filePush.Dispose();
                return(false);
            }

            var certCommand = @"cmd /c certutil.exe -addstore root C:\Temp\Deploy\ClickOnce\trust.cer";

            deploy.LogMessage("Command: " + certCommand);
            if (await deploy.SimplePSExecCommand(certCommand, "Certificate Install"))
            {
                deploy.LogMessage("Certificate installed!");
            }
            else
            {
                deploy.LogMessage("Certificate install failed!");
                return(false);
            }

            var exitCode = await deploy.AdvancedPSExecCommand(deploy.GetString("clickonce_netruntimeinstall"), ".NET 4.7.1 Runtime Install");

            if (exitCode == 3010)
            {
                deploy.LogMessage("Install successful. **REBOOT REQUIRED!**");
            }
            else if (exitCode == 0)
            {
                deploy.LogMessage("Install successful!");
            }
            else
            {
                deploy.LogMessage(string.Format("Install failed! (Exit code: {0})", exitCode));
                return(false);
            }

            return(true);
        }
        public async Task <bool> DeployToDevice()
        {
            var filePush = deploy.NewFilePush(DeployDirectory(), InstallDirectory());

            deploy.LogMessage("Pushing files to target computer...");

            if (await filePush.StartCopy())
            {
                deploy.LogMessage("Push successful!");
                filePush.Dispose();
            }
            else
            {
                deploy.LogMessage("Push failed!");
                return(false);
            }

            deploy.LogMessage("Copying shortcut...");

            if (await deploy.SimplePSExecCommand(CopyShortcutCommand(), "Copy Shortcut"))
            {
                deploy.LogMessage("Copy shortcut successful!");
            }
            else
            {
                deploy.LogMessage("Copy shortcut failed!");
                return(false);
            }

            return(true);
        }
        public async Task <bool> DeployToDevice()
        {
            if (await deploy.SimplePSExecCommand(deploy.GetString("ghostscript_driver"), "Ghostscript PDF Driver Install"))
            {
                deploy.LogMessage("Ghostscript Driver Installed.");
            }
            else
            {
                deploy.LogMessage("Ghostscript Driver Install Failed!");
                return(false);
            }

            if (await deploy.SimplePSExecCommand(deploy.GetString("ghostscript_install"), "Ghostscript PDF Printer Install"))
            {
                deploy.LogMessage("Ghostscript PDF Printer Installed.");
            }
            else
            {
                deploy.LogMessage("Ghostscript PDF Printer Install Failed!");
                return(false);
            }

            return(true);
        }
        public async Task <bool> DeployToDevice()
        {
            try
            {
                string configFile = SelectConfigFile();

                if (string.IsNullOrEmpty(configFile))
                {
                    return(false);
                }

                deploy.LogMessage("Starting new Office 365 deployment to " + deploy.TargetHostname);
                deploy.LogMessage("Config = '" + deployFilesDirectory + "\\" + configFile + "'");
                deploy.LogMessage("-------------------");

                var filePush = deploy.NewFilePush(deployFilesDirectory, deployTempDirectory);

                deploy.LogMessage("Pushing files to target computer...");

                if (await filePush.StartCopy())
                {
                    deploy.LogMessage("Push successful!");
                    filePush.Dispose();
                }
                else
                {
                    deploy.LogMessage("Push failed!");
                    deploy.UserPrompt("Error occurred while pushing deployment files to device!");
                    return(false);
                }

                deploy.LogMessage("Removing previous Office installations...");

                deploy.LogMessage("Starting remote session and invoking scripts...");

                if (await deploy.SimplePowerShellCommand(GetRemovalCommands()))
                {
                    deploy.LogMessage("Previous Office installations removed.");
                }
                else
                {
                    deploy.LogMessage("Failed to remove previous installations!");
                    deploy.UserPrompt("Error occurred while executing deployment command!");
                    return(false);
                }

                var installCommand = GetO365InstallString(configFile);

                if (await deploy.SimplePSExecCommand(installCommand, "Office 365 Install"))
                {
                    deploy.LogMessage("Deployment complete!");
                }
                else
                {
                    deploy.LogMessage("Deployment failed!");
                    deploy.UserPrompt("Error occurred while executing deployment command!");
                    return(false);
                }

                deploy.LogMessage("Deleting temp files...");

                if (!await deploy.SimplePowerShellCommand(GetDeleteDirectoryCommand()))
                {
                    deploy.LogMessage("Delete failed!");
                    return(false);
                }

                deploy.LogMessage("Done.");
                deploy.LogMessage("-------------------");
                deploy.LogMessage("Office 365 deployment is complete!");
                return(true);
            }
            catch (Exception ex)
            {
                deploy.LogMessage("Error: " + ex.Message);
                return(false);
            }
        }
Exemple #8
0
        public async Task <bool> DeployToDevice()
        {
            try
            {
                bool tvExists = false;

                deploy.LogMessage("Starting new TeamViewer deployment to " + deploy.TargetHostname);
                deploy.LogMessage("-------------------");

                var filePush = deploy.NewFilePush(filesDirectory, tempDirectory);

                deploy.LogMessage("Pushing files to target computer...");

                if (await filePush.StartCopy())
                {
                    deploy.LogMessage("Push successful!");
                    filePush.Dispose();
                }
                else
                {
                    deploy.LogMessage("Push failed!");
                    deploy.UserPrompt("Error occurred while pushing deployment files to device!");
                    return(false);
                }

                deploy.LogMessage("Checking for previous installation...");

                tvExists = await TeamViewerInstalled();

                if (tvExists)
                {
                    deploy.LogMessage("TeamViewer already installed.");
                    deploy.LogMessage("Uninstalling TeamViewer...");

                    if (await deploy.SimplePSExecCommand(GetTVUninstallString(), "Uninstall TeamViewer"))
                    {
                        deploy.LogMessage("Uninstall complete!");
                    }
                    else
                    {
                        deploy.LogMessage("Uninstall failed!");
                        deploy.UserPrompt("Error occurred while executing deployment command!");
                        return(false);
                    }
                }
                else
                {
                    deploy.LogMessage("TeamViewer not installed.");
                }

                deploy.LogMessage("Starting TeamViewer install...");

                if (await deploy.SimplePSExecCommand(GetTVInstallString(), "Install TeamViewer"))
                {
                    deploy.LogMessage("Install complete!");
                }
                else
                {
                    deploy.LogMessage("Install failed!");
                    deploy.UserPrompt("Error occurred while executing deployment command!");
                    return(false);
                }

                deploy.LogMessage("Waiting 10 seconds.");
                for (var i = 10; i >= 1; i--)
                {
                    await Task.Delay(1000);

                    deploy.LogMessage(i + "...");
                }

                deploy.LogMessage("Starting TeamViewer assignment...");

                if (await deploy.SimplePSExecCommand(GetTVAssignString(), "TeamView Assignment"))
                {
                    deploy.LogMessage("Assignment complete!");
                }
                else
                {
                    deploy.LogMessage("Assignment failed!");
                    deploy.UserPrompt("Error occurred while executing assignment command!");
                    return(false);
                }

                deploy.LogMessage("Deleting temp files...");

                if (!await deploy.SimplePowerShellCommand(GetDeleteDirectoryCommand()))
                {
                    deploy.LogMessage("Delete failed!");
                    return(false);
                }

                deploy.LogMessage("Done.");
                deploy.LogMessage("-------------------");
                deploy.LogMessage("TeamView deployment is complete!");
                deploy.LogMessage("NOTE: The target computer may need rebooted or the user may need to open the application before TeamViewer will connect.");
                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }