From 63a3df97751dc3e8ccf3b4809461816e41a94719 Mon Sep 17 00:00:00 2001 From: Benjamin Forehand Jr Date: Mon, 6 May 2024 13:38:22 -0500 Subject: [PATCH] [github-actions] attempt at adding firefox to path --- .github/workflows/windows_manual.yml | 37 ++++++++++++++-------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/.github/workflows/windows_manual.yml b/.github/workflows/windows_manual.yml index 59a1047..69243e9 100644 --- a/.github/workflows/windows_manual.yml +++ b/.github/workflows/windows_manual.yml @@ -47,26 +47,25 @@ jobs: - name: Install Dependencies shell: pwsh run: choco install jdk8 selenium selenium-gecko-driver - - name: Uninstall default Firefox - shell: pwsh + - name: Verify Path + shell: powershell + run: | + Write-Host "Current PATH environment variable:" + [System.Environment]::GetEnvironmentVariable("PATH", "Machine") + - name: Add Firefox to Path + shell: powershell + run: | + $newPath = "C:\Path\to\your\Firefox_" + ${{ matrix.firefox }} + $currentPath = [System.Environment]::GetEnvironmentVariable("PATH", "Machine") + $newPath += ";$currentPath" + [System.Environment]::SetEnvironmentVariable("PATH", $newPath, "Machine") + Write-Host "Path added to Windows PATH environment variable." + + - name: Verify Path + shell: powershell run: | - $firefoxKey = Get-ItemProperty 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*' | Where-Object { $_.DisplayName -eq 'Mozilla Firefox' } - if ($firefoxKey) { - $uninstallString = $firefoxKey.UninstallString - if ($uninstallString) { - $uninstallString = $uninstallString -replace '\/I','\/X' # Change /I to /X to uninstall - Write-Host "Uninstalling Mozilla Firefox..." - $uninstallString = $uninstallString.Trim() # Trim extra spaces - Start-Process -FilePath "cmd.exe" -ArgumentList "/c $uninstallString /S" -Wait - Write-Host "Mozilla Firefox has been uninstalled." - } else { - Write-Host "Uninstall string not found." - exit 1 - } - } else { - Write-Host "Mozilla Firefox is not installed." - exit 1 - } + Write-Host "Current PATH environment variable:" + [System.Environment]::GetEnvironmentVariable("PATH", "Machine") - name: Setup tests shell: bash run: ./setup_script.sh