From 71b39890835f62e9394515183c01cbd0c5252458 Mon Sep 17 00:00:00 2001 From: rbalsleyMSFT <53497092+rbalsleyMSFT@users.noreply.github.com> Date: Wed, 16 Jul 2025 18:04:17 -0700 Subject: [PATCH] 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. --- FFUDevelopment/BuildFFUVM.ps1 | 9 ++++++++- FFUDevelopment/BuildFFUVM_UI.xaml | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/FFUDevelopment/BuildFFUVM.ps1 b/FFUDevelopment/BuildFFUVM.ps1 index a9dfa38..b4228ab 100644 --- a/FFUDevelopment/BuildFFUVM.ps1 +++ b/FFUDevelopment/BuildFFUVM.ps1 @@ -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' diff --git a/FFUDevelopment/BuildFFUVM_UI.xaml b/FFUDevelopment/BuildFFUVM_UI.xaml index ae72df8..8e10d0e 100644 --- a/FFUDevelopment/BuildFFUVM_UI.xaml +++ b/FFUDevelopment/BuildFFUVM_UI.xaml @@ -480,14 +480,14 @@ - + - +