@@ -15,23 +15,16 @@ public partial class MainWindow : Window
1515 public MainWindow ( )
1616 {
1717 InitializeComponent ( ) ;
18-
19- Loaded += MainWindow_Loaded ;
2018 }
2119
22- private void MainWindow_Loaded ( object sender , RoutedEventArgs e )
20+ public void Start ( )
2321 {
24- WindowState = WindowState . Minimized ;
25-
2622 string [ ] args = Environment . GetCommandLineArgs ( ) ;
2723
28- if ( args . Length > 0 )
24+ foreach ( string arg in args )
2925 {
30- foreach ( string arg in args )
31- {
32- if ( arg . Equals ( "/autoUpdate" ) )
33- IsAutoUpdate = true ;
34- }
26+ if ( arg . Equals ( "/autoUpdate" , StringComparison . Ordinal ) )
27+ IsAutoUpdate = true ;
3528 }
3629
3730 var updateInfo = UpdateInfo . GetLatestRelease ( ) ;
@@ -44,7 +37,7 @@ private void MainWindow_Loaded(object sender, RoutedEventArgs e)
4437 {
4538 if ( ! IsAutoUpdate )
4639 {
47- MessageBox . Show ( "No new update found." , "Updater" , MessageBoxButton . OK ) ;
40+ MessageBox . Show ( "No new update found." , Name , MessageBoxButton . OK ) ;
4841 }
4942
5043 Close ( ) ;
@@ -59,9 +52,9 @@ private void InitUpdateInfo(UpdateInfo info)
5952 ChangeLogText . Text = "Changelog for " + info . Version ;
6053 UpdateLog . Text = info . ChangeLog ;
6154 DownloadButton . Click += DownloadButton_Click ;
62-
63- WindowState = WindowState . Normal ;
6455 DownloadButton . IsEnabled = true ;
56+
57+ Show ( ) ;
6558 }
6659
6760 private void DownloadButton_Click ( object sender , RoutedEventArgs e )
@@ -73,7 +66,7 @@ private void DownloadButton_Click(object sender, RoutedEventArgs e)
7366
7467 public void OnInstallCompleted ( ProcessStartInfo selfUpdater = null )
7568 {
76- MessageBox . Show ( $ "Installed EasyERPMod { updateInfo . Version } succeeded!", Name ) ;
69+ MessageBox . Show ( $ "Install EasyERPMod { updateInfo . Version } succeeded!", Name ) ;
7770
7871 if ( selfUpdater != null )
7972 Process . Start ( selfUpdater ) ;
0 commit comments