static void Main(string[] args) { Progress progressWindow; PrepareThread prepareThread; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); TextWriterTraceListener tlog = new TimeDateTraceListener(Application.CommonAppDataPath + "\\Install.log", "Install"); Trace.Listeners.Add(tlog); Trace.AutoFlush = true; progressWindow = new Progress(); prepareThread = new PrepareThread(args, progressWindow); Thread backgroundThread = new Thread(new ThreadStart(prepareThread.Run)); progressWindow.Show(); backgroundThread.Start(); Application.Run(progressWindow); }
protected override void OnStart(string[] args) { // Start thread - so we can do everything in the background TextWriterTraceListener tlog = new TimeDateTraceListener(Application.CommonAppDataPath + "\\Install.log", "Install"); Trace.Listeners.Add(tlog); Trace.AutoFlush = true; Trace.WriteLine("OnStart"); InstallState = new InstallerState(); installthread = new Thread(InstallThreadHandler); installthread.Start(); }