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);
            }
        }
Example #2
0
        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()
        {
            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);
            }
        }
Example #4
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);
            }
        }