diff --git a/playbook/preinstall/opentext/Setup-OpenText.ps1 b/playbook/preinstall/opentext/Setup-OpenText.ps1 index 16abdf2..1dbd8f4 100644 --- a/playbook/preinstall/opentext/Setup-OpenText.ps1 +++ b/playbook/preinstall/opentext/Setup-OpenText.ps1 @@ -41,6 +41,16 @@ if (-not $SourceDir) { $SourceDir = $PSScriptRoot } +# Normalize $SourceDir to a canonical absolute path. The CMD shim passes +# "%~dp0..\apps\opentext" which embeds a literal "..". msiexec / the Windows +# Installer service fail to open the package with that unresolved segment +# (exit 1619, ERROR_INSTALL_PACKAGE_OPEN_FAILED), even though every other +# .NET / PowerShell API resolves it fine. Resolve-Path collapses ".." into +# a clean drive-rooted path before any msiexec invocation. +if (Test-Path -LiteralPath $SourceDir) { + try { $SourceDir = (Resolve-Path -LiteralPath $SourceDir).ProviderPath } catch {} +} + # --- Inline site-config reader (this script runs from C:\PreInstall\installers\opentext\, # NOT from C:\Enrollment\shopfloor-setup\, so it can't dot-source Get-PCProfile.ps1) --- function Get-SiteConfig {