WixBundleLog - , . , , "Wix". bootstrapper , bootstrapper .
. . - :
this.LogsDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonDocuments), @"Company_Name\Logs\Installer\", DateTime.Now.ToString("yyyyMMdd_hhmmss"));
_logVariables = new List<string>();
_logVariables.Add("WixBundleLog");
[WixBundleLog] _PackageId.
bootstrapper, PlanPackageComplete , , , .
//set *possible* log variables for a given package
_logVariables.Add("WixBundleLog_" + e.PackageId);
_logVariables.Add("WixBundleRollbackLog_" + e.PackageId);
, :
private void CopyLogs()
{
if (!Directory.Exists(this.LogsDirectory))
Directory.CreateDirectory(this.LogsDirectory);
foreach (string logVariable in _logVariables)
{
if (this.Bootstrapper.Engine.StringVariables.Contains(logVariable))
{
string file = this.Bootstrapper.Engine.StringVariables[logVariable];
if (File.Exists(file))
{
FileInfo fileInfo = new FileInfo(file);
fileInfo.CopyTo(Path.Combine(this.LogsDirectory, fileInfo.Name), false);
}
}
}
}