From ef0c14e2831fe00756ca27e55c3722edec00c677 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Thu, 22 Aug 2024 16:16:21 +0700 Subject: [PATCH] Trying again --- .github/workflows/Installer.yml | 60 ++++++++++++++++++++++++--------- 1 file changed, 45 insertions(+), 15 deletions(-) diff --git a/.github/workflows/Installer.yml b/.github/workflows/Installer.yml index 1cdef5e5..844baf52 100644 --- a/.github/workflows/Installer.yml +++ b/.github/workflows/Installer.yml @@ -21,10 +21,16 @@ jobs: submodules: recursive fetch-depth: 0 - - name: Check WiX Version + - name: Check WiX Installation run: | - candle.exe -? | findstr /C:"WiX Toolset" - light.exe -? | findstr /C:"WiX Toolset" + $wixPath = "$env:ProgramFiles(x86)\WiX Toolset v3.x\Bin" + if (Test-Path "$wixPath\candle.exe") { + Write-Output "WiX Toolset is installed." + & "$wixPath\candle.exe" -? | Select-String "WiX Toolset" + & "$wixPath\light.exe" -? | Select-String "WiX Toolset" + } else { + Write-Output "WiX Toolset is not installed. Skipping version check." + } # Install the .NET Core workload - name: Install .NET Core @@ -32,10 +38,16 @@ jobs: with: dotnet-version: 5.0.x - - name: Check WiX Version + - name: Check WiX Installation run: | - candle.exe -? | findstr /C:"WiX Toolset" - light.exe -? | findstr /C:"WiX Toolset" + $wixPath = "$env:ProgramFiles(x86)\WiX Toolset v3.x\Bin" + if (Test-Path "$wixPath\candle.exe") { + Write-Output "WiX Toolset is installed." + & "$wixPath\candle.exe" -? | Select-String "WiX Toolset" + & "$wixPath\light.exe" -? | Select-String "WiX Toolset" + } else { + Write-Output "WiX Toolset is not installed. Skipping version check." + } # Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild - name: Setup MSBuild.exe (Windows OS) @@ -44,29 +56,47 @@ jobs: ACTIONS_ALLOW_UNSECURE_COMMANDS: true # So the PATH can be set by this step if: ${{ matrix.os == 'windows-2019' }} - - name: Check WiX Version + - name: Check WiX Installation run: | - candle.exe -? | findstr /C:"WiX Toolset" - light.exe -? | findstr /C:"WiX Toolset" + $wixPath = "$env:ProgramFiles(x86)\WiX Toolset v3.x\Bin" + if (Test-Path "$wixPath\candle.exe") { + Write-Output "WiX Toolset is installed." + & "$wixPath\candle.exe" -? | Select-String "WiX Toolset" + & "$wixPath\light.exe" -? | Select-String "WiX Toolset" + } else { + Write-Output "WiX Toolset is not installed. Skipping version check." + } # Run the unit tests - name: Restore run: nuget restore src/WeSay.sln - - name: Check WiX Version + - name: Check WiX Installation run: | - candle.exe -? | findstr /C:"WiX Toolset" - light.exe -? | findstr /C:"WiX Toolset" + $wixPath = "$env:ProgramFiles(x86)\WiX Toolset v3.x\Bin" + if (Test-Path "$wixPath\candle.exe") { + Write-Output "WiX Toolset is installed." + & "$wixPath\candle.exe" -? | Select-String "WiX Toolset" + & "$wixPath\light.exe" -? | Select-String "WiX Toolset" + } else { + Write-Output "WiX Toolset is not installed. Skipping version check." + } - name: Build env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true # So gitversion can set environment vars during the build run: msbuild src/WeSay.sln /p:Configuration=Release - - name: Check WiX Version + - name: Check WiX Installation run: | - candle.exe -? | findstr /C:"WiX Toolset" - light.exe -? | findstr /C:"WiX Toolset" + $wixPath = "$env:ProgramFiles(x86)\WiX Toolset v3.x\Bin" + if (Test-Path "$wixPath\candle.exe") { + Write-Output "WiX Toolset is installed." + & "$wixPath\candle.exe" -? | Select-String "WiX Toolset" + & "$wixPath\light.exe" -? | Select-String "WiX Toolset" + } else { + Write-Output "WiX Toolset is not installed. Skipping version check." + } - name: Build Installer run: msbuild build/Installer.targets /p:Configuration=Release /p:Platform=x86 /t:BuildRelease