From d64acaab9591a95a8bad4e24524cdb988a1daae8 Mon Sep 17 00:00:00 2001 From: ThisIsDara <1380katana@gmail.com> Date: Mon, 4 May 2026 08:09:39 +0330 Subject: [PATCH] Add build.bat, run.bat, and update .gitignore --- .gitignore | 4 ++-- build.bat | 43 +++++++++++++++++++++++++++++++++++++++++++ run.bat | 29 +++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 build.bat create mode 100644 run.bat diff --git a/.gitignore b/.gitignore index 1ad5917..c9ed995 100644 --- a/.gitignore +++ b/.gitignore @@ -12,7 +12,6 @@ Thumbs.db *.coff v1.0/ build*.ps1 -build*.bat icon.c stub.c inject_icon.c @@ -20,4 +19,5 @@ inject_icon.exe main.a build_hook.go *.md -!LICENSE \ No newline at end of file +!LICENSE +!.bat \ No newline at end of file diff --git a/build.bat b/build.bat new file mode 100644 index 0000000..9869163 --- /dev/null +++ b/build.bat @@ -0,0 +1,43 @@ +@echo off +setlocal enabledelayedexpansion + +set "SCRIPT_DIR=%~dp0" +cd /d "%SCRIPT_DIR%" + +echo ======================================== +echo MHR-CFW Go Builder +echo ======================================== +echo. + +if not exist "go.mod" ( + echo Error: go.mod not found. Make sure you are in the project directory. + pause + exit /b 1 +) + +echo Building mhr-cfw-go.exe... +echo. + +go build -ldflags "-s -w" -o mhr-cfw-go.exe ./cmd/mhr-cfw + +if errorlevel 1 ( + echo. + echo Build FAILED! + pause + exit /b 1 +) + +echo. +echo Build successful: mhr-cfw-go.exe +echo. + +if exist "ivk.ico" ( + echo Adding icon... + echo Note: Icon injection requires inject_icon.exe (run separately if needed) +) + +echo. +echo ======================================== +echo Done! Run with: mhr-cfw-go.exe +echo ======================================== +pause \ No newline at end of file diff --git a/run.bat b/run.bat new file mode 100644 index 0000000..c9213d2 --- /dev/null +++ b/run.bat @@ -0,0 +1,29 @@ +@echo off +setlocal enabledelayedexpansion + +set "SCRIPT_DIR=%~dp0" +cd /d "%SCRIPT_DIR%" + +echo ======================================== +echo MHR-CFW Go +echo ======================================== +echo. + +if not exist "mhr-cfw-go.exe" ( + echo Error: mhr-cfw-go.exe not found. + echo Run build.bat first to build the executable. + pause + exit /b 1 +) + +echo Starting proxy server... +echo. +echo Default: http://127.0.0.1:8080 +echo. +echo Press Ctrl+C to stop. +echo ======================================== +echo. + +mhr-cfw-go.exe %* + +pause \ No newline at end of file