PortValhalla/scripts/Windows/Scripts/Deployment.ps1

311 lines
10 KiB
PowerShell
Raw Normal View History

2024-09-21 00:10:20 +00:00
. "$PSScriptRoot/PowerManagement.ps1";
2024-09-23 01:33:17 +00:00
. "$PSScriptRoot/SoftwareManagement.ps1";
2024-10-13 23:55:19 +00:00
. "$PSScriptRoot/../../Common/Scripts/Config.ps1";
. "$PSScriptRoot/../../Common/Scripts/SoftwareManagement.ps1";
. "$PSScriptRoot/../../Common/Types/InstallerAction.ps1";
<#
.SYNOPSIS
Deploys an action for each software selected for installation.
.PARAMETER
The action to execute.
#>
function Deploy-SoftwareAction {
param(
[System.Nullable[InstallerAction]] $Action = $null
)
[bool] $install = $false;
2024-10-21 23:22:39 +00:00
[bool] $userInstall = $Action -eq ([InstallerAction]::ConfigureUser);
$arguments = [hashtable]@{ };
if ($null -ne $Action) {
$install = ($Action -eq ([InstallerAction]::Install));
$null = $arguments.Add("action", $Action);
2024-10-06 19:25:34 +00:00
}
else {
$install = $true;
}
2024-09-22 15:50:05 +00:00
$hardware = Get-OSConfig "hardware";
$collections = Get-OSConfig "software";
2024-09-08 15:41:30 +00:00
# Drivers
& {
$driverPath = "$PSScriptRoot/../Drivers";
$mbPath = "$driverPath/ROG Zenith Extreme Alpha";
if ($install) {
2024-09-08 15:41:30 +00:00
if ($hardware.elgatoWave) {
if (-not (Test-ChocoPackage wavelink)) {
Install-ChocoPackage wavelink -ArgumentList '--install-arguments="/norestart"';
Remove-DesktopIcon "*Wave Link*";
Restart-Intermediate;
exit;
}
}
}
2024-09-08 15:41:30 +00:00
foreach ($component in $hardware.components) {
switcH ($component) {
("ROG Zenith Extreme Alpha") {
2024-10-12 16:13:41 +00:00
& "$mbPath/MarvellEthernet/Main.ps1" @arguments;
& "$mbPath/IntelWiFi/Main.ps1" @arguments;
& "$mbPath/IntelBluetooth/Main.ps1" @arguments;
& "$mbPath/AMDChipsetX399/Main.ps1" @arguments;
& "$driverPath/AMDChipsetX399/Main.ps1" @arguments;
}
("Predator Z301C") {
2024-10-12 16:13:41 +00:00
& "$driverPath/Predator Z301C/Main.ps1" @arguments;
}
}
}
if ($install) {
2024-09-08 15:41:30 +00:00
if ($hardware.amdCPU) {
Install-ChocoPackage amd-ryzen-master;
2024-09-21 00:10:20 +00:00
$ryzenPlan = [regex]::Match("" + ((powercfg /LIST) | Where-Object { $_ -like "*(AMD Ryzen*"; }), "Power Scheme GUID: ([0-9a-f-]+) ").Groups[1].Value;
if ($ryzenPlan) {
powercfg /S $ryzenPlan;
Backup-PowerScheme;
}
}
2024-09-08 15:41:30 +00:00
if ($hardware.nvidiaGPU) {
Install-ChocoPackage geforce-game-ready-driver;
Remove-DesktopIcon "*Geforce*";
}
2024-09-08 15:41:30 +00:00
if ($hardware.corsairDevice) {
Install-ChocoPackage icue;
}
}
2024-09-08 15:41:30 +00:00
if ($hardware.eyeX) {
2024-10-12 16:13:41 +00:00
& "$driverPath/Tobii EyeX/Main.ps1" @arguments;
}
};
& {
$softwarePath = "$PSScriptRoot/../Software";
$commonSoftware = "$PSScriptRoot/../../Common/Software";
# Windows Config
2024-10-13 13:35:24 +00:00
& "$softwarePath/windows/Main.ps1" @arguments;
2024-10-13 23:55:19 +00:00
# Driver Programs
& "$softwarePath/lghub/Main.ps1" @arguments;
& "$softwarePath/aliae/Main.ps1" @arguments;
& "$softwarePath/git/Main.ps1" @arguments;
& "$softwarePath/openssh/Main.ps1" @arguments;
& "$softwarePath/powershell/Main.ps1" @arguments;
& "$softwarePath/chocolatey/Main.ps1" @arguments;
& "$softwarePath/zoxide/Main.ps1" @arguments;
& "$commonSoftware/posh-git/Main.ps1" @arguments;
& "$commonSoftware/terminal-icons/Main.ps1" @arguments;
& "$softwarePath/oh-my-posh/Main.ps1" @arguments;
if (Get-OSConfig "dualboot") {
& "$softwarePath/ext4fsd/Main.ps1" @arguments;
}
# Essentials
2024-09-08 15:41:30 +00:00
if ($collections.essential) {
if ($install) {
Install-ChocoPackage `
procexp `
procmon `
;
Install-WingetPackage `
KDE.KDEConnect `
;
}
}
# Common Software
2024-10-13 23:55:19 +00:00
& "$softwarePath/winscp/Main.ps1" @arguments;
& "$softwarePath/thunderbird/Main.ps1" @arguments;
& "$softwarePath/putty/Main.ps1" @arguments;
2024-10-13 23:55:19 +00:00
# Internet Access
if ($install) {
if (Test-Program "brave") {
2024-10-16 23:15:10 +00:00
Install-WingetPackage Brave.Brave -ArgumentList "--scope", "machine";
2024-10-13 23:55:19 +00:00
Remove-DesktopIcon "*Brave*";
Remove-TaskbarItem "*Brave*";
}
2024-10-13 23:59:55 +00:00
}
2024-10-13 23:55:19 +00:00
2024-10-21 23:22:39 +00:00
if ($userInstall) {
2024-10-13 23:55:19 +00:00
if (Test-Program "pennywise") {
Install-WingetPackage kamranahmedse.pennywise;
Remove-DesktopIcon "Pennywise*";
}
}
& "$softwarePath/firefox/Main.ps1" @arguments;
& "$softwarePath/msedge-redirect/Main.ps1" @arguments;
2024-09-08 15:41:30 +00:00
if ($collections.desktopExperience) {
if ($install) {
# Fonts
Install-ChocoPackage nerd-fonts-CascadiaCode;
# Tools
Install-SetupPackage -Source "https://github.com/mRemoteNG/mRemoteNG/releases/download/2023.03.03-v1.77.3-nb/mRemoteNG-Installer-1.77.3.nb-1784.msi" -ArgumentList "/Quiet";
Remove-DesktopIcon "mRemoteNG*";
2024-10-21 23:18:31 +00:00
Install-ChocoPackage bitwarden -ArgumentList '--install-arguments="/ALLUSERS=1"';
Install-ChocoPackage `
2024-10-21 23:18:31 +00:00
7zip `
gimp `
gpu-z `
windirstat `
winmerge `
handbrake `
hwmonitor `
qbittorrent `
imgburn `
inkscape `
krita `
MetaX `
obs-studio `
2024-10-21 23:18:31 +00:00
chocolateygui `
DefaultProgramsEditor `
keepass `
;
Remove-DesktopIcon "GIMP*";
Remove-DesktopIcon "GPU-Z*";
Remove-DesktopIcon "WinDirStat*";
2024-09-08 15:41:30 +00:00
Remove-DesktopIcon "*HWMonitor*";
Remove-DesktopIcon "ImgBurn*";
Remove-DesktopIcon "InkScape*";
Remove-DesktopIcon "Krita*";
Remove-DesktopIcon "MetaX*";
Remove-DesktopIcon "OBS Studio*";
Install-WingetPackage `
AntSoftware.AntRenamer `
AppWork.JDownloader `
2024-10-21 23:21:57 +00:00
MartiCliment.UniGetUI `
;
Remove-DesktopIcon "JDownloader*";
2024-10-21 23:18:31 +00:00
Remove-DesktopIcon "UniGetUI*";
}
}
2024-10-13 23:55:19 +00:00
# ToDo: Consider hiding behind own config?
& "$softwarePath/ubiquiti-unifi-controller/Main.ps1" @arguments;
& "$softwarePath/nextcloud/Main.ps1" @arguments;
2024-09-08 15:41:30 +00:00
if ($collections.socialMedia) {
if ($install) {
2024-10-21 23:22:39 +00:00
Install-ChocoPackage teamspeak;
Remove-DesktopIcon "*TeamSpeak*";
}
elseif ($userInstall) {
Install-WingetPackage `
Element.Element `
OpenWhisperSystems.Signal `
Threema.Threema `
;
Remove-DesktopIcon "*Element*";
}
}
2024-10-13 23:55:19 +00:00
. "$softwarePath/discord/Main.ps1" @arguments;
2024-09-08 15:41:30 +00:00
if ($collections.media) {
if ($install) {
Install-ChocoPackage `
k-litecodecpackmega `
vlc `
;
Remove-DesktopIcon "VLC*";
# When installing Jellyfin Media Player after iCUE, Jellyfin will try to reboot automatically
2024-10-06 19:25:34 +00:00
Install-ChocoPackage jellyfin-media-player -ArgumentList "--install-args", "/norestart";
Remove-DesktopIcon "Jellyfin Media Player*";
Install-WingetPackage Ytmdesktop.Ytmdesktop;
Remove-DesktopIcon "Youtube Music*";
}
}
2024-09-08 15:41:30 +00:00
if ($collections.coding) {
if ($install) {
Install-ChocoPackage `
gh `
github-desktop `
ida-free `
HxD `
imhex `
dotpeek `
;
Remove-DesktopIcon "IDA *";
Remove-DesktopIcon "GitHub*";
2024-10-13 23:55:19 +00:00
if (Test-Program "docker") {
Install-ChocoPackage docker-desktop;
Remove-DesktopIcon "Docker*";
}
}
2024-10-13 23:55:19 +00:00
}
2024-10-13 23:55:19 +00:00
& "$softwarePath/vscode/Main.ps1" @arguments;
& "$softwarePath/visualstudio/Main.ps1" @arguments;
2024-10-13 23:55:19 +00:00
# Node.js
& "$softwarePath/nvs/Main.ps1" @arguments;
# Gaming
2024-10-13 23:55:19 +00:00
if (Test-Program "steam") {
Install-ChocoPackage `
steam `
-ArgumentList "--ignore-checksums" `
;
Remove-DesktopIcon "*Steam*";
}
2024-09-08 15:41:30 +00:00
if ($collections.gaming) {
if ($install) {
Install-ChocoPackage `
goggalaxy `
epicgameslauncher `
rayman-controlpanel `
ppsspp `
;
Remove-DesktopIcon "*Epic Games*";
Remove-DesktopIcon "*PPSSPP *-Bit*";
Install-ChocoPackage `
ubisoft-connect `
-ArgumentList "--ignore-checksums" `
;
Remove-DesktopIcon "*Ubisoft Connect*";
Install-WingetPackage ElectronicArts.EADesktop;
Remove-DesktopIcon "EA.*";
}
}
2024-10-13 23:55:19 +00:00
& "$softwarePath/tm-nations-forever/Main.ps1" @arguments;
& "$softwarePath/tm-united-forever/Main.ps1" @arguments;
& "$softwarePath/maniaplanet/Main.ps1" @arguments;
& "$softwarePath/osu!/Main.ps1" @arguments;
& "$softwarePath/osu!lazer/Main.ps1" @arguments;
& "$softwarePath/retroarch/Main.ps1" @arguments;
& "$softwarePath/rewasd/Main.ps1" @arguments;
};
}