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) )
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 )