static void Main() { frmWait _f = new frmWait(); _f.Show(); Application.DoEvents(); AutoUpdateStarter aus = new AutoUpdateStarter(_f); }
public AutoUpdateStarter(frmWait _frmWait) { WaitForm = _frmWait; string stConfigFileName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); stConfigFileName = Path.Combine(stConfigFileName, Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().Location)); stConfigFileName += @".exe.config"; AutoUpdateStarterConfig config = AutoUpdateStarterConfig.Load(stConfigFileName); this.executablePath = config.ApplicationExePath; this.isDeleteTemp = config.DeleteTemp; this.updatePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + Path.DirectorySeparatorChar + "update" + Path.DirectorySeparatorChar; StartProcessAndWait(); }