Пример #1
0
 private void ReadVersion()
 {
     try
     {
         if (Core.UpdateVersion.License != null)
         {
             ServicePointManager.ServerCertificateValidationCallback += new RemoteCertificateValidationCallback(Core.Global.ValidateRemoteCertificate);
             WSVERSION.WSVersionSoapClient WSVERSION = new WSVERSION.WSVersionSoapClient();
             WSVERSION.ClientCredentials.UserName.UserName = "******";
             WSVERSION.ClientCredentials.UserName.Password = "******";
             string product_name = System.IO.Path.GetFileNameWithoutExtension(System.AppDomain.CurrentDomain.FriendlyName);
             if (WSVERSION.ExistVersionProduct(product_name, Core.UpdateVersion.CurrentVersion, Core.UpdateVersion.License.Sage, Core.UpdateVersion.License.Prestashop))
             {
                 if (CountProcessus() > 1)
                 {
                     View.PrestaMessage MsgProcessus = new View.PrestaMessage("Mise-à-jour du logiciel détectée !"
                                                                              + "\n\rFermez toutes les instances pour permettre son installation !",
                                                                              "Mise à jour détectée", MessageBoxButton.OK, MessageBoxImage.Warning);
                     MsgProcessus.ShowDialog();
                 }
                 else
                 {
                     View.PrestaMessage MsgBox = new View.PrestaMessage("Mise-à-jour du logiciel disponible, souhaitez-vous l'installer ?"
                                                                        + "\n\rL'application s'exécutera après le téléchargement et l'installation des mises à jours.",
                                                                        "Mise à jour disponible", MessageBoxButton.YesNo, MessageBoxImage.Question);
                     MsgBox.ShowDialog();
                     if (MsgBox.DialogResult == true)
                     {
                         Core.UpdateVersion.LaunchUpdate = true;
                         PRESTACONNECT.WSVERSION.Version version = WSVERSION.ReadVersionProduct(product_name, Core.UpdateVersion.CurrentVersion, Core.UpdateVersion.License.Sage, Core.UpdateVersion.License.Prestashop);
                         System.Diagnostics.Process      Process = new System.Diagnostics.Process();
                         Process.StartInfo.FileName  = System.IO.Path.Combine(System.IO.Directory.GetCurrentDirectory(), "Alternetis_Updater.exe");
                         Process.StartInfo.Arguments = Core.UpdateVersion.UpdaterArguments(version);
                         Process.Start();
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Core.Error.SendMailError(ex.ToString());
     }
 }
Пример #2
0
        //end Alternetis_Updater.Core.UpdateInfos

        public static string UpdaterArguments(PRESTACONNECT.WSVERSION.Version Version)
        {
            string r = string.Empty;

            r += " " + ParamInfo.Product + ArgSplitter + System.IO.Path.GetFileNameWithoutExtension(System.AppDomain.CurrentDomain.FriendlyName);
            r += " " + ParamInfo.ProductVersion + ArgSplitter + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
            r += " " + ParamInfo.SageVersion + ArgSplitter + SageFolder(License.Sage);
            r += " " + ParamInfo.PrestaShopVersion + ArgSplitter + PrestaShopFolder(License.Prestashop);
            r += " " + ParamInfo.TargetVersion + ArgSplitter + Version.Target;
            r += " " + ParamInfo.ClientName + ArgSplitter + Properties.Settings.Default.CLIENT.Replace(" ", "_");


            r += " " + ParamInfo.DatabaseServer + ArgSplitter + Core.Global.GetConnectionInfos().PrestaconnectServer;
            r += " " + ParamInfo.DatabaseName + ArgSplitter + Core.Global.GetConnectionInfos().PrestaconnectDatabase;
            if (!string.IsNullOrEmpty(Core.Global.GetConnectionInfos().PrestaconnectSQLUser))
            {
                r += " " + ParamInfo.SQLUser + ArgSplitter + Core.Global.GetConnectionInfos().PrestaconnectSQLUser;
                r += " " + ParamInfo.SQLPass + ArgSplitter + Core.Global.GetConnectionInfos().PrestaconnectSQLPass;
            }

            r += " Relaunch-PRESTACONNECT.exe";
            return(r);
        }
Пример #3
0
 public ReadVersionProductResponseBody(PRESTACONNECT.WSVERSION.Version ReadVersionProductResult)
 {
     this.ReadVersionProductResult = ReadVersionProductResult;
 }