Skip to content

Commit

Permalink
[github-actions] attempt at adding firefox to path
Browse files Browse the repository at this point in the history
  • Loading branch information
b4handjr authored May 6, 2024
1 parent fba6bf3 commit 63a3df9
Showing 1 changed file with 18 additions and 19 deletions.
37 changes: 18 additions & 19 deletions .github/workflows/windows_manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 63a3df9

Please sign in to comment.