Esempio n. 1
0
        public static void InstallPythonPackage(string PythonPath, string PackagePath)
        {
            string packagePath = PackagePath;

            if (!File.Exists(packagePath))
            {
                packagePath = Path.Combine(Path.GetDirectoryName(WindowsHelpers.GetApplicationPath()), packagePath);
                if (!File.Exists(packagePath))
                {
                    throw new InvalidOperationException(string.Format("Python Package {0} not found", PackagePath));
                }
            }
            SilentProcess.StdoutDataCapture dataCapture = new SilentProcess.StdoutDataCapture();
            SilentProcess process = SilentProcess.StartConsoleProcessSilently(
                PythonPath,
                string.Format("-m pip install --no-index {0}", packagePath),
                dataCapture.DataReceivedHandler
                );

            process.WaitForExit();
            if (process.ExitCode != 0)
            {
                InstallLogger.Log(dataCapture.GetData());
                throw new PythonPackageInstallException(string.Format("Install of package {0} failed", PackagePath));
            }
        }
Esempio n. 2
0
        public static EdkRepoConfig ParseEdkRepoInstallerConfig()
        {
            string XmlFilePath = Path.Combine(Path.GetDirectoryName(WindowsHelpers.GetApplicationPath()), InstallerStrings.XmlConfigFileName);

            if (!File.Exists(XmlFilePath))
            {
                throw new InvalidOperationException(string.Format("Required XML file does not exist: {0}", XmlFilePath));
            }
            return(ParseEdkRepoInstallerConfig(XmlFilePath));
        }
Esempio n. 3
0
 private void CloseWindow()
 {
     if (UninstallMode && InstallDone)
     {
         if (VendorCustomizer.Instance != null)
         {
             SilentProcess.StartConsoleProcessSilently(
                 "cmd.exe",
                 string.Format("/c choice /d y /t 3 > nul & del \"{0}\"", VendorCustomizer.VendorPluginPath));
         }
         SilentProcess.StartConsoleProcessSilently(
             "cmd.exe",
             string.Format("/c choice /d y /t 3 > nul & del \"{0}\"", WindowsHelpers.GetApplicationPath()));
     }
     AllowClose = true;
     Close();
     Environment.ExitCode = ExitCode;
 }