JustAProgrammer
Posts: 26
Joined: Mon Apr 07, 2014 10:11 pm

Log files?

So I have enable verbose log file checked and the file is being generated. The problem is in a .net custom action session["MsiLogFileLocation "] the file name it points to does not exist that I see, but there is a MSI####.log file that goes with the install in the temp directory.

Am I looking at the wrong property for this?
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Log files?

Hi,

The [MsiLogFileLocation] is the correct property that stores the location of the verbose log file generated by Windows Installer. For more details you can take a look on the Where is verbose logging file thread.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
JustAProgrammer
Posts: 26
Joined: Mon Apr 07, 2014 10:11 pm

Re: Log files?

So below is what I am seeing when looking at what is in the MsiLogFileLocation:

now here is what is in my temp folder at that time:


As you can see that file does not exist. Can you please explain what I am doing wrong here or what I am missing? Note again I have only used the Enable Verbose Logging option under the Install Parameters Tab and this is Version 11.1 build 56565.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Log files?

Hi,

I'm not sure why you encounter this behavior. I tested the [MsiLogFileLocation] property and it returned the correct value on my machine. Can you please send us the .AIP (project file) and a verbose log of the installation to support at advancedinstaller dot com so we can investigate them?

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
JustAProgrammer
Posts: 26
Joined: Mon Apr 07, 2014 10:11 pm

Re: Log files?

I need to check what policy is for this before sending more than just generic data.

As for the log file it shows the MsiLogFileLocation property changed as follows:

MSI (c) (A0:14) [10:34:51:916]: PROPERTY CHANGE: Adding MsiLogFileLocation property. Its value is 'C:\Users\XXXX\AppData\Local\Temp\MSIaca4e.LOG'.

but that is not what it is reporting in the custom action when the session["MsiLogFileLocation"] property is accessed as shown above.

I am going to submit a generic build with no install files and including a custom action dll with one custom action that launches a VS.net debugger if you have that installed. I will send it to the support email.
JustAProgrammer
Posts: 26
Joined: Mon Apr 07, 2014 10:11 pm

Re: Log files?

Email sent.
JustAProgrammer
Posts: 26
Joined: Mon Apr 07, 2014 10:11 pm

Re: Log files?

Checking to see if the email was received as I did not get a confirmation of an sort.

thanks
JustAProgrammer
Posts: 26
Joined: Mon Apr 07, 2014 10:11 pm

Re: Log files?

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.
JustAProgrammer
Posts: 26
Joined: Mon Apr 07, 2014 10:11 pm

Re: Log files?

I guess let me explain my goal and see if you have or can think of a better way to achieve it. I am wanting to copy the verbose installer log file to toa specified directory with a name that can be specified.

This will need to be done after the installation, but note I am also launching an app after the install in the finish action of the exit dialog.

From there I can handle it with the software but I would like a reliable way to get to the install log file to the specified directory on XP SP3(could be WIndows installer 3)-WIndows 8 machines.
JustAProgrammer
Posts: 26
Joined: Mon Apr 07, 2014 10:11 pm

Re: Log files?

So as a followup, the issue I am having comes from trying to do all of this in one step. Dan gave an example solution that shows doing this in 2 steps the first is getting the MsiFileLocation in an immediate custom action and setting it to a user defined property then passing it as a custom data action to a deferred custom action that does the copying.

Thanks.

Lastly can are properties declared in custom actions or under the install parameters page able to be passed to a function via the arguments say if I were to launch a file from the exit dialog?

Return to “Building Installers”