I have a bootstrapper that installs a MSI-package.
How can i achieve that at least the msi-package-installation gets logged( verbose logging )? And where can i set the log-file-path? Because I won't be able to log everything i guess?
And no, i don't want a cmd-solution , i need to implement this into my setup
Found LogPathVariable, but don't really know how it works?
<MsiPackage SourceFile="$(var.Setup.TargetPath)" LogPathVariable="" />
Googled arround many times and havn't found a solution for this problem, any help?
The default case (no LogPathVariable set) will create logs in C:\\Users\\username\\AppData\\Local\\Temp the MSI logs will be verbose, there will also be a log for the bootstrapper.
For a custom destination you can create a Variable and set it
<Variable Name="MyLogDestination" Type="string" Value=path to where you want log created />
You could use one of the burn variables in conjunction with a partial path. I think
<Variable Name="MyLogDestination" Type="string" Value="[ProgramFiles6432Folder]\YourProduct\" />
might work though I've not tried it.
You would then put your variable name in the LogPathVariable
<MsiPackage SourceFile="$(var.Setup.TargetPath)" LogPathVariable="MyLogDestination" />
That's how I did:
Add Log element under Bundle:
<Log PathVariable="LOGPATH_PROP" Disable="yes" Prefix='[WixBundleOriginalSource]' Extension=".txt" />
and then set the LogPathVariable to "LOGPATH_PROP" in MsiPackage element. The key is to set the Disable attribute to yes in Log element.
Both bundle installation and the packages logs will be created into %TEMP%
(C:\\Users\\username\\AppData\\Local\\Temp).
The naming scheme for the log file is:
BundleName_yyyyMMddHHmmss.log
Where the date and time is when the installation started. For each chained MSI package, Burn automatically enables verbose logging. The chained package log file naming scheme is:
BundleName_yyyyMMddHHmmss_#_PackageId.log
Where # indicate the order that the package was applied. The same package may show up multiple times with #s if the installation failed and the package was removed during rollback. (for example BundleName_yyyyMMddHHmmss_002_FailedPackage_rollback.log)
In order to get the bundle installer location path you can use BootstrapperApplication.Engine.StringVariables[WixBundleLog]
, in order to get the package log file you can use BootstrapperApplication.Engine.StringVariables[WixBundleLog_packageId]
.
if you want to change the default location ( %TEMP%
) you can use the LogPathVariable
attribute of the MsiPackage element to provide a custom log file name:
See: http://wixtoolset.org/documentation/manual/v3/xsd/wix/msipackage.html
Also: https://support.firegiant.com/hc/en-us/articles/230912207-Pass-Properties-to-MsiPackage-from-Bundle-
this will create empty logs folder for you...
<Directory Id="LOGSDIR" Name="logs">
<Component Guid="GUID" Id="ID" KeyPath="no" NeverOverwrite="no" Permanent="no" Location="local" Permanent="no">
<CreateFolder>
<util:PermissionEx CreateChild="yes" CreateFile="yes" Delete="yes" DeleteChild="yes" Read="yes" ReadAttributes="yes" ReadExtendedAttributes="yes" ReadPermission="yes" Traverse="yes" GenericRead="yes" GenericWrite="yes" User="Everyone" />
</CreateFolder>
</Component>
</Directory>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.