Posts: 55
Joined: Tue Dec 01, 2009 12:45 pm

New Performance Counters not present after Upgrade

Wed Dec 29, 2010 5:47 pm

The new version of my application contains some new Performance Counters. After upgrading to the latest version, these new Performance Counters are not installed. :shock:
There are no issues found in the installation logs, and the new dll, containing the new Performance Counters, is copied to the installation folder, but the new counters are not present in the registry.

It took me a few days and the help of Cosmin to find the cause of this problem: When Uninstalling the old Performance Counters, the Installer creates a handle to the dll and keeps this handle, even if the dll is removed (renamed to C:\Config.Msi\<random string>.rbf). When the new version of this dll should be called to install the new Performance Counters, the Installer uses the handle to call the Install method in the old dll, effectively re-installing the old Performance Counters. I added a topic about Howto: Debug .Net Installer Class Custom Action.

This issue is caused by the Windows Installer (and probably won't be fixed by Microsoft :( ), so we have to create a workaround. We have to make sure that the Custom Action server process from the Uninstall is not re-used during the Install phase of an Upgrade. We have to stop this process before we start any Custom Actions at the Install phase.

Solution: Call "ExitProcess" from kernel32.dll to end the Uninstall server proces at the beginning of the Install phase of an Upgrade.
  • Add a Predefined Custom Action "Call Function From Standard DLL" as the first action of the Install execute sequence step.
  • Path: [SystemFolder]kernel32.dll
  • Return Type: Void
  • Calling Convention: C Calling Convention
  • Name: ExitProcess
  • Arguments: Type: Integer, Passing Method: By Value, Inline Value: 0
  • Synchronous Execution, Check Return Code
  • Deferred with no impersonation
  • Execution Condition: ( NOT Installed ) AND ( OLDPRODUCTS ) AND ( NOT (VersionNT64) )
This effectively stops the Custom Action server process and releases any handles to old dll's, so a new Custom Action server process will be created when needed for any next Install Custom Action.

For 64-bit systems, you should use the 64-bit Predefined Custom Action "Call Function From Standard 64-bit DLL" (available in AI 8.1) and use the following:
  • Path: [System64Folder]kernel32.dll
  • Execution Condition: ( NOT Installed ) AND ( OLDPRODUCTS ) AND ( VersionNT64 )

Return to “Common Problems”