Update setupScriptInfo.ps1

This commit is contained in:
2023-10-10 14:13:42 +00:00
parent af3a84d633
commit 374a23f8fd

View File

@@ -1,10 +1,27 @@
$tmpPath = "C:\tmp"
#Download temp files
$tmpPath = Join-Path $env:LOCALAPPDATA "Temp"
if (-not (Test-Path -Path $tmpPath -PathType Container)) {
New-Item -Path $tmpPath -ItemType Directory
Invoke-WebRequest -URI "https://education.lego.com/_/downloads/EV3_Classroom_Windows_1.5.3_Global.msi" -OutFile "C:\tmp\EV3_Classroom_Windows_1.5.3_Global.msi"
Invoke-WebRequest -URI "https://cdn.discordapp.com/attachments/704760633379389533/1161288505390026772/simulation.zip" -OutFile "C:\tmp\simulation.zip"
Invoke-WebRequest -URI "https://cdn.discordapp.com/attachments/704760633379389533/1161288504765059172/RobotProg.zip" -OutFile "C:\tmp\RobotProg.zip"
$filesToDownload = @(
@{
Url = "https://education.lego.com/_/downloads/EV3_Classroom_Windows_1.5.3_Global.msi"
FileName = "EV3_Classroom_Windows_1.5.3_Global.msi"
},
@{
Url = "https://cdn.discordapp.com/attachments/704760633379389533/1161288505390026772/simulation.zip"
FileName = "Simulation Domotique.zip"
},
@{
Url = "https://cdn.discordapp.com/attachments/704760633379389533/1161288504765059172/RobotProg.zip"
FileName = "RobotProg.zip"
}
)
foreach ($fileInfo in $filesToDownload) {
$filePath = Join-Path $tmpPath $fileInfo.FileName
if (-not (Test-Path -Path $filePath -PathType Leaf)) {
Invoke-WebRequest -Uri $fileInfo.Url -OutFile $filePath
}
}
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
@@ -130,7 +147,7 @@ choco install audacity -y
choco install scratch -y
choco install mblock -y
Expand-Archive -Path "C:\tmp\simulation.zip" -DestinationPath "C:\Program Files\Simulation Domotique" -Force
Expand-Archive -Path "C:\tmp\Simulation Domotique.zip" -DestinationPath "C:\Program Files\" -Force
$targetExePath = "C:\Program Files\Simulation Domotique\simulation.exe"
$shortcutPath = "C:\Users\Public\Desktop\Simulation Domotique.lnk"
$shell = New-Object -ComObject WScript.Shell
@@ -142,7 +159,7 @@ $shortcut.Save()
choco install arduino -y
choco install ganttproject -y
Start-Process -FilePath "msiexec.exe" -ArgumentList "/i C:\tmp\EV3_Classroom_Windows_1.5.3_Global.msi /qn" -Wait
Expand-Archive -Path "C:\tmp\RobotProg.zip" -DestinationPath "C:\Program Files\RobotProg" -Force
Expand-Archive -Path "C:\tmp\RobotProg.zip" -DestinationPath "C:\Program Files\" -Force
$targetExePath = "C:\Program Files\RobotProg\RobotProg.exe"
$shortcutPath = "C:\Users\Public\Desktop\RobotProg.lnk"
$shell = New-Object -ComObject WScript.Shell