Skip to content

Commit 2560bb6

Browse files
authored
Merge pull request #11 from BOINC/vko_improvements
Add confirmation when closing the window. add README.md file
2 parents 560e161 + 53c4322 commit 2560bb6

2 files changed

Lines changed: 134 additions & 19 deletions

File tree

MainWindow.xaml.cs

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
using System.Threading.Tasks;
2727
using System.Windows;
2828
using System.Windows.Controls;
29+
using System.ComponentModel; // for CancelEventArgs
2930

3031
namespace boinc_buda_runner_wsl_installer
3132
{
@@ -55,6 +56,31 @@ public MainWindow()
5556
DebugLogger.LogConfiguration("Initial table items count", TableItems.Count, "MainWindow");
5657
}
5758

59+
protected override void OnClosing(CancelEventArgs e)
60+
{
61+
DebugLogger.LogMethodStart("OnClosing", component: "MainWindow");
62+
63+
var result = MessageBox.Show(
64+
"Are you sure you want to exit the installer?",
65+
"Confirm Exit",
66+
MessageBoxButton.YesNo,
67+
MessageBoxImage.Question);
68+
69+
DebugLogger.LogInfo($"Exit confirmation dialog result: {result}", "MainWindow");
70+
71+
if (result != MessageBoxResult.Yes)
72+
{
73+
e.Cancel = true;
74+
DebugLogger.LogMethodEnd("OnClosing", "cancelled by user", "MainWindow");
75+
return;
76+
}
77+
78+
DebugLogger.LogInfo("User confirmed exit, shutting down application", "MainWindow");
79+
DebugLogger.LogMethodEnd("OnClosing", component: "MainWindow");
80+
DebugLogger.Flush();
81+
base.OnClosing(e);
82+
}
83+
5884
private bool CheckWindowsVersionCompatibility()
5985
{
6086
DebugLogger.LogMethodStart("CheckWindowsVersionCompatibility", component: "MainWindow");
@@ -593,25 +619,8 @@ private void ExitButton_Click(object sender, RoutedEventArgs e)
593619
{
594620
DebugLogger.LogMethodStart("ExitButton_Click", component: "MainWindow");
595621

596-
// Show confirmation dialog before exiting
597-
var result = MessageBox.Show(
598-
"Are you sure you want to exit the installer?",
599-
"Confirm Exit",
600-
MessageBoxButton.YesNo,
601-
MessageBoxImage.Question);
602-
603-
DebugLogger.LogInfo($"Exit confirmation dialog result: {result}", "MainWindow");
604-
605-
if (result == MessageBoxResult.Yes)
606-
{
607-
DebugLogger.LogInfo("User confirmed exit, shutting down application", "MainWindow");
608-
DebugLogger.Flush();
609-
Application.Current.Shutdown();
610-
}
611-
else
612-
{
613-
DebugLogger.LogInfo("User cancelled exit", "MainWindow");
614-
}
622+
// Delegate to window close to reuse confirmation logic
623+
this.Close();
615624

616625
DebugLogger.LogMethodEnd("ExitButton_Click", component: "MainWindow");
617626
}

README.md

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# BOINC BUDA Runner WSL Installer
2+
3+
A Windows desktop installer that prepares your system to run BOINC BUDA Runner under Windows Subsystem for Linux (WSL) and installs or updates BUDA Runner for you.
4+
5+
The app is a WPF application targeting .NET Framework 4.8.
6+
7+
## What it does
8+
9+
The installer performs a sequence of checks and guided actions:
10+
11+
- Check installer update
12+
- Queries the latest GitHub release of this installer and informs you if a newer version exists.
13+
- Note: The installer does not self-update. If an update is available, please download it from the [Releases page](https://github.com/BOINC/boinc-buda-runner-wsl-installer/releases).
14+
- Check Windows version
15+
- Verifies that your Windows version supports WSL2.
16+
- Check Windows features
17+
- Ensures required Windows features (e.g., Virtual Machine Platform, WSL) are enabled.
18+
- Attempts to enable missing features. A restart may be required.
19+
- Check WSL installation and configuration
20+
- Installs WSL if missing, or fixes common configuration issues.
21+
- Sets the default WSL version to 2.
22+
- Check BOINC process
23+
- Detects if a BOINC client is currently running. If running, you�ll be asked to stop it before continuing.
24+
- Check BUDA Runner
25+
- Installs or updates BUDA Runner to the latest version, or confirms that it�s up to date.
26+
27+
## Requirements
28+
29+
- Supported OS:
30+
- Windows 11 (recommended)
31+
- Windows 10 version 2004 (build 19041) or newer (WSL2 support required)
32+
- Administrator privileges
33+
- Enabling Windows features and installing WSL require elevation. Run the installer as Administrator.
34+
- Internet access
35+
- Required to query GitHub releases, download WSL (when needed), and download BUDA Runner.
36+
37+
## Quick start
38+
39+
1. Download the latest release of the installer:
40+
- https://github.com/BOINC/boinc-buda-runner-wsl-installer/releases
41+
2. Right-click the downloaded installer executable and choose "Run as administrator".
42+
3. Click "Install".
43+
4. Follow on-screen prompts. If a restart is required after enabling Windows features, restart and re-run the installer.
44+
5. When all checks pass, BUDA Runner will be installed and ready to use.
45+
46+
## UI overview
47+
48+
- `Install`
49+
- Starts the full check-and-install sequence described above.
50+
- `Exit`
51+
- Closes the application. A confirmation dialog is shown. The same confirmation appears when closing the window via the system close button (X).
52+
- `Open Log`
53+
- Opens the current debug log file in your system�s default editor.
54+
55+
The main view shows a list of steps with a status icon and text updated as the installer runs.
56+
57+
## Logging and support
58+
59+
- Debug logging is enabled by default.
60+
- Click `Open Log` to view the current log file.
61+
- If an error occurs, the app can help you open a pre-filled GitHub issue. Attach the log file to help with troubleshooting.
62+
- Report issues here: https://github.com/BOINC/boinc-buda-runner-wsl-installer/issues
63+
64+
## Network endpoints used
65+
66+
- GitHub Releases API to check for updates to this installer.
67+
- Official sources to download WSL and BUDA Runner artifacts when needed.
68+
69+
## Build from source
70+
71+
Prerequisites:
72+
- Windows 10/11
73+
- Visual Studio 2022 with the ".NET desktop development" workload
74+
- .NET Framework 4.8 Developer Pack
75+
76+
Steps:
77+
- Clone this repository
78+
- Open the solution/project in Visual Studio 2022
79+
- Build and run the `boinc-buda-runner-wsl-installer` project
80+
81+
Project notes:
82+
- Language version: C# 7.3
83+
- UI: WPF
84+
85+
## Limitations
86+
87+
- The installer does not self-update. When a newer installer is available, you�ll be informed and can download it from the Releases page.
88+
- If BOINC is running, installation is paused until the user stops BOINC.
89+
90+
## Contributing
91+
92+
Contributions are welcome!
93+
- Open issues for bugs and feature requests: https://github.com/BOINC/boinc-buda-runner-wsl-installer/issues
94+
- Submit pull requests with clear descriptions and testing notes.
95+
96+
## License
97+
98+
This project is licensed under the GNU Lesser General Public License v3.0 or later (LGPL-3.0-or-later).
99+
100+
- SPDX: LGPL-3.0-or-later
101+
- Full text: https://www.gnu.org/licenses/lgpl-3.0.html
102+
103+
## Acknowledgements
104+
105+
- BOINC community © https://boinc.berkeley.edu
106+
- Microsoft WSL © https://learn.microsoft.com/windows/wsl/

0 commit comments

Comments
 (0)