File tree Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Original file line number Diff line number Diff line change 1414using Newtonsoft . Json ;
1515using System . Drawing . Imaging ;
1616using System . Drawing . Drawing2D ;
17+ using System . Threading . Tasks ;
1718
1819namespace StarDisplay
1920{
@@ -272,14 +273,21 @@ private void UpdateStars(object sender)
272273 MessageBoxButtons . YesNoCancel , MessageBoxIcon . Asterisk ) ;
273274 if ( result == DialogResult . Yes )
274275 {
275- try
276+ Task . Run ( ( ) =>
276277 {
277- um . UpdateAndRestart ( ) ;
278- }
279- catch ( Exception )
280- {
281- Process . Start ( um . DownloadPath ( ) ) ;
282- }
278+ try
279+ {
280+ um . UpdateAndRestart ( ) ;
281+ SafeInvoke ( ( ) =>
282+ {
283+ Application . Restart ( ) ;
284+ } ) ;
285+ }
286+ catch ( Exception )
287+ {
288+ Process . Start ( um . DownloadPath ( ) ) ;
289+ }
290+ } ) ;
283291 }
284292 if ( result == DialogResult . Cancel )
285293 {
Original file line number Diff line number Diff line change @@ -129,8 +129,6 @@ public void UpdateAndRestart()
129129
130130 File . Move ( filename , oldTempName ) ;
131131 File . Move ( newTempName , filename ) ;
132-
133- System . Windows . Forms . Application . Restart ( ) ;
134132 }
135133
136134 public Version UpdateVersion ( )
You can’t perform that action at this time.
0 commit comments