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 {
|
||||
$officeRegistryPath = "HKLM:\SOFTWARE\Microsoft\Office\ClickToRun"
|
||||
if (Test-Path -Path $officeRegistryPath) {
|
||||
@@ -23,14 +26,15 @@ function CheckOfficeInstall {
|
||||
}
|
||||
|
||||
function InstallOffice {
|
||||
DownloadFiles -Type "Office"
|
||||
$imagePath = Join-Path $tmpPath "O365ProPlusRetail.img"
|
||||
$setupPath = Join-Path $driveLetter '\Office\Setup64.exe'
|
||||
|
||||
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
|
||||
$driveLetter = ($mountResult | Get-Volume).DriveLetter
|
||||
$setupPath = Join-Path $driveLetter "\Office\Setup64.exe"
|
||||
Start-Process -FilePath $setupPath -Wait
|
||||
} else {
|
||||
Write-Host "Office setup files not found."
|
||||
|
||||
Reference in New Issue
Block a user