From 4cdb1f47c8347bd501a0493805fc5984b7ddfca7 Mon Sep 17 00:00:00 2001 From: ge0rdi Date: Sun, 31 May 2026 17:46:56 +0200 Subject: [PATCH] Split build steps into binaries, installers, archives --- .github/workflows/build.yml | 39 ++++++++-- Src/Setup/BuildArchives.bat | 144 ++++++++++++++++++++++++++++++++++- Src/Setup/BuildBinaries.bat | 121 ++--------------------------- Src/Setup/BuildInstaller.bat | 30 ++------ Src/Setup/_BuildEnglish.bat | 3 + Src/Setup/_Version.bat | 9 +++ 6 files changed, 201 insertions(+), 145 deletions(-) create mode 100644 Src/Setup/_Version.bat diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f6b1819..0ec349f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -53,16 +53,45 @@ jobs: "NEW_VERSION=$finalVersion" | Out-File -FilePath $env:GITHUB_OUTPUT -Append Write-Host "Building version: $finalVersion" - - name: Build + - name: Build binaries shell: cmd env: - APPVEYOR_BUILD_VERSION: ${{ steps.versioning.outputs.NEW_VERSION }} - run: Src\Setup\__MakeFinal.bat + CS_VERSION: ${{ steps.versioning.outputs.NEW_VERSION }} + run: Src\Setup\BuildBinaries.bat - - name: Upload artifacts + - name: Upload binaries uses: actions/upload-artifact@v7 with: - name: OpenShell + name: Binaries + path: | + Src/Setup/Output/ + !Src/Setup/Output/*.skin + !Src/Setup/Output/*.skin7 + !Src/Setup/Output/*.zip + + - name: Build installers + shell: cmd + env: + CS_VERSION: ${{ steps.versioning.outputs.NEW_VERSION }} + run: Src\Setup\_BuildEnglish.bat + + - name: Upload installers + uses: actions/upload-artifact@v7 + with: + name: MSI + path: | + Src/Setup/Temp/*.msi + + - name: Build final + shell: cmd + env: + CS_VERSION: ${{ steps.versioning.outputs.NEW_VERSION }} + run: Src\Setup\BuildArchives.bat + + - name: Upload final + uses: actions/upload-artifact@v7 + with: + name: Final path: | Src/Setup/Final/ !Src/Setup/Final/OpenShellLoc.zip diff --git a/Src/Setup/BuildArchives.bat b/Src/Setup/BuildArchives.bat index b3000d7..d28efec 100644 --- a/Src/Setup/BuildArchives.bat +++ b/Src/Setup/BuildArchives.bat @@ -1,5 +1,145 @@ +@echo off +set PATH=C:\Program Files\7-Zip\;%PATH% +cd %~dp0 + +call _Version.bat + +REM ********* Build MSI Checksums +echo --- MSI Checksums +..\..\build\bin\Release\Utility.exe crcmsi Temp +@if ERRORLEVEL 1 exit /b 1 + +REM ********* Build bootstrapper +echo --- Bootstrapper +for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.Component.MSBuild -property installationPath`) do set MSBuildDir=%%i\MSBuild\Current\Bin\ + +"%MSBuildDir%MSBuild.exe" Setup.sln /m /t:Rebuild /p:Configuration="Release" /p:Platform="Win32" /verbosity:quiet /nologo +@if ERRORLEVEL 1 exit /b 1 + + +if exist Final rd /Q /S Final +md Final + +copy /B ..\..\build\bin\Release\Setup.exe Final\OpenShellSetup_%CS_VERSION_STR%.exe > nul + +if defined APPVEYOR ( + appveyor PushArtifact Final\OpenShellSetup_%CS_VERSION_STR%.exe +) + REM ***** Collect PDBs +REM ********* Collect debug info +md Output\PDB32 +md Output\PDB64 +md Output\PDBARM64 + +REM Explorer 32 +copy /B ..\..\build\bin\Setup\ClassicExplorer32.pdb Output\PDB32 > nul +copy /B Output\ClassicExplorer32.dll Output\PDB32 > nul +copy /B ..\..\build\bin\Setup\ClassicExplorerSettings.pdb Output\PDB32 > nul +copy /B Output\ClassicExplorerSettings.exe Output\PDB32 > nul + +REM Explorer 64 +copy /B ..\..\build\bin\Setup64\ClassicExplorer64.pdb Output\PDB64 > nul +copy /B Output\x64\ClassicExplorer64.dll Output\PDB64 > nul + +REM Explorer ARM64 +copy /B ..\..\build\bin\SetupARM64\ClassicExplorer64.pdb Output\PDBARM64 > nul +copy /B Output\ARM64\ClassicExplorer64.dll Output\PDBARM64 > nul + +REM IE 32 +copy /B ..\..\build\bin\Setup\ClassicIEDLL_32.pdb Output\PDB32 > nul +copy /B Output\ClassicIEDLL_32.dll Output\PDB32 > nul +copy /B ..\..\build\bin\Setup\ClassicIE_32.pdb Output\PDB32 > nul +copy /B Output\ClassicIE_32.exe Output\PDB32 > nul + +REM IE 64 +copy /B ..\..\build\bin\Setup64\ClassicIEDLL_64.pdb Output\PDB64 > nul +copy /B Output\x64\ClassicIEDLL_64.dll Output\PDB64 > nul +copy /B ..\..\build\bin\Setup64\ClassicIE_64.pdb Output\PDB64 > nul +copy /B Output\x64\ClassicIE_64.exe Output\PDB64 > nul + +REM IE ARM64 +copy /B ..\..\build\bin\SetupARM64\ClassicIEDLL_64.pdb Output\PDBARM64 > nul +copy /B Output\ARM64\ClassicIEDLL_64.dll Output\PDBARM64 > nul +copy /B ..\..\build\bin\SetupARM64\ClassicIE_64.pdb Output\PDBARM64 > nul +copy /B Output\ARM64\ClassicIE_64.exe Output\PDBARM64 > nul + +REM Menu 32 +copy /B ..\..\build\bin\Setup\StartMenu.pdb Output\PDB32 > nul +copy /B Output\StartMenu.exe Output\PDB32 > nul +copy /B ..\..\build\bin\Setup\StartMenuDLL.pdb Output\PDB32 > nul +copy /B Output\StartMenuDLL.dll Output\PDB32 > nul +copy /B ..\..\build\bin\Setup\StartMenuHelper32.pdb Output\PDB32 > nul +copy /B Output\StartMenuHelper32.dll Output\PDB32 > nul +copy /B ..\..\build\bin\Release\Update.pdb Output\PDB32 > nul +copy /B Output\Update.exe Output\PDB32 > nul +copy /B ..\..\build\bin\Release\DesktopToasts.pdb Output\PDB32 > nul +copy /B Output\DesktopToasts.dll Output\PDB32 > nul + +REM Menu 64 +copy /B ..\..\build\bin\Setup64\StartMenu.pdb Output\PDB64 > nul +copy /B Output\x64\StartMenu.exe Output\PDB64 > nul +copy /B ..\..\build\bin\Setup64\StartMenuDLL.pdb Output\PDB64 > nul +copy /B Output\x64\StartMenuDLL.dll Output\PDB64 > nul +copy /B ..\..\build\bin\Setup64\StartMenuHelper64.pdb Output\PDB64 > nul +copy /B Output\x64\StartMenuHelper64.dll Output\PDB64 > nul + +REM Menu ARM64 +copy /B ..\..\build\bin\SetupARM64\StartMenu.pdb Output\PDBARM64 > nul +copy /B Output\ARM64\StartMenu.exe Output\PDBARM64 > nul +copy /B ..\..\build\bin\SetupARM64\StartMenuDLL.pdb Output\PDBARM64 > nul +copy /B Output\ARM64\StartMenuDLL.dll Output\PDBARM64 > nul +copy /B ..\..\build\bin\SetupARM64\StartMenuHelper64.pdb Output\PDBARM64 > nul +copy /B Output\ARM64\StartMenuHelper64.dll Output\PDBARM64 > nul + +REM ********* Source Index PDBs + +set PDBSTR_PATH="C:\Program Files (x86)\Windows Kits\10\Debuggers\x86\srcsrv\pdbstr.exe" + +if exist %PDBSTR_PATH% ( + echo --- Adding source index to PDBs + call CreateSourceIndex.bat ..\.. > Output\pdbstr.txt + + for %%f in (Output\PDB32\*.pdb) do ( + %PDBSTR_PATH% -w -p:%%f -s:srcsrv -i:Output\pdbstr.txt + if not ERRORLEVEL 0 ( + echo Error adding source index to PDB + exit /b 1 + ) + ) + + for %%f in (Output\PDB64\*.pdb) do ( + %PDBSTR_PATH% -w -p:%%f -s:srcsrv -i:Output\pdbstr.txt + if not ERRORLEVEL 0 ( + echo Error adding source index to PDB + exit /b 1 + ) + ) + + for %%f in (Output\PDBARM64\*.pdb) do ( + %PDBSTR_PATH% -w -p:%%f -s:srcsrv -i:Output\pdbstr.txt + if not ERRORLEVEL 0 ( + echo Error adding source index to PDB + exit /b 1 + ) + ) +) + +REM ********* Prepare symbols + +set SYMSTORE_PATH="C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\symstore.exe" + +%SYMSTORE_PATH% add /r /f Output\PDB32 /s Output\symbols /t OpenShell -:NOREFS > nul +%SYMSTORE_PATH% add /r /f Output\PDB64 /s Output\symbols /t OpenShell -:NOREFS > nul +%SYMSTORE_PATH% add /r /f Output\PDBARM64 /s Output\symbols /t OpenShell -:NOREFS > nul +rd /Q /S Output\symbols\000Admin > nul +del Output\symbols\pingme.txt > nul + +rd /Q /S Output\PDB32 +rd /Q /S Output\PDB64 +rd /Q /S Output\PDBARM64 + echo -- Creating symbols package set CS_SYMBOLS_NAME=OpenShellSymbols_%CS_VERSION_STR%.7z @@ -20,10 +160,10 @@ cd .. cd Setup -copy /B ..\..\build\bin\Release\Utility.exe .\Final > nul +copy /B Output\Utility.exe .\Final > nul if defined APPVEYOR ( - appveyor PushArtifact ..\..\build\bin\Release\Utility.exe + appveyor PushArtifact Output\Utility.exe ) exit /b 0 diff --git a/Src/Setup/BuildBinaries.bat b/Src/Setup/BuildBinaries.bat index 0241c89..d375c76 100644 --- a/Src/Setup/BuildBinaries.bat +++ b/Src/Setup/BuildBinaries.bat @@ -1,3 +1,8 @@ +@echo off +cd %~dp0 + +call _Version.bat + if exist Output rd /Q /S Output md Output md Output\x64 @@ -50,6 +55,7 @@ copy /B ..\..\build\bin\Setup\StartMenuHelper32.dll Output > nul copy /B ..\..\build\bin\Release\Update.exe Output > nul copy /B ..\..\build\bin\Release\DesktopToasts.dll Output > nul copy /B ..\..\build\bin\Release\SetupHelper.exe Output > nul +copy /B ..\..\build\bin\Release\Utility.exe Output > nul copy /B ..\..\build\bin\SetupARM64\ClassicExplorer64.dll Output\ARM64 > nul copy /B ..\..\build\bin\SetupARM64\ClassicIEDLL_64.dll Output\ARM64 > nul @@ -82,119 +88,6 @@ copy /B "..\..\build\bin\Skins\Metallic.skin7" Output > nul copy /B "..\..\build\bin\Skins\Immersive.skin" Output > nul copy /B "..\..\build\bin\Skins\Immersive.skin7" Output > nul - -REM ********* Collect debug info -md Output\PDB32 -md Output\PDB64 -md Output\PDBARM64 - -REM Explorer 32 -copy /B ..\..\build\bin\Setup\ClassicExplorer32.pdb Output\PDB32 > nul -copy /B Output\ClassicExplorer32.dll Output\PDB32 > nul -copy /B ..\..\build\bin\Setup\ClassicExplorerSettings.pdb Output\PDB32 > nul -copy /B Output\ClassicExplorerSettings.exe Output\PDB32 > nul - -REM Explorer 64 -copy /B ..\..\build\bin\Setup64\ClassicExplorer64.pdb Output\PDB64 > nul -copy /B Output\x64\ClassicExplorer64.dll Output\PDB64 > nul - -REM Explorer ARM64 -copy /B ..\..\build\bin\SetupARM64\ClassicExplorer64.pdb Output\PDBARM64 > nul -copy /B Output\ARM64\ClassicExplorer64.dll Output\PDBARM64 > nul - -REM IE 32 -copy /B ..\..\build\bin\Setup\ClassicIEDLL_32.pdb Output\PDB32 > nul -copy /B Output\ClassicIEDLL_32.dll Output\PDB32 > nul -copy /B ..\..\build\bin\Setup\ClassicIE_32.pdb Output\PDB32 > nul -copy /B Output\ClassicIE_32.exe Output\PDB32 > nul - -REM IE 64 -copy /B ..\..\build\bin\Setup64\ClassicIEDLL_64.pdb Output\PDB64 > nul -copy /B Output\x64\ClassicIEDLL_64.dll Output\PDB64 > nul -copy /B ..\..\build\bin\Setup64\ClassicIE_64.pdb Output\PDB64 > nul -copy /B Output\x64\ClassicIE_64.exe Output\PDB64 > nul - -REM IE ARM64 -copy /B ..\..\build\bin\SetupARM64\ClassicIEDLL_64.pdb Output\PDBARM64 > nul -copy /B Output\ARM64\ClassicIEDLL_64.dll Output\PDBARM64 > nul -copy /B ..\..\build\bin\SetupARM64\ClassicIE_64.pdb Output\PDBARM64 > nul -copy /B Output\ARM64\ClassicIE_64.exe Output\PDBARM64 > nul - -REM Menu 32 -copy /B ..\..\build\bin\Setup\StartMenu.pdb Output\PDB32 > nul -copy /B Output\StartMenu.exe Output\PDB32 > nul -copy /B ..\..\build\bin\Setup\StartMenuDLL.pdb Output\PDB32 > nul -copy /B Output\StartMenuDLL.dll Output\PDB32 > nul -copy /B ..\..\build\bin\Setup\StartMenuHelper32.pdb Output\PDB32 > nul -copy /B Output\StartMenuHelper32.dll Output\PDB32 > nul -copy /B ..\..\build\bin\Release\Update.pdb Output\PDB32 > nul -copy /B Output\Update.exe Output\PDB32 > nul -copy /B ..\..\build\bin\Release\DesktopToasts.pdb Output\PDB32 > nul -copy /B Output\DesktopToasts.dll Output\PDB32 > nul - -REM Menu 64 -copy /B ..\..\build\bin\Setup64\StartMenu.pdb Output\PDB64 > nul -copy /B Output\x64\StartMenu.exe Output\PDB64 > nul -copy /B ..\..\build\bin\Setup64\StartMenuDLL.pdb Output\PDB64 > nul -copy /B Output\x64\StartMenuDLL.dll Output\PDB64 > nul -copy /B ..\..\build\bin\Setup64\StartMenuHelper64.pdb Output\PDB64 > nul -copy /B Output\x64\StartMenuHelper64.dll Output\PDB64 > nul - -REM Menu ARM64 -copy /B ..\..\build\bin\SetupARM64\StartMenu.pdb Output\PDBARM64 > nul -copy /B Output\ARM64\StartMenu.exe Output\PDBARM64 > nul -copy /B ..\..\build\bin\SetupARM64\StartMenuDLL.pdb Output\PDBARM64 > nul -copy /B Output\ARM64\StartMenuDLL.dll Output\PDBARM64 > nul -copy /B ..\..\build\bin\SetupARM64\StartMenuHelper64.pdb Output\PDBARM64 > nul -copy /B Output\ARM64\StartMenuHelper64.dll Output\PDBARM64 > nul - -REM ********* Source Index PDBs - -set PDBSTR_PATH="C:\Program Files (x86)\Windows Kits\10\Debuggers\x86\srcsrv\pdbstr.exe" - -if exist %PDBSTR_PATH% ( - echo --- Adding source index to PDBs - call CreateSourceIndex.bat ..\.. > Output\pdbstr.txt - - for %%f in (Output\PDB32\*.pdb) do ( - %PDBSTR_PATH% -w -p:%%f -s:srcsrv -i:Output\pdbstr.txt - if not ERRORLEVEL 0 ( - echo Error adding source index to PDB - exit /b 1 - ) - ) - - for %%f in (Output\PDB64\*.pdb) do ( - %PDBSTR_PATH% -w -p:%%f -s:srcsrv -i:Output\pdbstr.txt - if not ERRORLEVEL 0 ( - echo Error adding source index to PDB - exit /b 1 - ) - ) - - for %%f in (Output\PDBARM64\*.pdb) do ( - %PDBSTR_PATH% -w -p:%%f -s:srcsrv -i:Output\pdbstr.txt - if not ERRORLEVEL 0 ( - echo Error adding source index to PDB - exit /b 1 - ) - ) -) - -REM ********* Prepare symbols - -set SYMSTORE_PATH="C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\symstore.exe" - -%SYMSTORE_PATH% add /r /f Output\PDB32 /s Output\symbols /t OpenShell -:NOREFS > nul -%SYMSTORE_PATH% add /r /f Output\PDB64 /s Output\symbols /t OpenShell -:NOREFS > nul -%SYMSTORE_PATH% add /r /f Output\PDBARM64 /s Output\symbols /t OpenShell -:NOREFS > nul -rd /Q /S Output\symbols\000Admin > nul -del Output\symbols\pingme.txt > nul - -rd /Q /S Output\PDB32 -rd /Q /S Output\PDB64 -rd /Q /S Output\PDBARM64 - REM ********* Build ADMX echo --- ADMX if exist Output\PolicyDefinitions.zip ( @@ -209,7 +102,7 @@ cd ..\Localization\English @if ERRORLEVEL 1 exit /b 1 md en-US copy /B *.adml en-US > nul -7z a ..\..\Setup\Output\PolicyDefinitions.zip *.admx en-US\*.adml PolicyDefinitions.rtf > nul +tar -a -c -f ..\..\Setup\Output\PolicyDefinitions.zip *.admx en-US\*.adml PolicyDefinitions.rtf rd /Q /S en-US cd ..\..\Setup diff --git a/Src/Setup/BuildInstaller.bat b/Src/Setup/BuildInstaller.bat index 42d4445..caa67f6 100644 --- a/Src/Setup/BuildInstaller.bat +++ b/Src/Setup/BuildInstaller.bat @@ -1,3 +1,9 @@ +@echo off +set PATH=C:\Program Files (x86)\HTML Help Workshop;C:\Program Files (x86)\WiX Toolset v3.14\bin\;%PATH% +cd %~dp0 + +call _Version.bat + REM ********* Build Help echo -- Building Installer (%CS_LANG_NAME_SHORT%) @setlocal EnableDelayedExpansion @@ -22,9 +28,6 @@ echo -- Building Installer (%CS_LANG_NAME_SHORT%) @if _%CS_LANG_NAME%==_ echo Unrecognized language '%CS_LANG_FOLDER%' @if _%CS_LANG_NAME%==_ exit /b 1 -SET CS_INSTALLER_NAME=OpenShellSetup_%CS_VERSION_STR%-%CS_LANG_NAME_SHORT% -if %CS_LANG_NAME_SHORT%==en SET CS_INSTALLER_NAME=OpenShellSetup_%CS_VERSION_STR% - if exist Temp rd /Q /S Temp md Temp @@ -66,27 +69,6 @@ candle Setup.wxs -nologo -out Temp\SetupARM64.wixobj -ext WixUIExtension -ext Wi light Temp\SetupARM64.wixobj -nologo -out Temp\SetupARM64.msi -ext WixUIExtension -ext WixUtilExtension -loc ..\Localization\%CS_LANG_FOLDER%\OpenShellText-%CS_LANG_NAME%.wxl -loc ..\Localization\%CS_LANG_FOLDER%\WixUI_%CS_LANG_NAME%.wxl -sice:ICE38 -sice:ICE43 -sice:ICE09 @if ERRORLEVEL 1 exit /b 1 -REM ********* Build MSI Checksums -echo --- MSI Checksums -..\..\build\bin\Release\Utility.exe crcmsi Temp -@if ERRORLEVEL 1 exit /b 1 - -REM ********* Build bootstrapper -echo --- Bootstrapper -for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.Component.MSBuild -property installationPath`) do set MSBuildDir=%%i\MSBuild\Current\Bin\ - -"%MSBuildDir%MSBuild.exe" Setup.sln /m /t:Rebuild /p:Configuration="Release" /p:Platform="Win32" /verbosity:quiet /nologo -@if ERRORLEVEL 1 exit /b 1 - -if exist Final rd /Q /S Final -md Final - -copy /B ..\..\build\bin\Release\Setup.exe Final\%CS_INSTALLER_NAME%.exe > nul - -if defined APPVEYOR ( - appveyor PushArtifact Final\%CS_INSTALLER_NAME%.exe -) - SET CS_LANG_FOLDER= SET CS_LANG_NAME= SET CS_LANG_NAME_SHORT= diff --git a/Src/Setup/_BuildEnglish.bat b/Src/Setup/_BuildEnglish.bat index 29a4b3b..6dd5285 100644 --- a/Src/Setup/_BuildEnglish.bat +++ b/Src/Setup/_BuildEnglish.bat @@ -1,3 +1,6 @@ +@echo off +cd %~dp0 + SET CS_LANG_FOLDER=English SET CS_LANG_NAME=en-US SET CS_LANG_NAME_SHORT=en diff --git a/Src/Setup/_Version.bat b/Src/Setup/_Version.bat new file mode 100644 index 0000000..c10eaf2 --- /dev/null +++ b/Src/Setup/_Version.bat @@ -0,0 +1,9 @@ +@echo off + +rem Convert . to _ +set CS_VERSION_STR=%CS_VERSION:.=_% + +set CS_VERSION_ORIG=%CS_VERSION% + +rem Strip optional "-xyz" suffix from version +for /f "delims=- tokens=1,1" %%i in ("%CS_VERSION%") do set CS_VERSION=%%i