@@ -37,6 +37,10 @@ public partial class MainWindow : Window
3737 public MainWindow ( )
3838 {
3939 InitializeComponent ( ) ;
40+
41+ // Enable debug logging by default
42+ DebugLogger . IsEnabled = true ;
43+
4044 TableItems = new ObservableCollection < TableRow >
4145 {
4246 new TableRow { Id = ID . ApplicationUpdate , Icon = "" , Status = "Check installer update" } ,
@@ -52,19 +56,6 @@ public MainWindow()
5256 DebugLogger . LogConfiguration ( "Initial table items count" , TableItems . Count , "MainWindow" ) ;
5357 }
5458
55- // Debug checkbox event handlers
56- private void DebugLogCheckBox_Checked ( object sender , RoutedEventArgs e )
57- {
58- DebugLogger . IsEnabled = true ;
59- DebugLogger . LogInfo ( "Debug logging enabled by user" , "MainWindow" ) ;
60- }
61-
62- private void DebugLogCheckBox_Unchecked ( object sender , RoutedEventArgs e )
63- {
64- DebugLogger . LogInfo ( "Debug logging being disabled by user" , "MainWindow" ) ;
65- DebugLogger . IsEnabled = false ;
66- }
67-
6859 private bool CheckWindowsVersionCompatibility ( )
6960 {
7061 DebugLogger . LogMethodStart ( "CheckWindowsVersionCompatibility" , component : "MainWindow" ) ;
@@ -191,6 +182,7 @@ private async Task<bool> CheckWsl()
191182 DebugLogger . LogError ( $ "WSL check failed with status: { wslResult . Status } ", "MainWindow" ) ;
192183 ChangeRowIconAndStatus ( ID . WslCheck , "RedCancelIcon" , WslCheck . GetStatusDisplayMessage ( wslResult ) ) ;
193184 DebugLogger . LogMethodEnd ( "CheckWsl" , "false (WSL error)" , "MainWindow" ) ;
185+ PromptOpenIssue ( "WSL check error" , WslCheck . GetStatusDisplayMessage ( wslResult ) ) ;
194186 return false ;
195187 }
196188 }
@@ -199,6 +191,7 @@ private async Task<bool> CheckWsl()
199191 DebugLogger . LogException ( ex , "Error occurred while checking WSL" , "MainWindow" ) ;
200192 ChangeRowIconAndStatus ( ID . WslCheck , "RedCancelIcon" , "Error occurred while checking WSL" ) ;
201193 DebugLogger . LogMethodEnd ( "CheckWsl" , "false (exception)" , "MainWindow" ) ;
194+ PromptOpenIssue ( "WSL check exception" , ex . ToString ( ) ) ;
202195 return false ;
203196 }
204197 }
@@ -225,8 +218,8 @@ private async Task<bool> CheckBoincProcess()
225218 DebugLogger . LogWarning ( $ "BOINC process is running: { boincResult . Message } ", "MainWindow" ) ;
226219 ChangeRowIconAndStatus ( ID . BoincProcessCheck , "RedCancelIcon" , boincResult . Message ) ;
227220
228- // Ask user if they want to stop BOINC
229- var result = MessageBox . Show (
221+ // Show instruction to stop BOINC (do NOT offer to create an issue here)
222+ MessageBox . Show (
230223 $ "BOINC client is currently running and may interfere with the installation.\n \n Please stop the running BOINC client and retry the installation.",
231224 $ "{ boincResult . Message } ",
232225 MessageBoxButton . OK ,
@@ -245,6 +238,8 @@ private async Task<bool> CheckBoincProcess()
245238 DebugLogger . LogWarning ( $ "Unable to check BOINC status: { boincResult . ErrorMessage } ", "MainWindow" ) ;
246239 ChangeRowIconAndStatus ( ID . BoincProcessCheck , "YellowExclamationIcon" , $ "Unable to check BOINC status: { boincResult . ErrorMessage } ") ;
247240 DebugLogger . LogMethodEnd ( "CheckBoincProcess" , "true (error, continue anyway)" , "MainWindow" ) ;
241+ // Continue but offer to report if user wants
242+ PromptOpenIssue ( "BOINC process check error" , boincResult . ErrorMessage ) ;
248243 return true ; // Continue despite error
249244 }
250245 }
@@ -253,6 +248,8 @@ private async Task<bool> CheckBoincProcess()
253248 DebugLogger . LogException ( ex , "Error occurred while checking BOINC process" , "MainWindow" ) ;
254249 ChangeRowIconAndStatus ( ID . BoincProcessCheck , "YellowExclamationIcon" , "Error occurred while checking BOINC process" ) ;
255250 DebugLogger . LogMethodEnd ( "CheckBoincProcess" , "true (exception, continue anyway)" , "MainWindow" ) ;
251+ // Offer to report issue
252+ PromptOpenIssue ( "BOINC process check exception" , ex . ToString ( ) ) ;
256253 return true ; // Continue despite error
257254 }
258255 }
@@ -305,6 +302,8 @@ private async Task<bool> CheckBudaRunner()
305302 DebugLogger . LogError ( $ "BUDA Runner check failed: { budaResult . ErrorMessage } ", "MainWindow" ) ;
306303 ChangeRowIconAndStatus ( ID . BudaRunnerCheck , "YellowExclamationIcon" , BudaRunnerCheck . GetStatusDisplayMessage ( budaResult ) ) ;
307304 DebugLogger . LogMethodEnd ( "CheckBudaRunner" , "true (error, continue anyway)" , "MainWindow" ) ;
305+ // Offer to report issue
306+ PromptOpenIssue ( "BUDA Runner check error" , budaResult . ErrorMessage ) ;
308307 return true ; // Continue despite error
309308 }
310309 }
@@ -313,6 +312,8 @@ private async Task<bool> CheckBudaRunner()
313312 DebugLogger . LogException ( ex , "Error occurred while checking BUDA Runner" , "MainWindow" ) ;
314313 ChangeRowIconAndStatus ( ID . BudaRunnerCheck , "YellowExclamationIcon" , "Error occurred while checking BUDA Runner" ) ;
315314 DebugLogger . LogMethodEnd ( "CheckBudaRunner" , "true (exception, continue anyway)" , "MainWindow" ) ;
315+ // Offer to report issue
316+ PromptOpenIssue ( "BUDA Runner check exception" , ex . ToString ( ) ) ;
316317 return true ; // Continue despite error
317318 }
318319 }
@@ -345,6 +346,8 @@ private async Task<bool> InstallBudaRunner(BudaRunnerCheck.BudaRunnerCheckResult
345346 DebugLogger . LogError ( "BUDA Runner installation failed" , "MainWindow" ) ;
346347 ChangeRowIconAndStatus ( ID . BudaRunnerCheck , "RedCancelIcon" , "Failed to install BUDA Runner" ) ;
347348 DebugLogger . LogMethodEnd ( "InstallBudaRunner" , "false" , "MainWindow" ) ;
349+ // Offer to report issue
350+ PromptOpenIssue ( "BUDA Runner installation failed" , "Failed to install BUDA Runner" ) ;
348351 return false ;
349352 }
350353 }
@@ -353,6 +356,8 @@ private async Task<bool> InstallBudaRunner(BudaRunnerCheck.BudaRunnerCheckResult
353356 DebugLogger . LogException ( ex , "BUDA Runner installation failed" , "MainWindow" ) ;
354357 ChangeRowIconAndStatus ( ID . BudaRunnerCheck , "RedCancelIcon" , $ "BUDA Runner installation failed: { ex . Message } ") ;
355358 DebugLogger . LogMethodEnd ( "InstallBudaRunner" , "false (exception)" , "MainWindow" ) ;
359+ // Offer to report issue
360+ PromptOpenIssue ( "BUDA Runner installation exception" , ex . ToString ( ) ) ;
356361 return false ;
357362 }
358363 }
@@ -397,6 +402,8 @@ private async Task<bool> InstallWsl()
397402 DebugLogger . LogError ( "WSL installation failed" , "MainWindow" ) ;
398403 ChangeRowIconAndStatus ( ID . WslCheck , "RedCancelIcon" , "Failed to install WSL" ) ;
399404 DebugLogger . LogMethodEnd ( "InstallWsl" , "false" , "MainWindow" ) ;
405+ // Offer to report issue
406+ PromptOpenIssue ( "WSL installation failed" , "Failed to install WSL" ) ;
400407 return false ;
401408 }
402409 }
@@ -405,6 +412,8 @@ private async Task<bool> InstallWsl()
405412 DebugLogger . LogException ( ex , "WSL installation failed" , "MainWindow" ) ;
406413 ChangeRowIconAndStatus ( ID . WslCheck , "RedCancelIcon" , "WSL installation failed" ) ;
407414 DebugLogger . LogMethodEnd ( "InstallWsl" , "false (exception)" , "MainWindow" ) ;
415+ // Offer to report issue
416+ PromptOpenIssue ( "WSL installation exception" , ex . ToString ( ) ) ;
408417 return false ;
409418 }
410419 }
@@ -437,6 +446,8 @@ private async Task<bool> FixWslIssues(WslCheck.WslCheckResult wslResult)
437446 DebugLogger . LogWarning ( "Some WSL issues could not be fixed automatically" , "MainWindow" ) ;
438447 ChangeRowIconAndStatus ( ID . WslCheck , "YellowExclamationIcon" , "Some WSL issues could not be fixed automatically" ) ;
439448 DebugLogger . LogMethodEnd ( "FixWslIssues" , "false" , "MainWindow" ) ;
449+ // Offer to report issue
450+ PromptOpenIssue ( "WSL fix issues could not be resolved" , WslCheck . GetStatusDisplayMessage ( wslResult ) ) ;
440451 return false ;
441452 }
442453 }
@@ -445,6 +456,8 @@ private async Task<bool> FixWslIssues(WslCheck.WslCheckResult wslResult)
445456 DebugLogger . LogException ( ex , "Failed to fix WSL configuration" , "MainWindow" ) ;
446457 ChangeRowIconAndStatus ( ID . WslCheck , "RedCancelIcon" , "Failed to fix WSL configuration" ) ;
447458 DebugLogger . LogMethodEnd ( "FixWslIssues" , "false (exception)" , "MainWindow" ) ;
459+ // Offer to report issue
460+ PromptOpenIssue ( "WSL fix exception" , ex . ToString ( ) ) ;
448461 return false ;
449462 }
450463 }
@@ -619,6 +632,47 @@ private void ChangeRowIconAndStatus(ID id, string newIcon, string status)
619632 }
620633 }
621634
635+ private void PromptOpenIssue ( string title , string details )
636+ {
637+ try
638+ {
639+ // Build a GitHub new issue URL with prefilled title/body.
640+ var repoNewIssueUrl = "https://github.com/BOINC/boinc-buda-runner-wsl-installer/issues/new" ;
641+
642+ var sb = new StringBuilder ( ) ;
643+ sb . AppendLine ( "Describe the problem and steps to reproduce here.\n " ) ;
644+ sb . AppendLine ( "Error context:" ) ;
645+ sb . AppendLine ( details ?? "(no details)" ) ;
646+ sb . AppendLine ( ) ;
647+ sb . AppendLine ( $ "App version: { FileVersionInfo . GetVersionInfo ( Process . GetCurrentProcess ( ) . MainModule . FileName ) . FileVersion } ") ;
648+ sb . AppendLine ( $ "OS: { Environment . OSVersion } ") ;
649+ sb . AppendLine ( $ "64-bit OS: { Environment . Is64BitOperatingSystem } , 64-bit Process: { Environment . Is64BitProcess } ") ;
650+ sb . AppendLine ( ) ;
651+ if ( ! string . IsNullOrEmpty ( DebugLogger . LogFilePath ) )
652+ {
653+ sb . AppendLine ( $ "Log file path (attach this file in the issue): { DebugLogger . LogFilePath } ") ;
654+ }
655+
656+ var url = repoNewIssueUrl + "?title=" + Uri . EscapeDataString ( title ?? "Installer error" )
657+ + "&body=" + Uri . EscapeDataString ( sb . ToString ( ) ) ;
658+
659+ var ask = MessageBox . Show (
660+ "An error occurred. Would you like to report it on GitHub? Your debug log file path will be included in the report so you can attach it." ,
661+ "Report Error" ,
662+ MessageBoxButton . YesNo ,
663+ MessageBoxImage . Question ) ;
664+
665+ if ( ask == MessageBoxResult . Yes )
666+ {
667+ Process . Start ( url ) ;
668+ }
669+ }
670+ catch ( Exception ex )
671+ {
672+ DebugLogger . LogException ( ex , "Failed to create/open GitHub issue link" , "MainWindow" ) ;
673+ }
674+ }
675+
622676 // --- Self-update logic (lightweight JSON parsing) ---
623677 private static string ExtractJsonString ( string json , string propertyName )
624678 {
0 commit comments