From e179d42264402635ed986bb26e8a626689bc8360 Mon Sep 17 00:00:00 2001 From: vahook Date: Sat, 2 Aug 2025 13:27:49 +0200 Subject: [PATCH 1/5] Fix typo --- win-build.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win-build.bat b/win-build.bat index aecd850a693..02022d7e93c 100644 --- a/win-build.bat +++ b/win-build.bat @@ -45,7 +45,7 @@ IF /i [%2] == [Win32] ( set BUILD_PLATFORM=ARM64 ) ELSE ( IF not [%2] == [] ( - echo Invalid first argument %2. Using default platform %BUILD_PLATFORM%. + echo Invalid second argument %2. Using default platform %BUILD_PLATFORM%. ) ) From 72c05bfa91313ca96d6f0d30c163dcb369a26018 Mon Sep 17 00:00:00 2001 From: vahook Date: Sat, 2 Aug 2025 13:29:48 +0200 Subject: [PATCH 2/5] Replace CertUtil with 7za.exe for file hashing --- utils/buildactions/utils.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/buildactions/utils.lua b/utils/buildactions/utils.lua index 6f573f6a481..a270708c04e 100644 --- a/utils/buildactions/utils.lua +++ b/utils/buildactions/utils.lua @@ -96,7 +96,7 @@ function os.sha256_file(path) local windows = os.host() == "windows" local s, errc if windows then - s, errc = os.outputof(string.format("CertUtil -hashfile \"%s\" SHA256", path)) + s, errc = os.outputof(string.format("utils\\7z\\7za.exe h -scrcSHA256 \"%s\"", path)) else s, errc = os.outputof(string.format("sha256sum \"%s\" | awk '{ print $1 }'", path)) end @@ -109,7 +109,7 @@ function os.sha256_file(path) -- Clean windows output if windows then - s = (s:match("\n(.*)\n(.*)") or ""):gsub(" ", "") + s = (s:match("SHA256 for data: +([^\n]*)") or "") end return s:lower() From ce10c249861189302e9cc50664ea1302eb04bf29 Mon Sep 17 00:00:00 2001 From: vahook Date: Sat, 2 Aug 2025 13:43:33 +0200 Subject: [PATCH 3/5] Add a separate build script for building the project using msvc-wine Running win-build.bat inside Wine would be impractical, since the msbuild wrapper script shipped by msvc-wine cannot properly set up the environment variables if invoked from within Wine. --- wine-build.sh | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 wine-build.sh diff --git a/wine-build.sh b/wine-build.sh new file mode 100755 index 00000000000..f26b6ea1d00 --- /dev/null +++ b/wine-build.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +if [ -z "$MSBUILDPATH" ]; then + echo "Could not find MSBuild. Make sure the MSBUILDPATH environment variable points" + echo "to either MSBuild.exe or a script that handles the invocation of MSBuild.exe." + exit 1 +fi +echo "Found MSBuild at: $MSBUILDPATH" + +BUILD_CONFIGURATION=Release +BUILD_PLATFORM=Win32 + +# Read configuration (1st parameter) +case ${1,,} in + debug) BUILD_CONFIGURATION=Debug ;; + release) BUILD_CONFIGURATION=Release ;; + "") ;; + *) echo "Invalid first argument $1. Using default configuration $BUILD_CONFIGURATION." ;; +esac + +# Read platform (2nd parameter) +case ${2,,} in + win32) BUILD_PLATFORM=Win32 ;; + x64) BUILD_PLATFORM=x64 ;; + arm) BUILD_PLATFORM=ARM ;; + arm64) BUILD_PLATFORM=ARM64 ;; + "") ;; + *) echo "Invalid second argument $2. Using default platform $BUILD_PLATFORM." ;; +esac + +echo "Build configuration:" +echo " BUILD_CONFIGURATION = $BUILD_CONFIGURATION" +echo " BUILD_PLATFORM = $BUILD_PLATFORM" + +# Create solution (ignoring pause) +wine win-create-projects.bat < /dev/null +echo "" + +# Start compiling +"$MSBUILDPATH" Build/MTASA.sln -property:Configuration="$BUILD_CONFIGURATION" -property:Platform="$BUILD_PLATFORM" -maxCpuCount \ No newline at end of file From 424c59025b814b8c4433e4486dee90ab50f904d1 Mon Sep 17 00:00:00 2001 From: vahook Date: Sat, 2 Aug 2025 14:06:33 +0200 Subject: [PATCH 4/5] Update wine-build.sh with a hint about where to find msbuild --- wine-build.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wine-build.sh b/wine-build.sh index f26b6ea1d00..58022d56caf 100755 --- a/wine-build.sh +++ b/wine-build.sh @@ -3,6 +3,8 @@ if [ -z "$MSBUILDPATH" ]; then echo "Could not find MSBuild. Make sure the MSBUILDPATH environment variable points" echo "to either MSBuild.exe or a script that handles the invocation of MSBuild.exe." + echo "" + echo "If using msvc-wine, it should point to /path/to/msvc-wine-install-dir/bin/x64/msbuild" exit 1 fi echo "Found MSBuild at: $MSBUILDPATH" From 7f8c057a61ed1286a573612c23161e2c65458b33 Mon Sep 17 00:00:00 2001 From: vahook Date: Sat, 2 Aug 2025 16:55:54 +0200 Subject: [PATCH 5/5] Fix 7za.exe invocation on Windows --- utils/buildactions/utils.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/buildactions/utils.lua b/utils/buildactions/utils.lua index a270708c04e..233ebb39252 100644 --- a/utils/buildactions/utils.lua +++ b/utils/buildactions/utils.lua @@ -96,7 +96,7 @@ function os.sha256_file(path) local windows = os.host() == "windows" local s, errc if windows then - s, errc = os.outputof(string.format("utils\\7z\\7za.exe h -scrcSHA256 \"%s\"", path)) + s, errc = os.outputof(string.format("call \"utils\\7z\\7za.exe\" h -scrcSHA256 \"%s\"", path)) else s, errc = os.outputof(string.format("sha256sum \"%s\" | awk '{ print $1 }'", path)) end