Adds support for custom Office configuration XML

Introduces the ability to use a custom XML file for Office installation, allowing for more flexible configurations.

The build script now accepts an `OfficeConfigXMLFile` parameter. If provided, its filename will be used for the installation.

The Office Deployment Toolkit is now downloaded to the specified Office path instead of the development path. UI tooltips are updated to clarify this behavior.
This commit is contained in:
rbalsleyMSFT
2025-07-16 18:04:17 -07:00
parent e753344137
commit 71b3989083
2 changed files with 10 additions and 3 deletions
+8 -1
View File
@@ -277,6 +277,7 @@ param(
[hashtable]$AppsScriptVariables,
[bool]$InstallOffice,
[string]$OfficeConfigXMLFile,
[ValidateSet('Microsoft', 'Dell', 'HP', 'Lenovo')]
[string]$Make,
[string]$Model,
@@ -1962,9 +1963,15 @@ function Get-ODTURL {
}
function Get-Office {
# If a custom Office Config XML is provided via config file, use its filename for the installation.
# The UI script is responsible for copying the file itself to the OfficePath.
if ((Get-Variable -Name 'OfficeConfigXMLFile' -ErrorAction SilentlyContinue) -and -not([string]::IsNullOrEmpty($OfficeConfigXMLFile))) {
$script:OfficeInstallXML = Split-Path -Path $OfficeConfigXMLFile -Leaf
WriteLog "A custom Office configuration file was specified. Using '$($script:OfficeInstallXML)' for installation."
}
#Download ODT
$ODTUrl = Get-ODTURL
$ODTInstallFile = "$FFUDevelopmentPath\odtsetup.exe"
$ODTInstallFile = "$OfficePath\odtsetup.exe"
WriteLog "Downloading Office Deployment Toolkit from $ODTUrl to $ODTInstallFile"
$OriginalVerbosePreference = $VerbosePreference
$VerbosePreference = 'SilentlyContinue'