Prevent reboot during WaveLink installation

This commit is contained in:
Manuel Thalmann 2024-08-07 18:01:17 +02:00
parent a541982ac4
commit dc2f840018
2 changed files with 14 additions and 5 deletions

View file

@ -159,8 +159,12 @@ $null = New-Module {
} }
if (Get-Config "valhalla.hardware.elgatoWave") { if (Get-Config "valhalla.hardware.elgatoWave") {
Install-ChocoPackage wavelink; if (-not (Test-ChocoPackage wavelink)) {
Remove-DesktopIcon "*Wave Link*"; Install-ChocoPackage wavelink -ArgumentList '--install-arguments="/norestart"';
Remove-DesktopIcon "*Wave Link*";
Restart-Intermediate;
exit;
}
} }
if (Get-Config "valhalla.hardware.eyeX") { if (Get-Config "valhalla.hardware.eyeX") {

View file

@ -19,11 +19,16 @@ $null = New-Module {
function Install-ChocoPackage { function Install-ChocoPackage {
param( param(
[switch] $Force, [switch] $Force,
[string[]] $ArgumentList,
[Parameter(Position=0)]
[string] $Name,
[Parameter(ValueFromRemainingArguments = $true)] [Parameter(ValueFromRemainingArguments = $true)]
[string[]] $Names [string[]] $AdditionalNames = @()
) )
[System.Collections.ArrayList] $Names = $Names; [System.Collections.ArrayList] $Names = @();
$null = $Names.Add($Name);
$Names.AddRange($AdditionalNames);
if (-not ($Force.IsPresent)) { if (-not ($Force.IsPresent)) {
for ($i = $Names.Count - 1; $i -ge 0; $i--) { for ($i = $Names.Count - 1; $i -ge 0; $i--) {
@ -34,7 +39,7 @@ $null = New-Module {
} }
if ($Names.Count -ge 1) { if ($Names.Count -ge 1) {
choco install -y $Names; choco install -y $ArgumentList $Names;
} }
} }