Windows Installer logs - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

Dashut
Posts: 142
Joined: Tue May 04, 2010 4:41 pm

Windows Installer logs

Using AI 7.7:
I found that from Windows Installer 4.0 and above, you can set Property values: "MsiLogging" and "MsiLogFileLocation" and it should enable logging without the use of command line:
http://msdn.microsoft.com/en-us/library ... 85).aspx#1
and
http://msdn.microsoft.com/en-us/library ... S.85).aspx

So what I did was create these property values in the "Table Editor" -> Tables -> "Property"
like so:

Code: Select all

Property: MsiLogFileLocation
Value: c:\tmp2\installcs.log
and

Code: Select all

Property: MsiLogging
Value: vx
But what happens is that these values are somehow modified probably by AdvancedInstaller. How I know this? I found the log file in my %temp% dir, and here's part of the log which changes my initial values:

Code: Select all

MSI (c) (BC:24) [18:23:32:343]: PROPERTY CHANGE: Modifying MsiLogFileLocation property. Its current value is 'c:\tmp2\installcs.log'. Its new value: 'C:\DOCUME~1\dashut\LOCALS~1\Temp\MSI5cf83.LOG'.
So how to or what to do for enabling logging without using the commandline? I'm sure Microsoft wanted this to work: but I guess you guys are the experts on this one...

Dashut.
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Windows Installer logs

Hello Dashut,

From the documentation you provided, I understand the MsiLogFileLocation property is read-only. It is used to provide you with the location where Windows Installer saved the log. It is not used to set the location, only to read it. I don't think the location of the log can be set using this property.

As a workaround, you could copy the log to wherever you need it at the end of the installation.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
Dashut
Posts: 142
Joined: Tue May 04, 2010 4:41 pm

Re: Windows Installer logs

How can I know which version of Windows Installer AdvancedInstaller 7.7 is using?
Meaning: if I create an Enterprise installer: does this mean AI will use Windows installer 3.0? or 4.0 and so on.
Can I force AdvancedInstaller to use a specific version? (which is a different thing then checking launch conditions for Windows Installer 4.5 for example - because I'm interested to know what version of msi AdvancedInstaller created).

Dashut.
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Windows Installer logs

Hi Dashut,

MSIs by themselves are not targeted towards a specific version of Windows Installer. An msi created with say Advanced Installer 8.0 can be installed on a Windows Installer v1.0 platform painlessly and without problems. It is the features used in the msi that determine which version of Windows Installer should be required on the system.

For example, the MsiLogging property is available in Windows Installer 4.0. If you are using it in your project, the resulting .msi will properly run on 4.0. However, it will also run on Windows Installer 1.0, but the property will be ignored. Windows Installer ignores settings it does not recognize.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
Dashut
Posts: 142
Joined: Tue May 04, 2010 4:41 pm

Re: Windows Installer logs

Okay, got it.
From the tests I did: I see that setting the "MsiLogging" Property to values: "vx!" for example, cause the creation of a log file in %temp%, or more precisely in location defined by Property: "MsiLogFileLocation" (which in my example was: 'C:\DOCUME~1\dashut\LOCALS~1\Temp\MSI5cf83.LOG').

So for me, this means that I need only set MsiLogging to "vx", and then at the end of the installation, copy MsiLogFileLocation to any place I want my log.
So now the question is: which place in the custom action should I place this copy command?
I'm looking for a custom action that happens ALWAYS at the end of the installation: Always means: even if the installation fails! (actually: I'm most likely to check the log only on failure: so this is important).
So which custom action/install sequence always happens at the end of the installation: for none error installation and for ones that ended prematurely (also including upgrades).
(I'm guessing that it might be different for NONE UI installations and with UI installations...)

Many thanks, Dashut.
Dashut
Posts: 142
Joined: Tue May 04, 2010 4:41 pm

Re: Windows Installer logs

For UI installation here's what I did:
1. I created a Property "MsiLogging" in the "Table Editor" in "Property" and gave it a value of "vx!" (you can choose any other: see for example: http://support.microsoft.com/kb/223300)
2. I created two "UI Custom Actions":
* UIMakeInstallationDirectory with command line: "md "[APPDIR]Failed Installation Logs\" (and marked ignore return code, since if this directory already exists, then it will fail).
* UICopyMsiLogFile with command line: "xcopy /R /Y "[MsiLogFileLocation]" "[APPDIR]Failed Installation Logs\" (notice: I used: <AI_CUSTACTS>viewer.exe, because the hidden CreateExeProcess of AdvancedInstaller doesn't work well with xopy for some reason).
3. Then I went and added these two custom actions to the "finish" button of the UI for dialog "FatalError" (you can also add to dialog: "UserExit") using: http://www.advancedinstaller.com/forums ... 61&start=0

You can also try renaming the log file because it's in the format: "msi<some generated number>.log".

Just sharing, Dashut.

Return to “Common Problems”