[Pre-Install] :: Executing ["C:\WINDOWS\system32\msiexec.exe" /x {a2c07f22-9423-4788-88da-7bc2edd65e18} ALLUSERS=1 REBOOT=ReallySuppress REBOOTPROMPT=Suppress ROOTDRIVE=C:\ /QN /L*V C:\Logfiles\Software1\Teamviewer-QuickSupport15_15.64.3.0_Uninstall.log]
[Pre-Install] :: Execution failed with exit code [1622]: Error opening installation log file. Ensure the specified log file exists and is not write-protected.
I'll leave it at the change in the Config.psd1, since I have both PSADT-Installation-Log and Source-Install.log there and the directory created if not present, thanks anyway
The code in Start-ADTMsiProcessshould be creating the log directory if it doesn't exist:
# Build the log path to use.
$logPath = if ($logFile)
{
# A defined MSI log path is considered an override.
if (![System.String]::IsNullOrWhiteSpace($adtConfig.MSI.LogPath))
{
# Create the Log directory if it doesn't already exist.
if (!(Test-Path -LiteralPath $adtConfig.MSI.LogPath -PathType Container))
{
$null = [System.IO.Directory]::CreateDirectory($adtConfig.MSI.LogPath)
}
# Build the log file path.
(Join-Path -Path $adtConfig.MSI.LogPath -ChildPath $logFile).Trim()
}
elseif ($adtSession)
{
# Get the log directory from the session. This will factor in
# whether we're compressing logs, or logging to a subfolder.
(Join-Path -Path $adtSession.LogPath -ChildPath $logFile).Trim()
}
else
{
# Fall back to the toolkit's LogPath.
if (!(Test-Path -LiteralPath $adtConfig.Toolkit.LogPath -PathType Container))
{
$null = [System.IO.Directory]::CreateDirectory($adtConfig.Toolkit.LogPath)
}
# Build the log file path.
(Join-Path -Path $adtConfig.Toolkit.LogPath -ChildPath $logFile).Trim()
}
}
I'll test and confirm whether this is the case or not.
mjr4077au, please don't do it. I'll just change it in config.psd1, as I want to have the PSADT and installation logs together. You've solved this well, and I think it's an optimal solution. There's no point in investing any more time. I was on the wrong track. Thanks.