コード例 #1
0
ファイル: WindowHelper.cs プロジェクト: efraingtz/leposwpf
        /// <summary>
        /// Execute Seven Zip to compress files
        /// </summary>
        /// <param name="destinationFile">The .7z file that will be created or have files added to it</param>
        /// <param name="sources">Folders/Files to be added to .7z file</param>
        public static void SevenZip(string destinationFile, string[] sources)
        {
            Paths paths = new Paths();
            string sourcesString = "";

            foreach (string source in sources)
            {
                sourcesString += " \"" + source + "\"";
            }

            ProcessStartInfo psi = new ProcessStartInfo();
            psi.FileName = paths.getSevenZipExe();
            psi.Arguments = " a -mx=9 \"" + destinationFile + "\"" + sourcesString;
            psi.WindowStyle = ProcessWindowStyle.Normal;

            Process proc = Process.Start(psi);
            proc.WaitForExit();
        }
コード例 #2
0
ファイル: WindowHelper.cs プロジェクト: efraingtz/leposwpf
        /// <summary>
        /// Check if actual executable is the latest revision
        /// </summary>
        /// <returns>Boolean value informing if actual running application is the same as the latest published revision</returns>
        public static bool IsLatestRevision()
        {
            int actualRevision = Convert.ToInt32(GetPublishVersion().Replace(".", ""));
            int latestRevision = 0;
            int dirRevision = 0;
            string pathApps = new Paths().getBIA() + "\\WODVP\\Binary\\Application Files";
            DirectoryInfo dirApps = new DirectoryInfo(pathApps);

            foreach (DirectoryInfo dir in dirApps.GetDirectories())
            {
                dirRevision = Convert.ToInt32(dir.Name.Replace("WODVP", "").Replace("_", ""));

                if (dirRevision > latestRevision)
                {
                    latestRevision = dirRevision;
                }
            }

            return (actualRevision == latestRevision || actualRevision == 3000);
        }