Added hash check to setupTmp
Fixed issue with custom apps in choco
This commit is contained in:
BIN
Setup files/Eduanat2_Setup_2.0.0.exe
Normal file
BIN
Setup files/Eduanat2_Setup_2.0.0.exe
Normal file
Binary file not shown.
BIN
Setup files/regavi.zip
Normal file
BIN
Setup files/regavi.zip
Normal file
Binary file not shown.
BIN
Setup files/respipoisson.exe
Normal file
BIN
Setup files/respipoisson.exe
Normal file
Binary file not shown.
@@ -5,7 +5,7 @@ function InstallChoco {
|
|||||||
function ChocoInstallApps {
|
function ChocoInstallApps {
|
||||||
param (
|
param (
|
||||||
[string] $Type,
|
[string] $Type,
|
||||||
[string] $Apps
|
[array] $Apps
|
||||||
)
|
)
|
||||||
|
|
||||||
switch ($Type) {
|
switch ($Type) {
|
||||||
|
|||||||
@@ -3,6 +3,14 @@ function UserReg {
|
|||||||
param (
|
param (
|
||||||
[string] $Username
|
[string] $Username
|
||||||
)
|
)
|
||||||
|
# check if User folder exist
|
||||||
|
if( -not (Test-Path -Path "C:\Users\$Username" -PathType Container) ) {
|
||||||
|
Write-Host "User folder for $Username not found."
|
||||||
|
Write-Host "You need to login to $Username in order for its files and registry to be setup."
|
||||||
|
Write-Host "Press Enter to continue..."
|
||||||
|
$null = Read-Host
|
||||||
|
Write-Host "Continuing the script..."
|
||||||
|
}
|
||||||
Write-Host "Loading $Username's HKU registry hive..."
|
Write-Host "Loading $Username's HKU registry hive..."
|
||||||
$UserProfiles = Get-WmiObject Win32_UserProfile | Where-Object { $_.Special -eq $false }
|
$UserProfiles = Get-WmiObject Win32_UserProfile | Where-Object { $_.Special -eq $false }
|
||||||
$UserProfile = $UserProfiles | Where-Object { $_.LocalPath.EndsWith("\$Username") }
|
$UserProfile = $UserProfiles | Where-Object { $_.LocalPath.EndsWith("\$Username") }
|
||||||
|
|||||||
@@ -148,6 +148,8 @@ function Show-InstallationMenu {
|
|||||||
Write-Host "1. Labo"
|
Write-Host "1. Labo"
|
||||||
Write-Host "2. Info"
|
Write-Host "2. Info"
|
||||||
Write-Host "3. Laptop"
|
Write-Host "3. Laptop"
|
||||||
|
Write-Host "4. Custom"
|
||||||
|
Write-Host "q. Exit"
|
||||||
|
|
||||||
$selection = Read-Host "Enter the number of your choice"
|
$selection = Read-Host "Enter the number of your choice"
|
||||||
|
|
||||||
@@ -156,7 +158,11 @@ function Show-InstallationMenu {
|
|||||||
"2" { Setup -Type "Info" }
|
"2" { Setup -Type "Info" }
|
||||||
"3" { Setup -Type "Laptop" }
|
"3" { Setup -Type "Laptop" }
|
||||||
"4" { Custom }
|
"4" { Custom }
|
||||||
default { Write-Host "Invalid selection. Please choose 1, 2, or 3." }
|
"q" {
|
||||||
|
Write-Host "Exiting..."
|
||||||
|
exit
|
||||||
|
}
|
||||||
|
default { Write-Host "Invalid selection." }
|
||||||
}
|
}
|
||||||
} while ($selection -ne "1" -and $selection -ne "2" -and $selection -ne "3")
|
} while ($selection -ne "1" -and $selection -ne "2" -and $selection -ne "3")
|
||||||
}
|
}
|
||||||
|
|||||||
76
setupTmp.ps1
76
setupTmp.ps1
@@ -9,100 +9,119 @@ function DownloadFiles {
|
|||||||
"Labo" {
|
"Labo" {
|
||||||
$filesToDownload = @(
|
$filesToDownload = @(
|
||||||
@{
|
@{
|
||||||
Url = "https://winstars.net/files/version3/winstars_installer.exe" # Validated 07/11/23
|
Url = "https://winstars.net/files/version3/winstars_installer.exe" # Validated 15/11/23
|
||||||
FileName = "winstars_installer.exe"
|
FileName = "winstars_installer.exe"
|
||||||
|
Hash = "f3e97e1373ab84eb4c707f04fca78abbcb0ed289"
|
||||||
},
|
},
|
||||||
|
#@{
|
||||||
|
# Url = "https://cosphilog.fr/tectoglob3d/Tectoglob3D-win32-ia32.zip"
|
||||||
|
# FileName = "Tectoglob3D-win32-ia32.zip"
|
||||||
|
#},
|
||||||
|
#@{
|
||||||
|
# Url = "http://acces.ens-lyon.fr/acces/logiciels/applications/tectoglob/Tectoglob_11_complet.zip/at_download/file"
|
||||||
|
# FileName = "Tectoglob_11_complet.zip"
|
||||||
|
#},
|
||||||
@{
|
@{
|
||||||
Url = "https://cosphilog.fr/tectoglob3d/Tectoglob3D-win32-ia32.zip" # Validated 07/11/23
|
Url = "https://git.justw.tf/Lightemerald/setup-script/raw/branch/main/Setup%20files/Sismolog.exe"
|
||||||
FileName = "Tectoglob3D-win32-ia32.zip"
|
|
||||||
},
|
|
||||||
@{
|
|
||||||
Url = "https://git.justw.tf/Lightemerald/setup-script/raw/branch/main/Setup%20files/Sismolog.exe" # Validated 13/11/23
|
|
||||||
FileName = "Sismolog.exe"
|
FileName = "Sismolog.exe"
|
||||||
|
Hash = "2d57ac0dd260e33194fbd53a91ab707d273bc80d"
|
||||||
},
|
},
|
||||||
@{
|
@{
|
||||||
Url = "http://acces.ens-lyon.fr/acces/logiciels/applications/tectoglob/Tectoglob_11_complet.zip/at_download/file" # Validated 07/11/23
|
Url = "https://git.justw.tf/Lightemerald/setup-script/raw/branch/main/Setup%20files/respipoisson.exe"
|
||||||
FileName = "Tectoglob_11_complet.zip"
|
|
||||||
},
|
|
||||||
@{
|
|
||||||
Url = "http://svt.janzac.free.fr/logiciels/respipoisson/respipoisson.exe" # Validated 07/11/23
|
|
||||||
FileName = "Respipoisson.exe"
|
FileName = "Respipoisson.exe"
|
||||||
|
Hash = "5ccbb52480f8a867d5c836d3c14360eb2ed66901"
|
||||||
},
|
},
|
||||||
@{
|
@{
|
||||||
Url = "https://regressi.fr/zip/regressi-mpeg-setup.msi" # Replaced 07/11/23
|
Url = "https://regressi.fr/zip/regressi-mpeg-setup.msi" # Validated 15/11/23
|
||||||
FileName = "regressi-mpeg-setup.msi"
|
FileName = "regressi-mpeg-setup.msi"
|
||||||
|
Hash = "eb18da510c842690042d5294d55b8d3d032b1d80"
|
||||||
},
|
},
|
||||||
@{
|
@{
|
||||||
Url = "http://labocharlemagne.free.fr/logiciels/regavi.zip" # Validated 07/11/23
|
Url = "https://git.justw.tf/Lightemerald/setup-script/raw/branch/main/Setup%20files/regavi.zip"
|
||||||
FileName = "regavi.zip"
|
FileName = "regavi.zip"
|
||||||
|
Hash = "dbd4ab84a28d4b387ba8abcd7a32d6eb109e638f"
|
||||||
},
|
},
|
||||||
@{
|
@{
|
||||||
Url = "https://git.justw.tf/Lightemerald/setup-script/raw/branch/main/Setup%20files/Radiochr_08.exe" # Validated 07/11/23
|
Url = "https://git.justw.tf/Lightemerald/setup-script/raw/branch/main/Setup%20files/Radiochr_08.exe"
|
||||||
FileName = "Radiochr.exe"
|
FileName = "Radiochr.exe"
|
||||||
|
Hash = "8452ca0ca30c4f17d60e5cc7f721624244e51290"
|
||||||
},
|
},
|
||||||
@{
|
@{
|
||||||
Url = "https://git.justw.tf/Lightemerald/setup-script/raw/branch/main/Setup%20files/Phylogene-Lycee-2021.zip" # Validated 13/11/23
|
Url = "https://git.justw.tf/Lightemerald/setup-script/raw/branch/main/Setup%20files/Phylogene-Lycee-2021.zip"
|
||||||
FileName = "Phylogene-Lycee-2021.zip"
|
FileName = "Phylogene-Lycee-2021.zip"
|
||||||
|
Hash = "39611185a4b788722989b8811adc374928090501"
|
||||||
},
|
},
|
||||||
@{
|
@{
|
||||||
Url = "http://philippe.cosentino.free.fr/productions/paleoterre/paleoterre_el32.zip" # Validated 07/11/23
|
Url = "http://philippe.cosentino.free.fr/productions/paleoterre/paleoterre_el32.zip" # Validated 15/11/23
|
||||||
FileName = "paleoterre_el32.zip"
|
FileName = "paleoterre_el32.zip"
|
||||||
|
Hash = "ee282e54d7c1e682fb6b219bcc7fac395f2984e3"
|
||||||
},
|
},
|
||||||
@{
|
@{
|
||||||
Url = "http://acces.ens-lyon.fr/logiciels/EduAnat2/Eduanat2%20Setup%202.0.0.exe" # Validated 07/11/23
|
Url = "https://git.justw.tf/Lightemerald/setup-script/raw/branch/main/Setup%20files/Eduanat2_Setup_2.0.0.exe"
|
||||||
FileName = "Eduanat2_Setup_2.0.0.exe"
|
FileName = "Eduanat2_Setup_2.0.0.exe"
|
||||||
|
Hash = "a423589d43a60432efb012147c2540d6e9dc9f78"
|
||||||
},
|
},
|
||||||
@{
|
@{
|
||||||
Url = "https://git.justw.tf/Lightemerald/setup-script/raw/branch/main/Setup%20files/Couvac.exe" # Validated 07/11/23
|
Url = "https://git.justw.tf/Lightemerald/setup-script/raw/branch/main/Setup%20files/Couvac.exe"
|
||||||
FileName = "Couvac.exe"
|
FileName = "Couvac.exe"
|
||||||
|
Hash = "298b1337e914c56bb96ce358dbc9e4d38371aca4"
|
||||||
},
|
},
|
||||||
@{
|
@{
|
||||||
Url = "https://git.justw.tf/Lightemerald/setup-script/raw/branch/main/Setup%20files/ChemSketch.zip" # Validated 07/11/23
|
Url = "https://git.justw.tf/Lightemerald/setup-script/raw/branch/main/Setup%20files/ChemSketch.zip"
|
||||||
FileName = "ChemSketch.zip"
|
FileName = "ChemSketch.zip"
|
||||||
|
Hash = "5c7fce37f60f613bad44f6515d789d3aaf672dc6"
|
||||||
},
|
},
|
||||||
@{
|
@{
|
||||||
Url = "https://git.justw.tf/Lightemerald/setup-script/raw/branch/main/Setup%20files/Anagene.zip" # Validated 13/11/23
|
Url = "https://git.justw.tf/Lightemerald/setup-script/raw/branch/main/Setup%20files/Anagene.zip"
|
||||||
FileName = "Anagene.zip"
|
FileName = "Anagene.zip"
|
||||||
|
Hash = "17d6a6fd898644b9b3771affa95842f0992d19cf"
|
||||||
} ,
|
} ,
|
||||||
@{
|
@{
|
||||||
Url = "https://officecdn.microsoft.com/db/492350f6-3a01-4f97-b9c0-c7c6ddf67d60/media/fr-fr/O365ProPlusRetail.img" # Validated 07/11/23
|
Url = "https://officecdn.microsoft.com/db/492350f6-3a01-4f97-b9c0-c7c6ddf67d60/media/fr-fr/O365ProPlusRetail.img" # Validated 15/11/23
|
||||||
FileName = "O365ProPlusRetail.img"
|
FileName = "O365ProPlusRetail.img"
|
||||||
|
Hash = "6d603e00560bb9619453d1fa1c1a5984850db6d2"
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
"Info" {
|
"Info" {
|
||||||
$filesToDownload = @(
|
$filesToDownload = @(
|
||||||
@{
|
@{
|
||||||
Url = "https://education.lego.com/_/downloads/EV3_Classroom_Windows_1.5.3_Global.msi" # Validated 07/11/23
|
Url = "https://education.lego.com/_/downloads/EV3_Classroom_Windows_1.5.3_Global.msi" # Validated 15/11/23
|
||||||
FileName = "EV3_Classroom_Windows_1.5.3_Global.msi"
|
FileName = "EV3_Classroom_Windows_1.5.3_Global.msi"
|
||||||
|
Hash = "70ed2ab3f18f157db6556f88e99f8575a2498379"
|
||||||
},
|
},
|
||||||
@{
|
@{
|
||||||
Url = "https://git.justw.tf/Lightemerald/setup-script/raw/branch/main/Setup%20files/simulation.zip" # Validated 07/11/23
|
Url = "https://git.justw.tf/Lightemerald/setup-script/raw/branch/main/Setup%20files/simulation.zip"
|
||||||
FileName = "simulation.zip"
|
FileName = "simulation.zip"
|
||||||
|
Hash = "2327c15c390d53d4d5929a1a53acea566c8fba42"
|
||||||
},
|
},
|
||||||
@{
|
@{
|
||||||
Url = "https://git.justw.tf/Lightemerald/setup-script/raw/branch/main/Setup%20files/RobotProg.zip" # Validated 07/11/23
|
Url = "https://git.justw.tf/Lightemerald/setup-script/raw/branch/main/Setup%20files/RobotProg.zip"
|
||||||
FileName = "RobotProg.zip"
|
FileName = "RobotProg.zip"
|
||||||
|
Hash = "5ed0962c5aefb5738d4408bb475655ea02e96dbb"
|
||||||
},
|
},
|
||||||
@{
|
@{
|
||||||
Url = "https://officecdn.microsoft.com/db/492350f6-3a01-4f97-b9c0-c7c6ddf67d60/media/fr-fr/O365ProPlusRetail.img" # Validated 07/11/23
|
Url = "https://officecdn.microsoft.com/db/492350f6-3a01-4f97-b9c0-c7c6ddf67d60/media/fr-fr/O365ProPlusRetail.img" # Validated 15/11/23
|
||||||
FileName = "O365ProPlusRetail.img"
|
FileName = "O365ProPlusRetail.img"
|
||||||
|
Hash = "6d603e00560bb9619453d1fa1c1a5984850db6d2"
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
"Laptop" {
|
"Laptop" {
|
||||||
$filesToDownload = @(
|
$filesToDownload = @(
|
||||||
@{
|
@{
|
||||||
Url = "https://officecdn.microsoft.com/db/492350f6-3a01-4f97-b9c0-c7c6ddf67d60/media/fr-fr/O365ProPlusRetail.img" # Validated 07/11/23
|
Url = "https://officecdn.microsoft.com/db/492350f6-3a01-4f97-b9c0-c7c6ddf67d60/media/fr-fr/O365ProPlusRetail.img" # Validated 15/11/23
|
||||||
FileName = "O365ProPlusRetail.img"
|
FileName = "O365ProPlusRetail.img"
|
||||||
|
Hash = "6d603e00560bb9619453d1fa1c1a5984850db6d2"
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
"Office" {
|
"Office" {
|
||||||
$filesToDownload = @(
|
$filesToDownload = @(
|
||||||
@{
|
@{
|
||||||
Url = "https://officecdn.microsoft.com/db/492350f6-3a01-4f97-b9c0-c7c6ddf67d60/media/fr-fr/O365ProPlusRetail.img" # Validated 07/11/23
|
Url = "https://officecdn.microsoft.com/db/492350f6-3a01-4f97-b9c0-c7c6ddf67d60/media/fr-fr/O365ProPlusRetail.img" # Validated 15/11/23
|
||||||
FileName = "O365ProPlusRetail.img"
|
FileName = "O365ProPlusRetail.img"
|
||||||
|
Hash = "6d603e00560bb9619453d1fa1c1a5984850db6d2"
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -114,5 +133,8 @@ function DownloadFiles {
|
|||||||
if (-not (Test-Path -Path $filePath -PathType Leaf)) {
|
if (-not (Test-Path -Path $filePath -PathType Leaf)) {
|
||||||
Invoke-WebRequest -Uri $fileInfo.Url -OutFile $filePath
|
Invoke-WebRequest -Uri $fileInfo.Url -OutFile $filePath
|
||||||
}
|
}
|
||||||
|
if ((Get-FileHash -Path $filePath).Hash -ne $fileInfo.Hash) {
|
||||||
|
Invoke-WebRequest -Uri $fileInfo.Url -OutFile $filePath
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
# Setup users
|
# Setup users
|
||||||
|
|
||||||
|
|
||||||
function SetupUsers {
|
function SetupUsers {
|
||||||
$username = "Eleve"
|
$username = "Eleve"
|
||||||
if ($null -eq $(Get-LocalUser -Name $username -ErrorAction SilentlyContinue)) {
|
if ($null -eq $(Get-LocalUser -Name $username -ErrorAction SilentlyContinue)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user