public SplitExcel() { InitializeComponent(); this.Icon = Properties.Resources.Excel_icon; OpenedExcelFile = null; _updater = new Updater.Updater(this); }
public override void Execute(object parameter) { Updater.Updater updater = new Updater.Updater(); IEnumerable <string> files = Directory.GetFiles(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "*.dll").Concat(Directory.GetFiles(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "*.exe")); Dictionary <string, Version> clientVersions = new Dictionary <string, Version>(); foreach (string file in files) { Version clientVersion = AssemblyName.GetAssemblyName(file).Version; clientVersions[Path.GetFileName(file)] = clientVersion; } Dictionary <string, Version> newAvailableVersions; if (updater.AreNewVersionsAvailable(clientVersions, out newAvailableVersions) && ExolutioYesNoBox.ShowYesNoCancel("New version available", "New version is available. \r\nDo you wish to update?") == MessageBoxResult.Yes) { System.Diagnostics.ProcessStartInfo info = new System.Diagnostics.ProcessStartInfo("Exolutio.Updater.exe"); info.UseShellExecute = true; (Current.MainWindow).Close(); System.Diagnostics.Process.Start(info); } else { ExolutioMessageBox.Show("Exolutio Update", "Updates checked", "This is the latest version."); } }
private void lCheckForUpdates_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { Updater.Updater updater = new Updater.Updater(); IEnumerable <string> files = Directory.GetFiles(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "*.dll").Concat(Directory.GetFiles(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "*.exe")); Dictionary <string, Version> clientVersions = new Dictionary <string, Version>(); foreach (string file in files) { Version clientVersion = AssemblyName.GetAssemblyName(file).Version; clientVersions[Path.GetFileName(file)] = clientVersion; } Dictionary <string, Version> newAvailableVersions; if (updater.AreNewVersionsAvailable(clientVersions, out newAvailableVersions) && XCaseYesNoBox.ShowYesNoCancel("New version available", "New version is available. \r\nDo you wish to update?") == MessageBoxResult.Yes) { System.Diagnostics.ProcessStartInfo info = new System.Diagnostics.ProcessStartInfo("Updater.exe"); info.UseShellExecute = true; this.Close(); (Application.Current.MainWindow as MainWindow).Close(); System.Diagnostics.Process.Start(info); } else { OkCancelDialog d = new OkCancelDialog(); d.CancelButtonVisibility = Visibility.Collapsed; d.Title = "XCase Update"; d.PrimaryContent = "Check for updates: "; d.SecondaryContent = "This is the latest version."; d.ShowDialog(); } }
static void Main(string[] args) //port in args[0] { Updater.Updater u = new Updater.Updater(); u.updateURL = "https://raw.githubusercontent.com/Patti4832/IoT-Database-Server/master/Update/"; u.files = 1; u.fileNames = new string[] { "IoT Database Server.exe" }; u.versions = new int[] { 2 }; u.CheckForUpdate(); if (u.updateable) { u.InstallUpdate(); } else { int port = 80; if (args.Length == 1) { try { port = int.Parse(args[0]); } catch { } } Log.Info("Starting IoT Databse Server ..."); Database.Init(); Config.debug = true; Server s1 = new Server(port); s1.Start(); Console.ReadLine(); } }
public void detectGames() { Games.detectGames(); Archives.DetectBackups(); Monitor.Monitor.flushQueue(); updater = new Updater.Updater(Games.xml, Games.GameDataFolder); Core.monitor.start(); }
public BindsView() { InitializeComponent(); this.Icon = Properties.Resources.Map_Marker_Grey_Green_Icon; InitializeListView(); radShowStaticMap.Checked = Properties.Settings.Default.ShowStaticMap; _updater = new Updater.Updater(this); }
private void frmUpdate_Load(object sender, EventArgs e) { AppDomain.CurrentDomain.UnhandledException += Program.CurrentDomain_UnhandledException; Strings.Load(); GameContentManager.CheckForResources(); Database.LoadOptions(); InitLocalization(); mUpdater = new Updater.Updater(ClientConfiguration.Instance.UpdateUrl, Path.Combine("version.json"), false, 5); }
public IntersectGame() { //Setup an error handler AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; Strings.Load(); mGraphics = new GraphicsDeviceManager(this); mGraphics.PreferredBackBufferWidth = 800; mGraphics.PreferredBackBufferHeight = 480; mGraphics.PreferHalfPixelOffset = true; mGraphics.PreparingDeviceSettings += (object s, PreparingDeviceSettingsEventArgs args) => { args.GraphicsDeviceInformation.PresentationParameters.RenderTargetUsage = RenderTargetUsage.PreserveContents; }; Content.RootDirectory = ""; IsMouseVisible = true; Globals.ContentManager = new MonoContentManager(); Globals.Database = new MonoDatabase(); /* Load configuration */ ClientConfiguration.LoadAndSave(ClientConfiguration.DefaultPath); Globals.Database.LoadPreferences(); Globals.InputManager = new MonoInput(this); var renderer = new MonoRenderer(mGraphics, Content, this); Core.Graphics.Renderer = renderer; if (renderer == null) { throw new NullReferenceException("No renderer."); } Globals.System = new MonoSystem(); Interface.Interface.GwenRenderer = new IntersectRenderer(null, Core.Graphics.Renderer); Interface.Interface.GwenInput = new IntersectInput(); Controls.Init(); Window.Position = new Microsoft.Xna.Framework.Point(-20, -2000); Window.IsBorderless = false; Window.AllowAltF4 = false; if (!string.IsNullOrWhiteSpace(ClientConfiguration.Instance.UpdateUrl)) { mUpdater = new Updater.Updater(ClientConfiguration.Instance.UpdateUrl, Path.Combine("version.json"), true, 5); } }
public MainForm() { InitializeComponent(); try { //Set helper classes myDatabase = new Database(dbFile); myIni = new Ini(iniSettingsFile); //Set language menu List <ToolStripMenuItem> languageMenuItems = myLanguage.Create_LanguageMenuItems(ref toolSSeperator, ref toolSMLanguage, languageDir); foreach (ToolStripMenuItem menuItem in languageMenuItems) { menuItem.Click += new EventHandler(LanguageMenuItem_Click); } InitLanguage(); //Initialize controls InitControls(); //Check for unnseen mails when program start Check_AccountsForUnseenMails(); //Start program updater Updater.Updater.Configurator myConfig = new Updater.Updater.Configurator(); myConfig.ApplicationName = AppDomain.CurrentDomain.FriendlyName.Replace(".exe", ""); myConfig.Version = Assembly.GetEntryAssembly().GetName().Version; myConfig.Homepage = "https://sourceforge.net/projects/mailcheckerpro/"; myConfig.UpdateUrl = "https://sourceforge.net/projects/mailcheckerpro/files/"; myConfig.SupportEmail = "*****@*****.**"; myConfig.ConfirmDownload = true; myConfig.UpdateInterval = 10; LoadExternalDlls(ref myConfig); //external dlls myUpdater = new Updater.Updater(myConfig); myUpdater.Start(); } catch (Exception e) { MessageBox.Show("Fatal error: " + e.Message); CloseApplication = true; Close(); } }
public frСheckingForUpdates() { this.Icon = Properties.Resources.ico; this.InitializeComponent(); Version version = null; string fileLink = string.Empty; try { version = new Version(new Properties.Settings().Version); fileLink = "https://github.com/stv233/ItemCreator/blob/master/ItemCreator/Version.txt?raw=true"; } catch { Application.Exit(); } this.updater = new Updater.Updater(version, fileLink); }
public MainForm() { InitializeComponent(); try { //Set helper classes myDatabase = new Database(dbFile); myIni = new Ini(iniSettingsFile); //Set language menu List<ToolStripMenuItem> languageMenuItems = myLanguage.Create_LanguageMenuItems(ref toolSSeperator, ref toolSMLanguage, languageDir); foreach (ToolStripMenuItem menuItem in languageMenuItems) menuItem.Click += new EventHandler(LanguageMenuItem_Click); InitLanguage(); //Initialize controls InitControls(); //Check for unnseen mails when program start Check_AccountsForUnseenMails(); //Start program updater Updater.Updater.Configurator myConfig = new Updater.Updater.Configurator(); myConfig.ApplicationName = AppDomain.CurrentDomain.FriendlyName.Replace(".exe", ""); myConfig.Version = Assembly.GetEntryAssembly().GetName().Version; myConfig.Homepage = "https://sourceforge.net/projects/mailcheckerpro/"; myConfig.UpdateUrl = "https://sourceforge.net/projects/mailcheckerpro/files/"; myConfig.SupportEmail = "*****@*****.**"; myConfig.ConfirmDownload = true; myConfig.UpdateInterval = 10; LoadExternalDlls(ref myConfig); //external dlls myUpdater = new Updater.Updater(myConfig); myUpdater.Start(); } catch (Exception e) { MessageBox.Show("Fatal error: " + e.Message); CloseApplication = true; Close(); } }
/// <summary> /// Allows the game to run logic such as updating the world, /// checking for collisions, gathering input, and playing audio. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Update(GameTime gameTime) { if (mUpdater != null) { if (mUpdater.CheckUpdaterContentLoaded()) { LoadUpdaterContent(); } if (mUpdater.Status == UpdateStatus.Done || mUpdater.Status == UpdateStatus.None) { if (updaterGraphicsReset == true) { //Drew a frame, now let's initialize the engine IntersectInit(); mUpdater = null; } } else if (mUpdater.Status == UpdateStatus.Restart) { //Auto relaunch on Windows switch (Environment.OSVersion.Platform) { case PlatformID.Win32NT: case PlatformID.Win32S: case PlatformID.Win32Windows: case PlatformID.WinCE: Process.Start( Environment.GetCommandLineArgs()[0], Environment.GetCommandLineArgs().Length > 1 ? string.Join(" ", Environment.GetCommandLineArgs().Skip(1)) : null ); Exit(); break; } } } if (mUpdater == null) { if (!mInitialized) { IntersectInit(); } if (Globals.IsRunning) { if (mLastUpdateTime < gameTime.TotalGameTime.TotalMilliseconds) { lock (Globals.GameLock) { Main.Update(); } ///mLastUpdateTime = gameTime.TotalGameTime.TotalMilliseconds + (1000/60f); } } else { Exit(); } } base.Update(gameTime); }
private IntersectGame(IClientContext context, Action postStartupAction) { Context = context; PostStartupAction = postStartupAction; Strings.Load(); mGraphics = new GraphicsDeviceManager(this) { PreferredBackBufferWidth = 800, PreferredBackBufferHeight = 480, PreferHalfPixelOffset = true }; mGraphics.PreparingDeviceSettings += (s, args) => { args.GraphicsDeviceInformation.PresentationParameters.RenderTargetUsage = RenderTargetUsage.PreserveContents; }; Content.RootDirectory = ""; IsMouseVisible = true; Globals.ContentManager = new MonoContentManager(); Globals.Database = new MonoDatabase(); /* Load configuration */ ClientConfiguration.LoadAndSave(ClientConfiguration.DefaultPath); Globals.Database.LoadPreferences(); Window.IsBorderless = Context.StartupOptions.BorderlessWindow; var renderer = new MonoRenderer(mGraphics, Content, this) { OverrideResolution = Context.StartupOptions.ScreenResolution }; Globals.InputManager = new MonoInput(this); GameClipboard.Instance = new MonoClipboard(); Core.Graphics.Renderer = renderer; Globals.System = new MonoSystem(); Interface.Interface.GwenRenderer = new IntersectRenderer(null, Core.Graphics.Renderer); Interface.Interface.GwenInput = new IntersectInput(); Controls.Init(); Window.Position = new Microsoft.Xna.Framework.Point(-20, -2000); Window.AllowAltF4 = false; // If we're going to be rendering a custom mouse cursor, hide the default one! if (!string.IsNullOrWhiteSpace(ClientConfiguration.Instance.MouseCursor)) { IsMouseVisible = false; } if (!string.IsNullOrWhiteSpace(ClientConfiguration.Instance.UpdateUrl)) { mUpdater = new Updater.Updater( ClientConfiguration.Instance.UpdateUrl, Path.Combine("version.json"), true, 5 ); } }
private static void Main() { Logger.Trace("Запуск стартера"); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); var installationFolder = AppDomain.CurrentDomain.BaseDirectory; UpdatesChecker.PlaceInstalledUpdates = Path.Combine(installationFolder, ConfigurationManager.AppSettings["InstalledUpdatesFolderName"]); UpdatesChecker.PlaceTempUpdates = Path.Combine(installationFolder, ConfigurationManager.AppSettings["TempPacketUpdatesFolderName"]); UpdatesChecker.PlaceUpdates = Path.Combine(installationFolder, ConfigurationManager.AppSettings["UpdatesFolder"]); var tempUnpackUpdatesFolder = Path.Combine(installationFolder, ConfigurationManager.AppSettings["TempUnpackedUpdatesFolderName"]); var startExe = ConfigurationManager.AppSettings["StartExe"]; var checkUpdateIntervalStr = ConfigurationManager.AppSettings["WaitUpdateIntervalMs"]; int checkUpdateInterval; if (!int.TryParse(checkUpdateIntervalStr, out checkUpdateInterval)) checkUpdateInterval = 1000; ClearTempFiles(); while (!_exitFromApp) { if (IsCupRunning()) { if (!_exitFromApp) RunVersion(startExe); return; } if (UpdatesChecker.IsAvailablePacketsUpdate()) { if (!IsUppyRunning()) { OpenFormWait(); } Logger.Trace("Обнаружены обновления"); var listUpdates = UpdatesChecker.DownloadUpdates(); Logger.Trace("Обновления загружены"); foreach (var filePacketUpdate in listUpdates) { Logger.Trace("Очистка временной папки"); ClearTempUpdateDirectory(tempUnpackUpdatesFolder); Logger.Trace("Распаковка файла-пакета обновления: " + Path.GetFileName(filePacketUpdate)); var updater = new Updater.Updater(tempUnpackUpdatesFolder); Logger.Trace("Загрузка определения пакета."); updater.UnpackPacket(filePacketUpdate, tempUnpackUpdatesFolder); updater.LoadPacketDefiniton(); updater.InstallationFolder = installationFolder; if (updater.IsUpdateApplied()) { var updateApplied = false; while (!updateApplied) { if (IsUppyRunning()) { Logger.Trace("ЦУП запущен. Запрос пользователю на закрытие ЦУП"); var result = ResultAskUser.Update; if (!_exitFromApp) { var form = new AlertForUpdateForm(updater.Definition.UpdateMessage); form.ShowDialog(); result = form.Result; Logger.Trace( "ЦУП был запущен. Ответ на запрос выполнения обновления: " + result); } switch (result) { case ResultAskUser.Update: updater.ProgramRunning = true; OpenFormWait(); Logger.Trace("Завершаем процессы ЦУП"); KillUppyProcesses(); _exitFromApp = false; Logger.Trace("Выполнение действий перед обновлением"); updater.ExecActionsBefore(); Logger.Trace("Обновление файлов"); updater.UpdateFiles(); Logger.Trace("Выполнение действий после установки обновления"); updater.ExecActionsAfter(); Logger.Trace("Очистка временной папки"); ClearTempUpdateDirectory(tempUnpackUpdatesFolder); Logger.Trace("Пометка обновления как установленное"); UpdatesChecker.MarkUpdateApplied(filePacketUpdate); _exitFromApp = false; updateApplied = true; break; case ResultAskUser.Ignore: case ResultAskUser.Delay: Logger.Trace("Откладываем обновление на 1 минуту."); int countDelay = 60; while (!_exitFromApp && (countDelay-- > 0)) { Thread.Sleep(1000); } break; default: throw new ArgumentOutOfRangeException(); } } else { updater.ProgramRunning = false; Logger.Trace("Выполнение действий перед обновлением"); updater.ExecActionsBefore(); Logger.Trace("Обновление файлов"); updater.UpdateFiles(); Logger.Trace("Выполнение действий после установки обновления"); updater.ExecActionsAfter(); Logger.Trace("Пометка обновления как установленное"); UpdatesChecker.MarkUpdateApplied(filePacketUpdate); Logger.Trace("Очистка временной папки"); ClearTempUpdateDirectory(tempUnpackUpdatesFolder); updateApplied = true; } } } else { Logger.Trace("Обновление не применяется к текущей версии."); UpdatesChecker.MarkUpdateApplied(filePacketUpdate); ClearTempUpdateDirectory(tempUnpackUpdatesFolder); } } if (!_exitFromApp && !IsUppyRunning()) RunVersion(startExe); } else { if (!_exitFromApp && !IsUppyRunning()) RunVersion(startExe); } Thread.Sleep(checkUpdateInterval); // wait update } Logger.Trace("Конец работы"); }