diff --git a/setupScriptInfo.ps1 b/setupScriptInfo.ps1 index 8d29085..a14f8a7 100644 --- a/setupScriptInfo.ps1 +++ b/setupScriptInfo.ps1 @@ -1,17 +1,15 @@ +$tmpPath = "C:\tmp" + +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" + 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')) -# Installing needed apps -choco install dotnet -y -choco install vcredist-all -y -choco install firefox -y -choco install 7zip -y -choco install onlyoffice -y -choco install adobereader -y -choco install sublimetext4 -y -choco install vlc -y -choco install audacity -y -choco install arduino -y - +# Setup users Set-LocalUser -Name "Eleve" -PasswordNeverExpires $true -UserMayChangePassword $false -Password ([securestring]::new()) $SecurePassword = ConvertTo-SecureString -String "IPRprof2398" -AsPlainText -Force Set-LocalUser -Name "Prof" -PasswordNeverExpires $true -UserMayChangePassword $false -Password $SecurePassword @@ -47,7 +45,7 @@ function UserReg { $TargetUsername = "Eleve" $UserSID, $UserHKUPath = UserReg -Username $TargetUsername - +# Add restriction if ($UserSID -ne $null -and $UserHKUPath -ne $null) { # Restrict access to Settings $ControlPanelKeyPath = "$UserHKUPath\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" @@ -117,6 +115,46 @@ if ($UserSID -ne $null -and $UserHKUPath -ne $null) { Write-Host "Unable to get the user's HKU registry." } +# Installing needed apps +choco install dotnet -y +choco install vcredist-all -y +choco install firefox -y +choco install 7zip -y +choco install onlyoffice -y +choco install googleearthpro -y +choco install adobereader -y +choco install sublimetext4 -y +choco install vlc -y +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" +$targetExePath = "C:\Program Files\Simulation Domotique\simulation.exe" +$shortcutPath = "C:\Users\Public\Desktop\Simulation Domotique.lnk" +$shell = New-Object -ComObject WScript.Shell +$shortcut = $shell.CreateShortcut($shortcutPath) +$shortcut.TargetPath = $targetExePath +$shortcut.IconLocation = $targetExePath +$shortcut.WorkingDirectory = (Get-Item $targetExePath).DirectoryName +$shortcut.Save() +choco install arduino -y +choco install ganttproject -y +Start-Process C:\tmp\EV3_Classroom_Windows_1.5.3_Global.msi -ArgumentList "/quiet" +Expand-Archive -Path "C:\tmp\RobotProg.zip" -DestinationPath "C:\Program Files\RobotProg" +$targetExePath = "C:\Program Files\RobotProg\RobotProg.exe" +$shortcutPath = "C:\Users\Public\Desktop\RobotProg.lnk" +$shell = New-Object -ComObject WScript.Shell +$shortcut = $shell.CreateShortcut($shortcutPath) +$shortcut.TargetPath = $targetExePath +$shortcut.IconLocation = $targetExePath +$shortcut.WorkingDirectory = (Get-Item $targetExePath).DirectoryName +$shortcut.Save() + +Remove-Item -Path "C:\tmp\" -Recurse -Force + + +# Update Windows Install-Module -Name PSWindowsUpdate -Force -Get-WindowsUpdate +Get-WindowsUpdate -Force Install-WindowsUpdate -AcceptAll -AutoReboot