Wix Bootstrapper MSI-Package logging, how?

风流意气都作罢 提交于 2019-12-01 17:50:23

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.

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>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!