forcing *all* logs writes to custom log path failing

Topics: Archive - General
Jun 21, 2014 at 4:08 AM
Edited Jun 23, 2014 at 8:27 PM
I edited the AppDeployToolkitConfig.xml changing the default log file directory entries from

<Toolkit_LogPath>$envWinDir\Logs\Software</Toolkit_LogPath>
<MSI_LogPath>$envWinDir\Logs\Software</MSI_LogPath>

To the following in an effort to isolate installations into a sub-directory using a variable defined in the Deploy-Application.ps1

<Toolkit_LogPath>$envWinDir\Logs\Software\$pkgId</Toolkit_LogPath>
<MSI_LogPath>$envWinDir\Logs\Software\$pkgId</MSI_LogPath>

The Deploy-Application.ps1 writes both install and uninstall logs to the $pkgId; however, the AppDeployToolkitMain.ps1 simply refuses to conform it consistently writes PS_AppDeployToolkitMain_3.1.4_EN_01_PSAppDeployToolkit_.log to $envWinDir\Logs\Software directory despite my best efforts.

The log file consists of the following

[20-06-2014 23:01:11] [Asynchronous] App Deploy Toolkit Main called with switch ShowInstallationPrompt
[20-06-2014 23:01:11] [Asynchronous] Displaying custom installation prompt with the non-default parameters: [(Message=The uninstallation of Wireshark 1.10.8 complete.) (ButtonRightText=Ok) (Icon=Information)]...

I understand why the log file was generated, but I don't understand why I am unable to force it to write to $envWinDir\Logs\Software\$pkgId. Any words of wisdom would be greatly appreciated.

Best Regards,

Yves
Coordinator
Jun 25, 2014 at 8:16 PM
Hi Yves,

Sounds like the asynchronous script is looking at a cached copy of the XML file. Try deleting this path and running the script again:

C:\Users\Public\PSAppDeployToolkit

To fix the _.log name, you can wait until the next release or use this code:

Variables: Log Files

$logTempFolder = Join-Path $envTemp $installName
If ($deploymentType -eq $Null) {$deploymentType = "Install" }
If ($configToolkitCompressLogs) {
$logFile = Join-Path $logTempFolder ("$installName" + "_$appDeployToolkitName" + "_$deploymentType.log")
$zipFileDate = (Get-Date).ToString("yyyy-MM-dd-hh-mm-ss")
$zipFileName = Join-Path $configToolkitLogDir ("$installName" + "_$deploymentType" + "_$zipFileDate.zip")
If (Test-Path -Path $logTempFolder -ErrorAction SilentlyContinue ) { Remove-Item $logTempFolder -Recurse -Force -ErrorAction SilentlyContinue | Out-Null }
If (!(Test-Path -Path $logTempFolder -ErrorAction SilentlyContinue )) { New-Item $logTempFolder -Type Directory -ErrorAction SilentlyContinue | Out-Null }
}
Else {
$logFile = Join-Path $configToolkitLogDir ("$installName" + "_$appDeployToolkitName" + "_$deploymentType.log")
}
Jun 25, 2014 at 8:31 PM
Edited Jun 25, 2014 at 8:31 PM
Sean,

This is perfect! many thanks for responding.

Best regards,

Yves