From 9312fa3c5f0b2ac0a90a01fe9fc447000d5c3286 Mon Sep 17 00:00:00 2001 From: Lightemerald Date: Mon, 23 Oct 2023 14:58:56 +0000 Subject: [PATCH] Update setupScriptInfo.ps1 --- setupScriptInfo.ps1 | 41 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/setupScriptInfo.ps1 b/setupScriptInfo.ps1 index 0ab7b80..8e715d9 100644 --- a/setupScriptInfo.ps1 +++ b/setupScriptInfo.ps1 @@ -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"