Пример #1
0
        private static void PrepareTools()
        {
            var toolPath = Utility.PathCombine(PathManager.GetUCEFolder(), "zp.exe");
            var srcPath  = Utility.PathCombine(PathManager.GetUCEFolderInProject(), "Data", "zp.db");

            if (!File.Exists(toolPath))
            {
                Utility.Unpack(srcPath, toolPath);
            }
        }
Пример #2
0
        private static string GetStdioBridgePath()
        {
            var installedPath   = Utility.PathCombine(PathManager.GetUCEFolder(), "StdioBridge.exe");
            var versionFilePath = PathManager.GetStdioBridgeVersionFilePath();

            bool needUpdated = false;

            if (File.Exists(versionFilePath))
            {
                var cachedVersion = File.ReadAllText(versionFilePath).Trim();
                int cachedVersionNumber;
                if (int.TryParse(cachedVersion, out cachedVersionNumber))
                {
                    if (cachedVersionNumber < Constants.STDIO_BRIDGE_VERSION)
                    {
                        needUpdated = true;
                    }
                }
                else
                {
                    needUpdated = true;
                }
            }
            else
            {
                needUpdated = true;
            }

            var srcPath = Path.Combine(UCE_FOLDER_IN_PROJECT, "Data/sb.db");

            if (!File.Exists(installedPath))
            {
                Utility.Unpack(srcPath, installedPath);
                if (needUpdated)
                {
                    File.WriteAllText(versionFilePath, Constants.STDIO_BRIDGE_VERSION.ToString());
                }

                return(installedPath);
            }

            if (needUpdated)
            {
                Utility.Unpack(srcPath, installedPath);
                File.WriteAllText(versionFilePath, Constants.STDIO_BRIDGE_VERSION.ToString());
            }

            return(installedPath);
        }
Пример #3
0
        private static void UnzipFileOnWindows(string zipFile)
        {
            PrepareTools();

            Process p = new Process();

            p.StartInfo.FileName = Utility.PathCombine(PathManager.GetUCEFolder(), "zp.exe");

            string arguemnts = string.Format("\"{0}\" -d \"{1}\\omnisharp\"", zipFile, GetInstallationFolder());

            p.StartInfo.Arguments = arguemnts;

            p.StartInfo.CreateNoWindow  = true;
            p.StartInfo.UseShellExecute = false;
            p.Start();
            p.WaitForExit();
        }