示例#1
0
 public static void StartUnZipFile(string zipedFile, string unZipDir, string password, bool overWrite)
 {
     if (!unZipDir.EndsWith("\\"))
     {
         unZipDir += Path.DirectorySeparatorChar;
     }
     if (!Directory.Exists(unZipDir))
     {
         Directory.CreateDirectory(unZipDir);
     }
     ZipTool.UnZipFile(ZipTool.WriteFile(zipedFile), unZipDir, string.Empty, overWrite);
 }
示例#2
0
 public static void StartUnZipFile(byte[] bts, string unZipDir, string password, bool overWrite = true)
 {
     if (!unZipDir.EndsWith("\\"))
     {
         unZipDir += Path.DirectorySeparatorChar;
     }
     if (!Directory.Exists(unZipDir))
     {
         Directory.CreateDirectory(unZipDir);
     }
     ZipTool.UnZipFile(ZipTool.WriteFile(bts), unZipDir, password, overWrite);
 }
示例#3
0
        private bool zipAction(string arguments, bool unzip = false)
        {
            bool result = true;

            string[] args = parseArguments(arguments);

            if (args != null && args.Length == 2)
            {
                ZipTool zt = new ZipTool();

                if (unzip)
                {
                    log.Info("$> Extrallendo contenido del archivo ZIP: [" + args[0] + "] al destino: [" + args[1] + "]");
                    result = zt.UnZipFile(args[0], args[1]);
                }
                else
                {
                    log.Info("$> Creando archivo ZIP: [" + args[1] + "] del Directorio: [" + args[0] + "]");
                    result = zt.CreateZipFileFromDirectory(args[0], args[1], true);
                }
            }

            return(result);
        }
示例#4
0
    private void doUpdate()
    {
        string currentVer = ProductVersion;
            string onLineVer = "";
            try
            {
                onLineVer = GetOnlinever();
            }
            catch (Exception ex)
            {
                screenBox.Buffer.Text += "\r\n Non è possibile reperire la versione online";
                return;
            }

            if (currentVer != onLineVer)
                {
                    DialogResult DigR = MessageBox.Show("Rilevata Nuova Versione !!\r\n Update ?","WARN !!",MessageBoxButtons.YesNo,MessageBoxIcon.Warning);
                    if (DigR.ToString() == "Yes")
                    {
                    Directory.CreateDirectory(@".\updates\");
                    download("http://www.enturion.com/Launcher_Installer/Launcher" + onLineVer + ".zip", @".\updates\Launcher" + onLineVer + ".zip");
                    ZipTool zip = new ZipTool();
                    bool result = zip.UnZipFile(@".\updates\Launcher" + onLineVer + ".zip");
                    if (result)
                    {
                        MessageBox.Show("File Estratti !");
                        ProcessStartInfo PI = new ProcessStartInfo();

                        string CopyArgs = @".\updates\update.bat";
                        PI.FileName = "cmd.exe";
                        PI.Arguments = " /c " + CopyArgs;
                        //PI.CreateNoWindow = true;
                        //PI.RedirectStandardOutput = true;
                        //PI.UseShellExecute = false;
                        MessageBox.Show("Processo di Update in avvvio !");
                        Process newProc = Process.Start(PI);

                        Application.Exit();
                    }
                    }
                }
    }