Update setupScriptInfo.ps1

This commit is contained in:
2023-10-23 14:58:56 +00:00
parent 34fcb44b2f
commit 9312fa3c5f

View File

@@ -1,6 +1,3 @@
# Activate windows
irm https://massgrave.dev/get | iex
#Download temp files
$tmpPath = Join-Path $env:LOCALAPPDATA "Temp"
@@ -16,7 +13,11 @@ $filesToDownload = @(
@{
Url = "https://cdn.discordapp.com/attachments/704760633379389533/1161288504765059172/RobotProg.zip"
FileName = "RobotProg.zip"
}
},
@{
Url = "https://officecdn.microsoft.com/db/492350f6-3a01-4f97-b9c0-c7c6ddf67d60/media/fr-fr/O365ProPlusRetail.img"
FileName = "O365ProPlusRetail.img"
}
)
foreach ($fileInfo in $filesToDownload) {
@@ -27,6 +28,38 @@ foreach ($fileInfo in $filesToDownload) {
}
}
# Install Office
function Check-OfficeInstall {
param (
[string] $version = "Office365" # Specify the Office version (e.g., "Office365" or "2019")
)
$officeRegistryPath = "HKLM:\SOFTWARE\Microsoft\Office\ClickToRun"
if (Test-Path -Path $officeRegistryPath) {
$installedPath = Get-ItemProperty -Path $officeRegistryPath | Select-Object -ExpandProperty "InstallPath"
if ($installedPath) {
Write-Host "Microsoft Office is installed at: $installedPath"
if ($installedPath -like "C:\Program Files*") {
Write-Host "Office is installed as 64-bit."
} elseif ($installedPath -like "C:\Program Files (x86)*") {
Write-Host "Office is installed as 32-bit."
} else {
Write-Host "Office architecture is unknown."
}
} else {
Write-Host "Microsoft Office is installed, but the path could not be determined."
}
} else {
Write-Host "Microsoft Office is not installed."
$mountResult = Mount-DiskImage -ImagePath (Join-Path $tmpPath "O365ProPlusRetail.img") -PassThru
$driveLetter = ($mountResult | Get-Volume).DriveLetter
Start-Process -FilePath $(Join-Path $driveLetter '\Office\Setup64.exe') -Wait
}
}
# Activate windows/office
irm https://massgrave.dev/get | iex
# Setup users
$username = "Eleve"