From 35df4d8fa2f84baa2c5c6dfc4a36306e878b1112 Mon Sep 17 00:00:00 2001 From: KammM Date: Mon, 4 Nov 2024 17:52:19 +0100 Subject: [PATCH] =?UTF-8?q?Update-Firefox:=20Erste=20Version=20f=C3=BCr=20?= =?UTF-8?q?Terminal=20Server?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- current/Update-Firefox/Update-Firefox.ps1 | 77 ++++++++++++++++++ .../Update-Firefox/Update-Firefox_Caller.cmd | 45 ++++++++++ .../Update-Firefox/Update-Firefox_History.txt | 15 ++++ .../Update-Firefox_WindowsTaskScheduler.xml | Bin 0 -> 3596 bytes 4 files changed, 137 insertions(+) create mode 100644 current/Update-Firefox/Update-Firefox.ps1 create mode 100644 current/Update-Firefox/Update-Firefox_Caller.cmd create mode 100644 current/Update-Firefox/Update-Firefox_History.txt create mode 100644 current/Update-Firefox/Update-Firefox_WindowsTaskScheduler.xml diff --git a/current/Update-Firefox/Update-Firefox.ps1 b/current/Update-Firefox/Update-Firefox.ps1 new file mode 100644 index 0000000..27b3db2 --- /dev/null +++ b/current/Update-Firefox/Update-Firefox.ps1 @@ -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 '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 \ No newline at end of file diff --git a/current/Update-Firefox/Update-Firefox_Caller.cmd b/current/Update-Firefox/Update-Firefox_Caller.cmd new file mode 100644 index 0000000..7fbce11 --- /dev/null +++ b/current/Update-Firefox/Update-Firefox_Caller.cmd @@ -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 \ No newline at end of file diff --git a/current/Update-Firefox/Update-Firefox_History.txt b/current/Update-Firefox/Update-Firefox_History.txt new file mode 100644 index 0000000..37864a4 --- /dev/null +++ b/current/Update-Firefox/Update-Firefox_History.txt @@ -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 +------------------------------------------------------------------------------- \ No newline at end of file diff --git a/current/Update-Firefox/Update-Firefox_WindowsTaskScheduler.xml b/current/Update-Firefox/Update-Firefox_WindowsTaskScheduler.xml new file mode 100644 index 0000000000000000000000000000000000000000..4ea7e413020b9209b6f3b47710b50e3da848ea93 GIT binary patch literal 3596 zcmbuCZBH6o5Xa~BP40IfCVeTW#i|Y0hFg0piM5S|_{OC1x)h19nq4aGmv8&~&tbcJ zSRbejVfS$6`9E{!3_rei?3I1BsZFe5w>GrQavR&VrS^}l*`_sZgLeZ;Y8UJ$P*WQ@ zbzpt_&(`630naPjx4-Q#>#%!{maBU;wq0Yen!+hdmp0>bV=t}6C&$($Hm9zs$$QLB zhW(uHXE>Yg%@p3bdz7$0huX3&Jl?Q2s}0sIm!0vRExcM=_}Rd}j-6m-goYe?2FHxG zqVMtj%qqkr-oSt0JVW+nN0BT3O@HnYxop3Lw#&24yUDW+ecN_yk5vaxN*%(h)ZMi& z*uTVThW-P5c+0nMT|44e*H@B{`C=UdBI+T1hQ!z-Q{0n<&2#n#pqwnCSSNpDtPMTZ zulC7K`JF-!Xcn3LxX4F>hZDFnkE5_vcp%?a$5VBZxsM~)n1e*Cf_KM0I9+u&#%D#5 zSLh)hb)E*?iPuyWr)t(q#0O|pG(9Bt?W1RLom{PxxscQ6WO&E)+~T=OUPHcLcwV=i zy2Dz#yKt%&+GyD0quSW^iV!lftpc;smm@GA@lC<y8}X{fJ`i=zXYMtTIO=!t)wP|F zsg$}I`l+6vOKWMHEpWXBC*@M;hs-TYRJDquj&*rD?xt7s)dAlj)^)<vL8`Qn%XeN~ zqTje@I)n1}oc9H?IUZa?Q7`yLL_M^mj?B=Gq0c>z-_;UFsZ*1CtxeE8$7k8kc=k9W z@3HqUzZHe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