Пример #1
0
        public static void Upgrade()
        {
            string updateFolder = AppDomain.CurrentDomain.BaseDirectory + Common.APPLICATION_ID;

            FileAdapter.EnsurePath(updateFolder);
            FileAdapter.Copy(Updater.AppName, updateFolder + @"\" + Updater.AppName, true);
            foreach (var file in Updater.DepandenceFiles)
            {
                FileAdapter.Copy(file, AppDomain.CurrentDomain.BaseDirectory + Common.APPLICATION_ID + @"\" + file, true);
            }

            string updateEndPoint = INIAdapter.ReadValue(Common.CFG_SECTION_WEB, Common.CFG_KEY_UPDATE_END_POINT, Common.CFG_FILE_PATH);
            string args           = String.Format("-n {0} -v {1} -c {2}", AppAdapter.GetName(), VersionAdapter.GetPureVersion(VersionType.ASSEMBLY), updateEndPoint + "/" + Common.APPLICATION_ID);

            System.Diagnostics.Process.Start(updateFolder + @"\" + Updater.AppName, args);
        }
Пример #2
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            string delegateApplicationId = "PM001";//Common.APPLICATION_ID
            string updateFolder          = AppDomain.CurrentDomain.BaseDirectory + delegateApplicationId;

            win.core.utils.FileAdapter.EnsurePath(updateFolder);
            win.core.utils.FileAdapter.Copy(Updater.AppName, updateFolder + @"\" + Updater.AppName, true);
            foreach (var file in Updater.DepandenceFiles)
            {
                win.core.utils.FileAdapter.Copy(file, AppDomain.CurrentDomain.BaseDirectory + delegateApplicationId + @"\" + file, true);
            }

            string updateEndPoint = INIAdapter.ReadValue(Common.CFG_SECTION_WEB, Common.CFG_KEY_UPDATE_END_POINT, Common.CFG_FILE_PATH);
            string args           = String.Format("-n {0} -v {1} -c {2}", AppAdapter.GetName(), VersionAdapter.GetPureVersion(VersionType.ASSEMBLY), updateEndPoint + "/" + delegateApplicationId);

            System.Diagnostics.Process.Start(updateFolder + @"\" + Updater.AppName, args);
        }