diff --git a/.github/workflows/build-installer.yml b/.github/workflows/build-installer.yml index 22c21fd0..28783895 100644 --- a/.github/workflows/build-installer.yml +++ b/.github/workflows/build-installer.yml @@ -17,7 +17,8 @@ jobs: BUILD_CONFIGURATION: Release SOLUTION_PATH: 'src\vcxproj\salamand.sln' REMOVE_PROJ_PATH: 'src\vcxproj\setup\remove.vcxproj' - OPENSAL_BUILD_DIR: 'D:\a\FileManager\FileManager\build_stage\' + # Important: Use a relative path within the workspace for reliability + OPENSAL_BUILD_DIR: '${{ github.workspace }}\build_stage\' steps: - name: Checkout @@ -29,14 +30,17 @@ jobs: - name: Build Solution (Release | x64) run: | New-Item -ItemType Directory -Force -Path $env:OPENSAL_BUILD_DIR - msbuild $env:SOLUTION_PATH /m /t:Build /p:Configuration=$env:BUILD_CONFIGURATION /p:Platform=x64 /p:PreferredToolArchitecture=x64 + msbuild $env:SOLUTION_PATH /m /t:Build /p:Configuration=$env:BUILD_CONFIGURATION /p:Platform=x64 /p:PreferredToolArchitecture=x64 /p:OutDir=$env:OPENSAL_BUILD_DIR - name: Build Uninstaller (Release | x64) run: | - msbuild $env:REMOVE_PROJ_PATH /m /t:Build /p:Configuration=$env:BUILD_CONFIGURATION /p:Platform=x64 /p:PreferredToolArchitecture=x64 + # OutDir for remove needs to be specific to avoid overwriting or missing files if not handled by the solution OutDir + msbuild $env:REMOVE_PROJ_PATH /m /t:Build /p:Configuration=$env:BUILD_CONFIGURATION /p:Platform=x64 /p:PreferredToolArchitecture=x64 /p:OutDir="${{ env.OPENSAL_BUILD_DIR }}remove\Release_x64\" - name: Prepare and Create Installer run: | + # We need to make sure the expected structure exists in build_stage for our script + # Some projects might not follow the global OutDir perfectly if they have hardcoded paths in props powershell.exe -File tools\prepare_installer.ps1 -BuildDir $env:OPENSAL_BUILD_DIR -OutputPath "OpenSalamander_5.0.${{ github.run_number }}.exe" - name: Create Release diff --git a/Installer/lang/english.slg b/Installer/lang/english.slg new file mode 100644 index 00000000..4c939f0d Binary files /dev/null and b/Installer/lang/english.slg differ diff --git a/Installer/setup.exe b/Installer/setup.exe new file mode 100644 index 00000000..6d66f68f Binary files /dev/null and b/Installer/setup.exe differ diff --git a/tools/prepare_installer.ps1 b/tools/prepare_installer.ps1 index 8481f9e4..8a5ea1a7 100644 --- a/tools/prepare_installer.ps1 +++ b/tools/prepare_installer.ps1 @@ -17,10 +17,41 @@ Copy-Item "Installer\setup.exe" "$StagingDir\" Copy-Item "Installer\LICENSE" "$StagingDir\" Copy-Item "Installer\x64" "$StagingDir\" -# 2. Copy main executables (from Release_x64) -Copy-Item "src\vcxproj\salamander\Release_x64\salamand.exe" "$StagingDir\" -Copy-Item "src\vcxproj\salmon\salamander\Release_x64\utils\salmon.exe" "$StagingDir\" -Copy-Item "$BuildDir\remove\Release_x64\remove.exe" "$StagingDir\" +# 2. Copy main executables +function Copy-Exe($srcPatterns, $dest) { + foreach ($pattern in $srcPatterns) { + $found = Get-ChildItem -Path $pattern -ErrorAction SilentlyContinue | Select-Object -First 1 + if ($found) { + Copy-Item $found.FullName $dest + return $true + } + } + return $false +} + +$salamandCopied = Copy-Exe @( + "$BuildDir\salamander\Release_x64\salamand.exe", + "$BuildDir\Release_x64\salamand.exe", + "$BuildDir\salamand.exe", + "src\vcxproj\salamander\Release_x64\salamand.exe" +) "$StagingDir\" + +$salmonCopied = Copy-Exe @( + "$BuildDir\salmon\Release_x64\utils\salmon.exe", + "$BuildDir\Release_x64\salmon.exe", + "$BuildDir\salmon.exe", + "src\vcxproj\salmon\salamander\Release_x64\utils\salmon.exe" +) "$StagingDir\" + +$removeCopied = Copy-Exe @( + "$BuildDir\remove\Release_x64\remove.exe", + "$BuildDir\Release_x64\remove.exe", + "$BuildDir\remove.exe" +) "$StagingDir\" + +if (-not $salamandCopied) { Write-Error "Could not find salamand.exe" } +if (-not $salmonCopied) { Write-Error "Could not find salmon.exe" } +if (-not $removeCopied) { Write-Error "Could not find remove.exe" } # 3. Copy lang (main app) Copy-Item "Installer\lang\*" "$StagingDir\lang\" -Recurse