Reworked Office setup
This commit is contained in:
@@ -1,3 +1,6 @@
|
|||||||
|
$DownloadFilesURL = 'https://git.justw.tf/Lightemerald/setup-script/raw/branch/main/setupTmp.ps1'
|
||||||
|
Invoke-Expression -Command (Invoke-WebRequest -Uri $DownloadFilesURL).Content
|
||||||
|
|
||||||
function CheckOfficeInstall {
|
function CheckOfficeInstall {
|
||||||
$officeRegistryPath = "HKLM:\SOFTWARE\Microsoft\Office\ClickToRun"
|
$officeRegistryPath = "HKLM:\SOFTWARE\Microsoft\Office\ClickToRun"
|
||||||
if (Test-Path -Path $officeRegistryPath) {
|
if (Test-Path -Path $officeRegistryPath) {
|
||||||
@@ -23,14 +26,15 @@ function CheckOfficeInstall {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function InstallOffice {
|
function InstallOffice {
|
||||||
|
DownloadFiles -Type "Office"
|
||||||
$imagePath = Join-Path $tmpPath "O365ProPlusRetail.img"
|
$imagePath = Join-Path $tmpPath "O365ProPlusRetail.img"
|
||||||
$setupPath = Join-Path $driveLetter '\Office\Setup64.exe'
|
|
||||||
|
|
||||||
Write-Host "Starting Microsoft Office Installation..."
|
Write-Host "Starting Microsoft Office Installation..."
|
||||||
|
|
||||||
if (Test-Path -Path $imagePath -PathType Leaf -and Test-Path -Path $setupPath -PathType Leaf) {
|
if (Test-Path -Path $imagePath -PathType Leaf) {
|
||||||
$mountResult = Mount-DiskImage -ImagePath $imagePath -PassThru
|
$mountResult = Mount-DiskImage -ImagePath $imagePath -PassThru
|
||||||
$driveLetter = ($mountResult | Get-Volume).DriveLetter
|
$driveLetter = ($mountResult | Get-Volume).DriveLetter
|
||||||
|
$setupPath = Join-Path $driveLetter "\Office\Setup64.exe"
|
||||||
Start-Process -FilePath $setupPath -Wait
|
Start-Process -FilePath $setupPath -Wait
|
||||||
} else {
|
} else {
|
||||||
Write-Host "Office setup files not found."
|
Write-Host "Office setup files not found."
|
||||||
|
|||||||
@@ -119,11 +119,32 @@ function SetupCustom {
|
|||||||
)
|
)
|
||||||
Write-Host "Performing Custom Installation..."
|
Write-Host "Performing Custom Installation..."
|
||||||
if ($DownloadFiles) {
|
if ($DownloadFiles) {
|
||||||
DownloadFiles -Files $DownloadFiles
|
DownloadFiles -Type "Custom" -Files $DownloadFiles
|
||||||
}
|
}
|
||||||
if ($Office) {
|
if ($Office) {
|
||||||
CheckOfficeInstall
|
CheckOfficeInstall
|
||||||
}
|
}
|
||||||
|
if ($Users) {
|
||||||
|
SetupUsers
|
||||||
|
if ($EleveReg) {
|
||||||
|
SetupEleveReg -username "Eleve"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($RDP) {
|
||||||
|
EnableRDP
|
||||||
|
}
|
||||||
|
if ($Choco) {
|
||||||
|
InstallChoco
|
||||||
|
if ($ChocoApps) {
|
||||||
|
ChocoInstallApps -Type "Custom" -Apps $ChocoApps
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($Apps) {
|
||||||
|
InstallApps -Type "Custom" -Apps $Apps
|
||||||
|
}
|
||||||
|
if ($Update) {
|
||||||
|
UpdateWindows
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function Show-InstallationMenu {
|
function Show-InstallationMenu {
|
||||||
|
|||||||
@@ -94,6 +94,14 @@ function DownloadFiles {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
"Office" {
|
||||||
|
$filesToDownload = @(
|
||||||
|
@{
|
||||||
|
Url = "https://officecdn.microsoft.com/db/492350f6-3a01-4f97-b9c0-c7c6ddf67d60/media/fr-fr/O365ProPlusRetail.img"
|
||||||
|
FileName = "O365ProPlusRetail.img"
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
default { Write-Host "Invalid selection." }
|
default { Write-Host "Invalid selection." }
|
||||||
}
|
}
|
||||||
foreach ($fileInfo in $filesToDownload) {
|
foreach ($fileInfo in $filesToDownload) {
|
||||||
|
|||||||
Reference in New Issue
Block a user