@@ -1196,7 +1196,7 @@ private void Window_Closing(object sender, CancelEventArgs e)
1196
1196
CloseHubPipeAsync ( ) ;
1197
1197
}
1198
1198
1199
- private void CloseThemeEditor ( )
1199
+ private void CloseThemeEditor ( )
1200
1200
{
1201
1201
if ( themeEditorWindow != null ) themeEditorWindow . Close ( ) ;
1202
1202
}
@@ -3583,24 +3583,38 @@ private void menuInstallLastAPK_Click(object sender, RoutedEventArgs e)
3583
3583
pars += $ " && adb shell monkey -p { packageName } 1";
3584
3584
}
3585
3585
3586
- //Tools.LaunchExe(cmd, pars);
3587
- var process = Tools . LaunchExe ( cmd , pars , captureOutput : true ) ;
3588
- var output = process . StandardOutput . ReadToEnd ( ) ;
3589
- var errorOutput = process . StandardError . ReadToEnd ( ) . Replace ( "\r " , "" ) . Replace ( "\n " , "" ) ;
3586
+ try
3587
+ {
3588
+ //Tools.LaunchExe(cmd, pars);
3589
+ var process = Tools . LaunchExe ( cmd , pars , captureOutput : true ) ;
3590
+ var output = process . StandardOutput . ReadToEnd ( ) ;
3591
+ var errorOutput = process . StandardError . ReadToEnd ( ) . Replace ( "\r " , "" ) . Replace ( "\n " , "" ) ;
3590
3592
3591
- process . WaitForExit ( ) ;
3593
+ process . WaitForExit ( ) ;
3592
3594
3593
- // Console.WriteLine(output);
3594
- if ( ! string . IsNullOrEmpty ( errorOutput ) )
3595
+ // Console.WriteLine(output);
3596
+ if ( ! string . IsNullOrEmpty ( errorOutput ) )
3597
+ {
3598
+ SetStatus ( "Error installing APK: " + errorOutput ) ;
3599
+ }
3600
+ else
3601
+ {
3602
+ // get apk name from path
3603
+ var apkName = Path . GetFileName ( playerPath ) ;
3604
+ if ( chkStreamerMode . IsChecked == true ) apkName = " (hidden in streamermode)" ;
3605
+ SetStatus ( "Installed APK:" + apkName ) ;
3606
+ }
3607
+
3608
+ }
3609
+ catch ( Win32Exception ex )
3595
3610
{
3596
- SetStatus ( "Error installing APK: " + errorOutput ) ;
3611
+ // Handle case where 'adb' is not found
3612
+ SetStatus ( $ "Error: 'adb' not found. Ensure it's installed and added to PATH. Details: { ex . Message } ") ;
3597
3613
}
3598
- else
3614
+ catch ( Exception ex )
3599
3615
{
3600
- // get apk name from path
3601
- var apkName = Path . GetFileName ( playerPath ) ;
3602
- if ( chkStreamerMode . IsChecked == true ) apkName = " (hidden in streamermode)" ;
3603
- SetStatus ( "Installed APK:" + apkName ) ;
3616
+ // Handle other unexpected exceptions
3617
+ SetStatus ( $ "An unexpected error occurred: { ex . Message } ") ;
3604
3618
}
3605
3619
}
3606
3620
0 commit comments