diff options
| -rw-r--r-- | WINDOWS_GUIDE.txt | 4 | ||||
| -rw-r--r-- | build.ps1 | 6 | ||||
| -rw-r--r-- | res/windows_bats/start_fake.bat | 40 |
3 files changed, 49 insertions, 1 deletions
diff --git a/WINDOWS_GUIDE.txt b/WINDOWS_GUIDE.txt new file mode 100644 index 0000000..8afca84 --- /dev/null +++ b/WINDOWS_GUIDE.txt @@ -0,0 +1,4 @@ +DPIBreak Windows users' guide + +- Double click start_fake.bat to run with fake mode (see --fake part of + dpibreak.1.md for more information) @@ -66,7 +66,8 @@ $DistElems = @( "README.md", "dpibreak.1.md" "CHANGELOG", - "COPYING" + "COPYING", + "WINDOWS_GUIDE.txt" ) # --- Function Definitions --- @@ -144,6 +145,9 @@ function New-ReleaseZip { Copy-Item -Path $sourcePath -Destination $destinationPath } + # Copy windows start scripts (for release) + Copy-Item (Join-Path $PSScriptRoot "res\windows_bats\*") -Destination $DistPath -Recurse -Force + # 4. Compress files into a ZIP archive Write-Host "Compressing files into '$ZipBallPath'..." Push-Location -Path $DistDir diff --git a/res/windows_bats/start_fake.bat b/res/windows_bats/start_fake.bat new file mode 100644 index 0000000..caf5c20 --- /dev/null +++ b/res/windows_bats/start_fake.bat @@ -0,0 +1,40 @@ +@echo off +setlocal EnableExtensions + +set "ARGS=--fake --fake-ttl 8" + +set "EXE=%~dp0dpibreak.exe" +set "BAT=%0" + +if not exist "%EXE%" ( + echo [ERROR] "%EXE%" not found. + pause + exit /b 1 +) + +net session >nul 2>&1 +if %errorlevel%==0 goto :run + +echo Requesting administrator privileges... +powershell -NoProfile -ExecutionPolicy Bypass ^ + -Command "Start-Process -FilePath '%~f0' -ArgumentList 'ELEVATED' -Verb RunAs" +exit /b + +:run + +rem ===Admin=== + +if /I "%~1"=="ELEVATED" shift + +echo Running: "%EXE%" %ARGS% +echo Note: If you want to change args (like --fake-ttl) modify ARGS= line of %BAT%. +echo( + +pushd "%~dp0" +"%EXE%" %ARGS% +set "RC=%ERRORLEVEL%" +popd + +echo Exit code: %RC% +pause +exit /b %RC% |
