So the aip I submitted was a newly created aip file with Enable Verbose Logging checked. The .net custom action is as follows:
Code: Select all
using System;
using System.IO;
using Microsoft.Deployment.WindowsInstaller;
namespace AICustomAction
{
public class CustomActions
{
[CustomAction]
public static ActionResult CopyInstallLogsToC(Session session)
{
try
{
System.Diagnostics.Debugger.Launch();
string msiFileLocation = session["MsiLogFileLocation"].ToString();
string msiLogFileCopyLocation = @"c:\MSIInstallLogFileCopy.log";
if (!string.IsNullOrEmpty(msiFileLocation) && File.Exists(msiFileLocation))
{
File.Copy(msiFileLocation, msiLogFileCopyLocation);
}
}
catch (Exception ex)
{
//Currently logging is here but for simplification it was removed
}
return ActionResult.Success;
}
}
}
This is exhibiting the same behavior as actual AIP file I am using, so I was able to replicate the issue, also interested it this might have something to do with the not showing the log file upon an error when the Show Log file option is selected. Note this is using the windows installer 5. Also note that trying to run the aip file on an xp machine with windows installer 3 causes an error(which I expect), but the log file shows properly for it.
FOLLOW US
Get the latest news in Application Packaging