public string DoUpdate(string infoXmlPath) { IMainUpdaterController mainController = new MainUpdaterController(false, infoXmlPath); mainController.RequestExit += MainControllerRequestExit; mainController.Start(); while (!_finishedSuccessfully) { Thread.Sleep(100); } mainController.RequestExit -= MainControllerRequestExit; return(mainController.AppToStartAfterUpdate); }
private static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); bool usegui = true; bool showProgress = false; /** * Check arguments. * /nogui - hides gui during update process. * /selectgui - shows a message box to select whether to show the gui or not. */ if (args.Length > 0) { if (args[0] == "/nogui") { usegui = false; } else if (args[0] == "/showProgress") { usegui = false; showProgress = true; } else if (args[0] == "/selectgui") { if (MessageBox.Show("Gui benutzen ?", "?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { usegui = false; } } } /** * Get main controller and start. */ IMainUpdaterController mainController = new MainUpdaterController(usegui, showProgress); mainController.RequestExit += MainControllerRequestExit; mainController.Start(); Application.Run(); }