From bfe6b69edde61ccc2ce9f4b983206f9488080d4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BE=89=E9=B8=AD=E8=9B=8B?= Date: Tue, 17 Sep 2024 12:24:58 +0800 Subject: [PATCH] fix build bat --- BetterGenshinImpact/BetterGenshinImpact.csproj | 2 +- Build/setup_build.cmd | 15 +++++---------- Build/setup_build_for_appveyor.cmd | 15 +++++---------- 3 files changed, 11 insertions(+), 21 deletions(-) diff --git a/BetterGenshinImpact/BetterGenshinImpact.csproj b/BetterGenshinImpact/BetterGenshinImpact.csproj index ca127947..18d92c1c 100644 --- a/BetterGenshinImpact/BetterGenshinImpact.csproj +++ b/BetterGenshinImpact/BetterGenshinImpact.csproj @@ -10,7 +10,7 @@ true Assets\logo.ico BetterGI - 0.34.1 + 0.34.2 x64 diff --git a/Build/setup_build.cmd b/Build/setup_build.cmd index f3d83d79..9788ed9e 100644 --- a/Build/setup_build.cmd +++ b/Build/setup_build.cmd @@ -6,16 +6,11 @@ mkdir dist\BetterGI for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath`) do set "path=%path%;%%i\MSBuild\Current\Bin;%%i\Common7\IDE" @echo [prepare version] -cd /d ..\BetterGenshinImpact\Core\Config -set "script=Get-Content 'Global.cs' ^| Select-String -Pattern 'Version.*\"(.*)\"' ^| ForEach-Object { $_.Matches.Groups[1].Value }" - -for /f "usebackq delims=" %%i in (`powershell -NoLogo -NoProfile -Command ^"%script%^"`) do set version=%%i - -echo currnet version is %version% - -if "%b%"=="" ( - set "b=%version%" -) +cd /d ..\BetterGenshinImpact +set "script=Get-Content 'BetterGenshinImpact.csproj' | Select-String -Pattern 'AssemblyVersion\>(.*)\<\/AssemblyVersion' | ForEach-Object { $_.Matches.Groups[1].Value }" +for /f "usebackq delims=" %%i in (`powershell -NoLogo -NoProfile -Command "%script%"`) do set version=%%i +echo current version is %version% +if "%b%"=="" ( set "b=%version%" ) set "tmpfolder=%~dp0dist\BetterGI" set "archiveFile=BetterGI_v%b%.7z" diff --git a/Build/setup_build_for_appveyor.cmd b/Build/setup_build_for_appveyor.cmd index 76827fa8..b0f8e36e 100644 --- a/Build/setup_build_for_appveyor.cmd +++ b/Build/setup_build_for_appveyor.cmd @@ -6,16 +6,11 @@ mkdir dist\BetterGI for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath`) do set "path=%path%;%%i\MSBuild\Current\Bin;%%i\Common7\IDE" @echo [prepare version] -cd /d ..\BetterGenshinImpact\Core\Config -set "script=Get-Content 'Global.cs' ^| Select-String -Pattern 'Version.*\"(.*)\"' ^| ForEach-Object { $_.Matches.Groups[1].Value }" - -for /f "usebackq delims=" %%i in (`powershell -NoLogo -NoProfile -Command ^"%script%^"`) do set version=%%i - -echo currnet version is %version% - -if "%b%"=="" ( - set "b=%version%" -) +cd /d ..\BetterGenshinImpact +set "script=Get-Content 'BetterGenshinImpact.csproj' | Select-String -Pattern 'AssemblyVersion\>(.*)\<\/AssemblyVersion' | ForEach-Object { $_.Matches.Groups[1].Value }" +for /f "usebackq delims=" %%i in (`powershell -NoLogo -NoProfile -Command "%script%"`) do set version=%%i +echo current version is %version% +if "%b%"=="" ( set "b=%version%" ) set "tmpfolder=%~dp0dist\BetterGI" set "archiveFile=BetterGI_v%b%.7z"