From b87117ecd3700ec9491803dfad5eeeae1d1022b1 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Wed, 7 Aug 2024 18:57:27 +0200 Subject: [PATCH] Add script for installing Thunderbird --- scripts/Windows/OS/Install.ps1 | 1 + .../Windows/Software/Thunderbird/Manage.ps1 | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 scripts/Windows/Software/Thunderbird/Manage.ps1 diff --git a/scripts/Windows/OS/Install.ps1 b/scripts/Windows/OS/Install.ps1 index 376e6fb4..1839d654 100644 --- a/scripts/Windows/OS/Install.ps1 +++ b/scripts/Windows/OS/Install.ps1 @@ -187,6 +187,7 @@ $null = New-Module { if (Test-Collection "common") { # Common Software . "$softwarePath/WinSCP/Manage.ps1" @arguments; + . "$softwarePath/Thunderbird/Manage.ps1" @arguments; } }; } diff --git a/scripts/Windows/Software/Thunderbird/Manage.ps1 b/scripts/Windows/Software/Thunderbird/Manage.ps1 new file mode 100644 index 00000000..221bb9f3 --- /dev/null +++ b/scripts/Windows/Software/Thunderbird/Manage.ps1 @@ -0,0 +1,25 @@ +using namespace Microsoft.Win32; + +param( + $Action, + [hashtable] $Arguments +) + +. "$PSScriptRoot/../../Scripts/AppAssociations.ps1"; +. "$PSScriptRoot/../../Scripts/Software.ps1"; + +Start-SoftwareInstaller @PSBoundParameters ` + -Installer { + param( + [scriptblock] $Installer + ) + + Install-ChocoPackage thunderbird -ArgumentList "--params",'"/NoTaskbarShortcut /NoDesktopShortcut"' + & $Installer -Action ([InstallerAction]::Configure) + } ` + -Configurator { + Write-Host "Making Thunderbird the default mail program…"; + $applicationName = "Thunderbird"; + Set-DefaultAppAssociation -Identifier "mailto" -ProgId "Thunderbird.Url.mailto" -ApplicationName $applicationName; + Set-DefaultAppAssociation -Identifier ".eml" -ProgId "ThunderbirdEml" -ApplicationName $applicationName; + };