Improve build scripts and move them to scripts/

This commit is contained in:
Kamil Trzciński 2022-11-26 13:54:20 +01:00
parent 5d653a3342
commit 43abc56a41
9 changed files with 100 additions and 28 deletions

3
.gitignore vendored
View file

@ -2,5 +2,6 @@ bin/
obj/
/.vs/
*.user
build-release/
build-Release/
build-Debug/
.vscode/

View file

@ -217,7 +217,7 @@ to make `SteamController.exe` the one mapping those.
1. In a new window click `DELETE`.
1. Now click `B` or `DONE`.
## 4. Risks
## 5. Risks
**This software is provided on best-effort basis and can break your SteamDeck.** It does a direct manipulation
of kernel memory to control usage the EC (Embedded Controller) and setting desired fan RPM via VLV0100
@ -231,7 +231,7 @@ The memory addresses used are hardcoded and can be changed any moment by the Bio
Fortunately quite amount of people are using it with a success and no problems observed.
However, you should be aware of the consequences.
### 4.1. Risk of CPU and GPU frequency change
### 5.1. Risk of CPU and GPU frequency change
The APU manipulation of CPU and GPU frequency uses a ported implementation from Linux kernel.
It is more unstable than Fan Control (since the Fan Control is controller managing EC on Windows).
@ -242,7 +242,7 @@ power shutdown the device. Disconnect from charging, and hold power button for a
Power device normally afterwards. This is rather unlikely to break the device if done right
after when such event occurs.
## 5. Anti-Cheat and Antivirus software
## 6. Anti-Cheat and Antivirus software
Since this project uses direct manipulation of kernel memory via `inpoutx64.dll`
it might trigger Antivirus and Anti-Cheat software.
@ -250,6 +250,12 @@ it might trigger Antivirus and Anti-Cheat software.
You might consider disabling all tools if this happens. Unfortunatelly there's no worakound for that
unless someone gets access to driver signing certificate for Windows.
## 7. Development
It should be enough to run `scripts/build.bat` to see binaries in `build-release/`.
You might also run `scripts/test_debug.bat` which will build and run built version.
## Author
Kamil Trzciński, 2022

View file

@ -4,6 +4,7 @@
- Fix `FanControl` broken context menu
- Fix incorrect `CurrentProfile` of `SteamController`
- Fix right stick serving as mouse in `X360` mode
- Improve build scripts in `scripts/`
## 0.4.x

View file

@ -1,24 +0,0 @@
#!/bin/bash
if [[ $# -ne 0 ]] && [[ $# -ne 1 ]]; then
echo "usage: $0 [output_path]"
exit 1
fi
set -eo pipefail
majorVer=$(cat VERSION)
lastVer=$(git tag --sort version:refname --list "$majorVer.*" | tail -n1)
if [[ -n "$lastVer" ]]; then
newVer=(${lastVer//./ })
newVer[-1]="$((${newVer[-1]}+1))"
nextVer="${newVer[*]}"
nextVer="${nextVer// /.}"
else
nextVer="$majorVer.0"
fi
echo "MajorVer=$majorVer LastVer=$lastVer NextVer=$nextVer"
args="--configuration Release /property:Version=$nextVer"
dotnet build $args --output "${1:-build-release/}"

2
scripts/build.bat Normal file
View file

@ -0,0 +1,2 @@
powershell -ExecutionPolicy UnRestricted -File "%~dp0\build.ps1"
timeout /t 5

31
scripts/build.ps1 Normal file
View file

@ -0,0 +1,31 @@
cd "$PSScriptRoot/.."
$configuration = "Release"
if ($args[0]) {
$configuration = $args[0]
}
$path = "build-$configuration"
if ($args[1]) {
$path = $args[1]
}
$majorVer = Get-Content VERSION
$lastVer = git tag --sort version:refname --list "$majorVer.*" | Select -last 1
echo "Configuration: $configuration"
echo "BuildPath: $path"
echo "Major: $majorVer"
echo "lastVer: $lastVer"
if ($lastVer -ne "") {
$nextVer = $lastVer.Split('.')
$lastItem = $nextVer.Length-1
$nextVer[$lastItem] = [int]$nextVer[$lastItem] + 1
$nextVer = $nextVer -Join '.'
} else {
$nextVer="$majorVer.0"
}
dotnet --list-sdks -or winget install Microsoft.DotNet.SDK.6
dotnet build --configuration "$configuration" "/property:Version=$nextVer" --output "$path"

15
scripts/run_loop.bat Normal file
View file

@ -0,0 +1,15 @@
if not "%1"=="am_admin" (powershell start -verb runas '%0' 'am_admin,%1' & exit /b)
if "%2"=="" (echo missing name & timeout /t 3 & exit /b)
cd "%~dp0"
:retry
taskkill /F /IM "%1.exe"
del %1\bin\Debug\net6.0-windows\%1.exe
dotnet build
%1\bin\Debug\net6.0-windows\%1.exe
timeout /t 3
goto retry

20
scripts/test_debug.bat Normal file
View file

@ -0,0 +1,20 @@
if not "%1"=="am_admin" (powershell start -verb runas '%0' am_admin & exit /b)
:retry
cd "%~dp0"
set configuration=Debug
taskkill /F /IM FanControl.exe
taskkill /F /IM PerformanceOverlay.exe
taskkill /F /IM PowerControl.exe
taskkill /F /IM SteamController.exe
powershell -ExecutionPolicy UnRestricted -File "%~dp0\build.ps1" "%configuration%"
start ..\build-%configuration%\FanControl.exe
start ..\build-%configuration%\PerformanceOverlay.exe
start ..\build-%configuration%\PowerControl.exe
start ..\build-%configuration%\SteamController.exe
timeout /t 5

20
scripts/test_release.bat Normal file
View file

@ -0,0 +1,20 @@
if not "%1"=="am_admin" (powershell start -verb runas '%0' am_admin & exit /b)
:retry
cd "%~dp0"
set configuration=Debug
taskkill /F /IM FanControl.exe
taskkill /F /IM PerformanceOverlay.exe
taskkill /F /IM PowerControl.exe
taskkill /F /IM SteamController.exe
powershell -ExecutionPolicy UnRestricted -File "%~dp0\build.ps1" "%configuration%"
start ..\build-%configuration%\FanControl.exe
start ..\build-%configuration%\PerformanceOverlay.exe
start ..\build-%configuration%\PowerControl.exe
start ..\build-%configuration%\SteamController.exe
timeout /t 5