8
0

Update-Firefox: Erste Version für Terminal Server

This commit is contained in:
2024-11-04 17:52:19 +01:00
parent e18bc0395e
commit 35df4d8fa2
4 changed files with 137 additions and 0 deletions

View File

@@ -0,0 +1,77 @@
# Update-Firefox
# ----------------------------------------------------------------------------
# This Script installs the current Firefox version
#
# Returns: -
# ----------------------------------------------------------------------------
# Copyright (c) 2024 by Digital Data GmbH
#
# Digital Data GmbH • Ludwig-Rinn-Strasse 16 • D-35452 Heuchelheim
# Tel.: 0641/202360 • E-Mail: info-flow@digitaldata.works
# ----------------------------------------------------------------------------
# Creation Date / Author: 04.11.2024 / MK
# Version Date / Editor: 04.11.2024 / MK
# Version Number: 1.0.0.0
#Requires Version 4.0
Clear-Host
Function Get-CurrentFirefoxVersion {
$CurrentFirefoxVersion = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Mozilla\Mozilla Firefox" -Name "(default)" -ErrorAction SilentlyContinue)."(default)"
Write-Host "Current Firefox Version: $CurrentFirefoxVersion"
Return $CurrentFirefoxVersion
} #end function
Function Get-NewFirefoxVersion {
# Fetch the content of the Firefox release notes page
$response = Invoke-WebRequest -Uri "https://www.mozilla.org/de/firefox/notes/"
$pageContent = $response.Content
# Extract the version number using a regular expression
if ($pageContent -match '<title>Firefox\s+([0-9]+\.[0-9]+),\s+See\s+All\s+New\s+Features,\s+Updates\s+and\s+Fixes<\/title>') {
$NewFirefoxVersion = $matches[1]
Write-Host "Latest Firefox Version: $latestVersion"
Return $NewFirefoxVersion
} else {
Write-Host "Could not find the Firefox version number on the release notes page."
Return $NULL
}
} #end function
Function Update-NewFirefoxVersion {
Param ($NewFirefoxVersion)
# Define the URL for the latest Firefox installer
$NewFirefoxVersionURL = "https://download-installer.cdn.mozilla.net/pub/firefox/releases/$NewFirefoxVersion/win64/de/Firefox%20Setup%20$NewFirefoxVersion.msi"
# Use Invoke-WebRequest to download the installer
Write-Host "Downloading Firefox Version $NewFirefoxVersion..."
Invoke-WebRequest -Uri $NewFirefoxVersionURL -OutFile "$env:TEMP\Firefox$NewFirefoxVersion.msi"
Try {
$FirefoxProcess = Get-Process -Name "firefox" -ErrorAction SilentlyContinue
If ($FirefoxProcess) {Stop-Process -Name "firefox" -Force -ErrorAction Stop}
Write-Host "Installing Firefox Version $NewFirefoxVersion, please wait..."
$ArgumentList = "/i $env:TEMP\Firefox$NewFirefoxVersion.msi INSTALL_DIRECTORY_PATH=""D:\ProgramFiles\Mozilla Firefox"" /quiet"
Start-Process -FilePath "msiexec.exe" -ArgumentList $ArgumentList -Wait
} Catch {
Write-Host "ERROR!"
Write-Host $Error[0].ToString()
} Finally {
Write-Host "Cleaning Up!"
Remove-Item "$env:TEMP\Firefox$NewFirefoxVersion.msi" -Force
} #end try/catch/finally
} #end function
$CurrentFirefoxVersion = Get-CurrentFirefoxVersion
$NewFirefoxVersion = Get-NewFirefoxVersion
If ($NewFirefoxVersion -gt $CurrentFirefoxVersion) {
Write-Host "Install or Update is neccessary!"
Update-NewFirefoxVersion -NewFirefoxVersion $NewFirefoxVersion
Write-Host "Install or Update is completed!"
} Else {
Write-Host "No Install or Update is neccessary!"
} #end if/else

View File

@@ -0,0 +1,45 @@
@ECHO OFF
TITLE DIGITAL DATA - Run all files in directory with current permissions
ECHO -
ECHO Batch Script
ECHO Run all files in directory with current permissions
ECHO -
ECHO Digital Data
ECHO Ludwig-Rinn-Strasse 16
ECHO 35452 Heuchelheim
ECHO Tel.: 0641 / 202360
ECHO E-Mail: info@didalog.de
ECHO -
ECHO Version 1.0.0.0
ECHO Date: 13.08.2015
ECHO -
ECHO Program Startup %date% at %time:~0,8% oclock, on %computername%.
REM --------------------------------------------------------------
REM ------------------------set variables-------------------------
REM --------------------------------------------------------------
setlocal enableextensions
SET DIRECTORY="%cd%"
SET FILEEXTENSION=*.ps1
SET COUNT=0
REM --------------------------------------------------------------
REM ---------------------Program 1 / Script 1---------------------
REM --------------------------------------------------------------
FOR /F "tokens=*" %%f in ('dir /S /b %FILEEXTENSION%') do (ECHO %%f && set /a count+=1)
ECHO -
ECHO Found %count% File(s) with File Extension %FILEEXTENSION% in Directory:
ECHO %DIRECTORY%.
ECHO -
ECHO Running this/them now, with your permissions!
FOR /F "tokens=*" %%f in ('dir /S /b %FILEEXTENSION%') do (PowerShell.exe -Command "& {Start-Process PowerShell.exe -WindowStyle hidden '-ExecutionPolicy Bypass -File "%%f"'}")
ECHO -
ECHO This Window will close in:
#timeout /T 10
endlocal
exit

View File

@@ -0,0 +1,15 @@
-------------------------------------------------------------------------------
Version 1.0.0.0 - 04.11.2024
NEW: -
FIX: -
CHG: -
REM: -
-------------------------------------legend------------------------------------
NEW: = Added a new functionality
FIX: = Fixed a Issue with existing functionality
CHG: = Changed a existing functionality
REM: = Removed a functionality
-------------------------------------------------------------------------------