Skip to content

Commit c4a8546

Browse files
committed
Make Windows game sessions safe and reversible
Preserve competitive game, anti-cheat, voice and security processes by default. Track original power and Game Mode values for session restoration, report failed or unknown operations, and require explicit process selection. Add portable Windows packaging, game presets, read-only diagnostics and GUI checks. Publish version 1.1.0 through the release workflow. Tested: cargo fmt --all -- --check Tested: cargo clippy --locked --offline --all-targets --release -- -D warnings Tested: cargo test --locked --offline --release (38 passed) Tested: packaged GUI smoke and launcher (5 pages, exit 0) Limit: in-game FPS and anti-cheat compatibility were not measured
1 parent 935a1b7 commit c4a8546

36 files changed

Lines changed: 3661 additions & 1797 deletions

‎.github/workflows/ci.yml‎

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
name: CI
22

3-
# Verify the project builds and passes checks on every push and pull request.
43
on:
54
push:
65
branches: [main, master]
76
pull_request:
87
branches: [main, master]
98

9+
permissions:
10+
contents: read
11+
1012
jobs:
1113
build:
1214
runs-on: windows-latest
@@ -26,10 +28,42 @@ jobs:
2628
run: cargo fmt --all -- --check
2729

2830
- name: Clippy
29-
run: cargo clippy --release -- -W clippy::all
30-
31-
- name: Build
32-
run: cargo build --release
31+
run: cargo clippy --locked --all-targets --release -- -W clippy::all
3332

3433
- name: Test
35-
run: cargo test --release
34+
run: cargo test --locked --release
35+
36+
- name: Build release binary
37+
run: cargo build --locked --release
38+
39+
- name: Read-only diagnostics smoke test
40+
shell: pwsh
41+
run: |
42+
$reportDir = Join-Path $env:RUNNER_TEMP 'game-accelerator-diagnostics'
43+
New-Item -ItemType Directory -Path $reportDir -Force | Out-Null
44+
$reportPath = Join-Path $reportDir 'diagnostics.toml'
45+
$arguments = '--config-dir "{0}" --diagnose "{1}"' -f $reportDir, $reportPath
46+
$process = Start-Process -FilePath '.\target\release\game-accelerator.exe' -ArgumentList $arguments -WindowStyle Hidden -Wait -PassThru
47+
if ($process.ExitCode -ne 0) {
48+
throw "Diagnostics failed with exit code $($process.ExitCode)."
49+
}
50+
if (-not (Test-Path -LiteralPath $reportPath -PathType Leaf)) {
51+
throw 'Diagnostics did not create the expected report.'
52+
}
53+
if ((Get-Item -LiteralPath $reportPath).Length -eq 0) {
54+
throw 'The diagnostic report is empty.'
55+
}
56+
57+
- name: Package portable app
58+
shell: pwsh
59+
run: .\scripts\build-local.ps1 -SkipBuild
60+
61+
- name: Upload portable package
62+
uses: actions/upload-artifact@v4
63+
with:
64+
name: GameAccelerator-windows-x64
65+
path: |
66+
dist/GameAccelerator-*-windows-x64.zip
67+
dist/GameAccelerator-*-windows-x64.zip.sha256
68+
dist/GameAccelerator/SHA256SUMS.txt
69+
if-no-files-found: error

‎.github/workflows/release.yml‎

Lines changed: 53 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
name: Release
22

3-
# Build the release exe and publish it to GitHub Releases whenever a version
4-
# tag (e.g. v1.0.0) is pushed.
53
on:
64
push:
75
tags:
@@ -19,15 +17,66 @@ jobs:
1917

2018
- name: Install Rust toolchain
2119
uses: dtolnay/rust-toolchain@stable
20+
with:
21+
components: clippy, rustfmt
2222

2323
- name: Cache cargo
2424
uses: Swatinem/rust-cache@v2
2525

26+
- name: Check release version
27+
shell: pwsh
28+
run: |
29+
$metadataJson = cargo metadata --locked --no-deps --format-version 1
30+
if ($LASTEXITCODE -ne 0) {
31+
throw "cargo metadata failed with exit code $LASTEXITCODE."
32+
}
33+
$metadata = $metadataJson | ConvertFrom-Json
34+
$package = $metadata.packages | Where-Object { $_.name -eq 'game-accelerator' }
35+
if ($env:GITHUB_REF_NAME -ne "v$($package.version)") {
36+
throw "Release tag $env:GITHUB_REF_NAME does not match Cargo version $($package.version)."
37+
}
38+
39+
- name: Check formatting
40+
run: cargo fmt --all -- --check
41+
42+
- name: Clippy
43+
run: cargo clippy --locked --all-targets --release -- -W clippy::all
44+
45+
- name: Test
46+
run: cargo test --locked --release
47+
2648
- name: Build release binary
27-
run: cargo build --release
49+
run: cargo build --locked --release
50+
51+
- name: Read-only diagnostics smoke test
52+
shell: pwsh
53+
run: |
54+
$reportDir = Join-Path $env:RUNNER_TEMP 'game-accelerator-diagnostics'
55+
New-Item -ItemType Directory -Path $reportDir -Force | Out-Null
56+
$reportPath = Join-Path $reportDir 'diagnostics.toml'
57+
$arguments = '--config-dir "{0}" --diagnose "{1}"' -f $reportDir, $reportPath
58+
$process = Start-Process -FilePath '.\target\release\game-accelerator.exe' -ArgumentList $arguments -WindowStyle Hidden -Wait -PassThru
59+
if ($process.ExitCode -ne 0) {
60+
throw "Diagnostics failed with exit code $($process.ExitCode)."
61+
}
62+
if (-not (Test-Path -LiteralPath $reportPath -PathType Leaf)) {
63+
throw 'Diagnostics did not create the expected report.'
64+
}
65+
if ((Get-Item -LiteralPath $reportPath).Length -eq 0) {
66+
throw 'The diagnostic report is empty.'
67+
}
68+
69+
- name: Package portable app
70+
shell: pwsh
71+
run: .\scripts\build-local.ps1 -SkipBuild
2872

2973
- name: Upload to GitHub Release
3074
uses: softprops/action-gh-release@v2
3175
with:
32-
files: target/release/game-accelerator.exe
76+
files: |
77+
dist/GameAccelerator/game-accelerator.exe
78+
dist/GameAccelerator-*-windows-x64.zip
79+
dist/GameAccelerator-*-windows-x64.zip.sha256
80+
dist/GameAccelerator/SHA256SUMS.txt
81+
fail_on_unmatched_files: true
3382
generate_release_notes: true

‎Cargo.lock‎

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "game-accelerator"
3-
version = "1.0.0"
3+
version = "1.1.0"
44
edition = "2021"
55
description = "Lightweight game booster for Windows"
66
authors = ["mi"]
@@ -22,12 +22,19 @@ serde = { version = "1", features = ["derive"] }
2222
toml = "0.8"
2323
parking_lot = "0.12"
2424
dirs-next = "2.0"
25+
image = { version = "0.25", default-features = false, features = ["png"] }
2526

2627
[target.'cfg(windows)'.dependencies]
2728
windows-sys = { version = "0.59", features = [
2829
"Win32_Foundation",
30+
"Win32_Globalization",
2931
"Win32_System_Threading",
3032
"Win32_System_ProcessStatus",
33+
"Win32_Security",
34+
"Win32_System_Registry",
35+
"Win32_System_Services",
36+
"Win32_UI_Shell",
37+
"Win32_UI_WindowsAndMessaging",
3138
] }
3239

3340
[target.'cfg(windows)'.build-dependencies]

0 commit comments

Comments
 (0)