From 0bf3830c979002e3b43474fc376994b757adc285 Mon Sep 17 00:00:00 2001 From: Lightemerald Date: Tue, 10 Oct 2023 14:30:33 +0000 Subject: [PATCH] Update setupScriptInfo.ps1 --- setupScriptInfo.ps1 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/setupScriptInfo.ps1 b/setupScriptInfo.ps1 index 707c394..5fbb3b0 100644 --- a/setupScriptInfo.ps1 +++ b/setupScriptInfo.ps1 @@ -148,6 +148,14 @@ choco install audacity -y choco install scratch -y choco install mblock -y Expand-Archive -Path (Join-Path $tmpPath "Simulation Domotique.zip") -DestinationPath $env:ProgramFiles -Force +$sourceFolderPath = Join-Path $env:ProgramFiles "simulation" +$destinationFolderPath = Join-Path $env:ProgramFiles "Simulation Domotique" +if (Test-Path -Path $sourceFolderPath -PathType Container) { + if (Test-Path -Path $destinationFolderPath -PathType Container) { + Remove-Item -Path $destinationFolderPath -Recurse -Force + } + Rename-Item -Path $sourceFolderPath -NewName "Simulation Domotique" +} $targetExePath = "C:\Program Files\Simulation Domotique\simulation.exe" $shortcutPath = (Join-Path $env:PUBLIC "Desktop\Simulation Domotique.lnk") $shell = New-Object -ComObject WScript.Shell @@ -170,7 +178,7 @@ $shortcut.WorkingDirectory = (Get-Item $targetExePath).DirectoryName $shortcut.Save() # URL shortcut -Disable-WindowsOptionalFeature -online -FeatureName internet-explorer-optional-amd64 +Disable-WindowsOptionalFeature -online -NoRestart -FeatureName internet-explorer-optional-amd64 $wshShell = New-Object -ComObject "WScript.Shell" $urlShortcut = $wshShell.CreateShortcut((Join-Path $env:PUBLIC "Desktop\Office 365.url")) $urlShortcut.TargetPath = "https://office.com/" @@ -188,5 +196,5 @@ $urlShortcut.Save() # Update Windows Install-Module -Name PSWindowsUpdate -Force -Get-WindowsUpdate -Force +Get-WindowsUpdate -ForceInstall Install-WindowsUpdate -AcceptAll -AutoReboot