Add scripts for all remaining apps

This commit is contained in:
Manuel Thalmann 2024-08-08 04:36:35 +02:00
parent dfe237dfd7
commit 03460b7e44
16 changed files with 509 additions and 3 deletions

View file

@ -0,0 +1,15 @@
param (
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../PowerShell/Module.ps1";
. "$PSScriptRoot/../../Scripts/Software.ps1";
$parameters = Get-ModuleInstallerComponents "PinnedItem" -NativeOnly;
foreach ($key in $PSBoundParameters.Keys) {
$parameters.Add($key, $PSBoundParameters.TryGetValue($key));
}
Start-SoftwareInstaller @parameters;

View file

@ -118,10 +118,14 @@ $null = New-Module {
[InstallerAction] $Action
)
[bool] $install = $null;
$arguments = [hashtable]@{ };
if ($Action) {
$arguments.Add("action", $Action);
$install = $true;
$null = $arguments.Add("action", $Action);
} else {
$install = ($Action -eq ([InstallerAction]::Install));
}
# Drivers
@ -145,7 +149,7 @@ $null = New-Module {
}
}
if (-not $Action -or ($Action -eq ([InstallerAction]::Install))) {
if ($install) {
if (Get-Config "valhalla.hardware.amdCPU") {
Install-ChocoPackage amd-ryzen-master;
# ToDo: backup Ryzen energy saving plan
@ -181,30 +185,198 @@ $null = New-Module {
$commonSoftware = "$PSScriptRoot/../../Common/Software";
. "$softwarePath/Windows/Manage.ps1" @arguments;
if (Get-Config "valhalla.hardware.logitechG") {
. "$softwarePath/LGHub/Manage.ps1" @arguments;
}
if (Test-Collection "essential") {
# Essentials
. "$softwarePath/OpenSSH/Manage.ps1" @arguments;
. "$softwarePath/PowerShell/Manage.ps1" @arguments;
. "$softwarePath/chocolatey/Manage.ps1" @arguments;
. "$softwarePath/zoxide/Manage.ps1" @arguments;
. "$commonSoftware/posh-git/Manage.ps1" @arguments;
. "$commonSoftware/Terminal-Icons/Manage.ps1" @arguments;
. "$commonSoftware/Oh My Posh/Manage.ps1" @arguments;
if ($install) {
Install-ChocoPackage `
procexp `
procmon `
;
Install-WingetPackage `
KDE.KDEConnect `
;
}
}
if (Test-Collection "common") {
# Common Software
. "$softwarePath/WinSCP/Manage.ps1" @arguments;
. "$softwarePath/Thunderbird/Manage.ps1" @arguments;
. "$softwarePath/PuTTY/Manage.ps1" @arguments;
if ($install) {
Install-ChocoPackage `
7zip `
chocolateygui `
DefaultProgramsEditor `
bitwarden `
keepass `
;
Install-WingetPackage `
SomePythonThings.WingetUIStore `
;
}
}
if (Test-Collection "desktopExperience") {
if ($install) {
# Fonts
Install-ChocoPackage nerd-fonts-CascadiaCode;
# Internet Access
Install-WingetPackage Brave.Brave kamranahmedse.pennywise;
Remove-DesktopIcon "*Brave*";
Remove-TaskbarItem "*Brave*";
Remove-DesktopIcon "Pennywise*";
# 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*";
Install-ChocoPackage `
gimp `
gpu-z `
windirstat `
winmerge `
handbrake `
hwmonitor `
qbittorrent `
imgburn `
inkscape `
krita `
MetaX `
obs-studio `
;
Remove-DesktopIcon "GPU-Z*";
Remove-DesktopIcon "WinDirStat*";
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;
Remove-DesktopIcon "JDownloader*";
}
# ToDo: Consider hiding behind own config?
. "$softwarePath/Ubiquiti UniFi Controller/Manage.ps1" @arguments;
# Internet Access
. "$softwarePath/Firefox/Manage.ps1" @arguments;
. "$softwarePath/MSEdgeRedirect/Manage.ps1" @arguments;
if (Test-Collection "fileSync") {
. "$softwarePath/Nextcloud/Manage.ps1" @arguments;
}
}
if (Test-Collection "socialMedia") {
if ($install) {
Install-ChocoPackage `
signal `
threema-desktop `
element-desktop `
teamspeak `
;
Remove-DesktopIcon "*Element*";
Remove-DesktopIcon "*TeamSpeak*";
Install-WingetPackage Discord.Discord;
Remove-DesktopIcon "*Discord*";
}
}
if (Test-Collection "media") {
if ($install) {
Install-ChocoPackage `
k-litecodecpackmega `
jellyfin-media-player `
vlc `
;
Remove-DesktopIcon "VLC*";
Install-WingetPackage Ytmdesktop.Ytmdesktop;
Remove-DesktopIcon "Youtube Music*";
}
}
if (Test-Collection "coding") {
if ($install) {
Install-ChocoPackage vscode -ArgumentList "--params","/NoDesktopIcon";
Install-ChocoPackage vscodium -ArgumentList "--params","/NoDesktopIcon /AssociateWithFiles";
Install-ChocoPackage `
gh `
github-desktop `
ida-free `
HxD `
docker-desktop `
imhex `
dotpeek `
;
Remove-DesktopIcon "IDA *";
Remove-DesktopIcon "GitHub*";
Remove-DesktopIcon "Docker*";
}
. "$softwarePath/VisualStudio/Manage.ps1" @arguments;
# Node.js
. "$softwarePath/NVS/Manage.ps1" @arguments;
}
if (Test-Collection "gaming") {
# Gaming
if ($install) {
Install-ChocoPackage `
goggalaxy `
epicgameslauncher `
steam `
rayman-controlpanel `
ppsspp `
;
Remove-DesktopIcon "*Epic Games*";
Remove-DesktopIcon "*Steam*";
Remove-DesktopIcon "*PPSSPP *-Bit*";
Install-ChocoPackage ubisoft-connect -ArgumentList "--ignore-checksums";
Remove-DesktopIcon "*Ubisoft Connect*";
Install-WingetPackage ElectronicArts.EADesktop;
Remove-DesktopIcon "EA.*";
}
. "$softwarePath/TrackMania Nations Forever/Manage.ps1" @arguments;
. "$softwarePath/TrackMania United Forever/Manage.ps1" @arguments;
. "$softwarePath/ManiaPlanet/Manage.ps1" @arguments;
. "$softwarePath/osu!/Manage.ps1" @arguments;
. "$softwarePath/osu!lazer/Manage.ps1" @arguments;
. "$softwarePath/RetorArch/Manage.ps1" @arguments;
. "$softwarePath/reWASD/Manage.ps1" @arguments;
}
};
}

View file

@ -96,7 +96,9 @@ $null = New-Module {
$writer = [XmlWriter]::Create($configFile.FullName, $writerSettings);
$document.Save($writer);
$writer.Dispose();
DISM /Online "/Import-DefaultAppAssociations:$($configFile.FullName)";
Write-Host "$configFile";
Read-Host "press enter";
# DISM /Online "/Import-DefaultAppAssociations:$($configFile.FullName)";
Remove-Item $configFile;
}
}

View file

@ -0,0 +1,35 @@
param(
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
Start-SoftwareInstaller @PSBoundParameters `
-Installer {
param(
[scriptblock] $Installer
)
Install-ChocoPackage MSEdgeRedirect;
& $Installer -Action ([InstallerAction]::Configure);
} `
-Configurator {
$configPath = "HKLM:\SOFTWARE\Robert Maehl Software\MSEdgeRedirect";
[hashtable] $options = @{
NoBing = 1;
NoImgs = 1;
NoNews = 1;
NoPDFs = 1;
Search = "StartPage";
Images = "Custom";
ImagePath = "https://startpage.com/sp/search?cat=images&query=";
News = "Google";
PDFApp = "C:\Program Files\Mozilla Firefox\firefox.exe";
};
foreach ($key in $options.Keys) {
Set-ItemProperty $configPath -Name $key -Value ($options[$key]);
}
};

View file

@ -0,0 +1,13 @@
param(
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
Start-SoftwareInstaller @PSBoundParameters `
-Installer {
Install-WingetPackage Nadeo.ManiaPlanet;
};
# ToDo: Add restoration

View file

@ -0,0 +1,33 @@
using namespace System.Security.AccessControl;
using namespace System.Security.Principal;
param(
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
Start-SoftwareInstaller @PSBoundParameters `
-Installer {
$env:NVS_HOME = "$env:ProgramData\nvs";
git clone "https://github.com/jasongin/nvs.git" $env:NVS_HOME;
& "$env:NVS_HOME\nvs.cmd" install;
$acl = Get-Acl $env:NVS_HOME;
$acl.AddAccessRule(
[FileSystemAccessRule]::new(
[SecurityIdentifier]::new([WellKnownSidType]::BuiltinUsersSid, $null),
[FileSystemRights]::FullControl,
[InheritanceFlags]::ObjectInherit -bor [InheritanceFlags]::ContainerInherit,
[PropagationFlags]::InheritOnly,
[AccessControlType]::Allow));
Set-Acl $env:NVS_HOME $acl;
refreshenv;
} `
-Configurator {
nvs add latest;
nvs link latest;
};

View file

@ -0,0 +1,15 @@
using namespace Microsoft.Win32;
param(
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../../../Common/Scripts/AppAssociations.ps1";
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
Start-SoftwareInstaller @PSBoundParameters `
-Installer {
Install-ChocoPackage putty;
};
# ToDo: Add restoration

View file

@ -0,0 +1,15 @@
param(
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
Start-SoftwareInstaller @PSBoundParameters `
-Installer {
Install-ChocoPackage retroarch;
# ToDo: Add start menu shortcut
# ToDo: Add function for this purpose
};
# ToDo: Add restoration

View file

@ -0,0 +1,21 @@
param(
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
Start-SoftwareInstaller @PSBoundParameters `
-Installer {
foreach ($feature in @("DirectPlay", "NetFx3")) {
if ((Get-WindowsOptionalFeature -Online -FeatureName $feature).State -ne "Enabled") {
Write-Information "Enabling the ``$feature`` feature…";
$null = Enable-WindowsOptionalFeature -Online -All -FeatureName $feature;
}
Install-WingetPackage Nadeo.TrackManiaNationsForever;
Remove-DesktopIcon "*TmNationsForever*";
}
};
# ToDo: Add restoration

View file

@ -0,0 +1,33 @@
param(
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
. "$PSScriptRoot/../../../Common/Scripts/System.ps1";
Start-SoftwareInstaller @PSBoundParameters `
-Installer {
$file = "TmUnitedForever.exe";
$dir = New-TemporaryDirectory;
foreach ($feature in @("DirectPlay", "NetFx3")) {
if ((Get-WindowsOptionalFeature -Online -FeatureName $feature).State -ne "Enabled") {
Write-Information "Enabling the ``$feature`` feature…";
$null = Enable-WindowsOptionalFeature -Online -All -FeatureName $feature;
}
}
$null = Push-Location $dir;
Write-Host "Downloading TrackMania United Forever…";
Invoke-WebRequest "http://files.trackmaniaforever.com/tmunitedforever_setup.exe" -OutFile "$file";
Write-Host "Starting installation…";
Start-Process -Wait -FilePath $file -ArgumentList "/Silent";
Remove-DesktopIcon "*TmUnitedForever*";
$null = Pop-Location;
Remove-Item -Recurse $dir;
};
# ToDo: Add restoration

View file

@ -0,0 +1,27 @@
param(
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
. "$PSScriptRoot/../../../Common/Scripts/System.ps1";
Start-SoftwareInstaller @PSBoundParameters `
-Installer {
Write-Information "Downgrading AutoHotkey…";
$id = "AutoHotkey.AutoHotkey";
$uninstall = { winget uninstall --accept-source-agreements -e --id "$id"; };
& $uninstall;
Install-WingetPackage $id -ArgumentList "--version","1.1.37.00";
Install-ChocoPackage temurin11jre;
Write-Host "Installing UniFi Controller…";
Install-ChocoPackage ubiquiti-unifi-controller -ArgumentList "--ignore-dependencies";
Write-Information "Upgrading AutoHotkey…";
& $uninstall;
Install-WingetPackage $id;
Remove-DesktopIcon "UniFi*";
};
# ToDo: Add restoration

View file

@ -0,0 +1,30 @@
param(
$Action,
[hashtable] $Arguments
)
$null = New-Module {
. "$PSScriptRoot/../../../Common/Scripts/BrowserAutomation.ps1";
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
. "$PSScriptRoot/../../../Common/Scripts/System.ps1";
[System.Tuple[string, string, string][]] $versions = @(
[System.Tuple]::Create("visualstudio2019enterprise", "VisualStudio.16.Release", "Microsoft.VisualStudio.Product.Enterprise"),
[System.Tuple]::Create("visualstudio2019community", "VisualStudio.16.Release", "Microsoft.VisualStudio.Product.Community"),
[System.Tuple]::Create("visualstudio2022enterprise", "VisualStudio.17.Release", "Microsoft.VisualStudio.Product.Enterprise"),
[System.Tuple]::Create("visualstudio2022community", "VisualStudio.17.Release", "Microsoft.VisualStudio.Product.Community")
);
Start-SoftwareInstaller @PSBoundParameters `
-Installer {
foreach ($version in $versions) {
$packageName = $version[0];
Write-Host "Installing ``$packageName``";
Install-ChocoPackage $packageName;
Remove-DesktopIcon "CocosCreator*";
Remove-DesktopIcon "Unity Hub*";
}
};
# ToDo: Add restoration
};

View file

@ -0,0 +1,14 @@
param(
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
Start-SoftwareInstaller @PSBoundParameters `
-Installer {
Install-ChocoPackage osu;
Remove-DesktopIcon "*osu*";
};
# ToDo: Add restoration

View file

@ -0,0 +1,31 @@
param(
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
. "$PSScriptRoot/../../../Common/Scripts/System.ps1";
Start-SoftwareInstaller @PSBoundParameters `
-Installer {
$file = "osu!lazer.exe";
$processName = "osu!";
$dir = New-TemporaryDirectory;
Push-Location $dir;
Invoke-WebRequest "https://github.com/ppy/osu/releases/latest/download/install.exe" -OutFile $file;
Start-Process -FilePath $file;
while (-not (Get-Process -ErrorAction SilentlyContinue $processName)) {
Start-Sleep 1;
}
Start-Sleep 10;
Get-Process $processName | Stop-Process -Force;
Pop-Location;
Remove-Item -Recurse $dir,
Remove-DesktopIcon "*osu*";
};
# ToDo: Add restoration

View file

@ -0,0 +1,22 @@
param(
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../../../Common/Scripts/BrowserAutomation.ps1";
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
. "$PSScriptRoot/../../../Common/Scripts/System.ps1";
Start-SoftwareInstaller @PSBoundParameters `
-Installer {
Write-Host "Downloading reWASD…";
$dir = New-TemporaryDirectory;
$file = Start-BrowserDownload -URL "https://rewasd.com/" -ButtonSelector 'a.btn-default[href="#"]' -OutDir $dir;
Write-Host "Installing reWASD…";
Start-Process -Wait -FilePath $($file.FullName) -ArgumentList "/S";
Remove-Item -Recurse $dir;
Remove-DesktopIcon "*reWASD*";
};
# ToDo: Add restoration

View file

@ -0,0 +1,28 @@
param(
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../PowerShell/Profile.ps1";
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
Start-SoftwareInstaller @PSBoundParameters `
-Installer {
param(
[scriptblock] $Installer
)
Install-ChocoPackage zoxide;
Install-WingetPackage junegunn.fzf;
& $Installer -Action ([InstallerAction]::Configure);
} `
-Configurator {
Add-PowerShellProfileStatement `
-System `
-Category "zoxide" `
-Script (
@(
"# zoxide",
(Get-ScriptInitializer "zoxide init powershell | Out-String")
) -join [System.Environment]::NewLine);
};