Skip to content

Commit 8e3c37e

Browse files
authored
Merge pull request #5 from WilliamMyers1/master
Mozilla Firefox installer
2 parents 188cfe0 + 405100d commit 8e3c37e

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Mozilla Firefox Install Script
2+
# This script will fetch and then install the most current version of the 32-Bit Mozilla Firefox ESR.
3+
# 2017/03/07 - William.Myers1
4+
5+
6+
# Specify the URL Source for Firefox.
7+
$FireFoxSourceURI = "https://download.mozilla.org/?product=firefox-esr-latest&lang=en-US"
8+
9+
# Specify the location to cache the download
10+
$DownloadLocation = "$ENV:Temp\Firefox Setup esr.exe"
11+
12+
#Define a list of processes to stop
13+
$ProcessesToStop = @(
14+
"Firefox*"
15+
)
16+
17+
# Retrieve the file
18+
Write-host "Retrieving download from $FireFoxSourceURI"
19+
write-host "Downloading file to $DownloadLocation"
20+
Invoke-WebRequest -uri $FireFoxSourceURI -Outfile "$DownloadLocation"
21+
22+
# Stop running processes
23+
foreach ($ProcToStop in $ProcessesToStop){
24+
get-process $ProcToStop -EA SilentlyContinue |Stop-Process -FOrce
25+
}
26+
27+
28+
# Launch the installer.
29+
start-process -filepath "$DownloadLocation" -argumentlist "-MS" -wait
30+
31+
32+
# Delete the global desktop shortcut
33+
IF (Test-path "$ENV:SystemDrive\Users\Public\Desktop\Mozilla Firefox.lnk"){
34+
Remove-item "$ENV:SystemDrive\Users\Public\Desktop\Mozilla Firefox.lnk"}

0 commit comments

Comments
 (0)