.NET Installer Class Action with condition depending on OS results in "Leaked MSIHANDLE" - Advanced Installer Community
paasen
Posts: 6
Joined: Tue Jun 23, 2015 8:41 am

.NET Installer Class Action with condition depending on OS results in "Leaked MSIHANDLE"

Hi.

Building a package that registers a dll.
What I want is for it to use \2.0.50727\ if windows server 2008 r2 and use \4.0.30319\ if windows server 2012 r2.
Added two custom actions:
>One action with Installer Class Parameters is set to "ReqVersion 2.0.50727" and condition "VersionNT64=601".
>One action with Installer Class Parameters is set to "ReqVersion 4.0.30319" and condition "VersionNT64=603".


Building the package with only one action (2012R2) installation is successfull...
>Installer Class Parameters is set to "ReqVersion 4.0.30319" and condition "VersionNT64".


...but with both actions the installation fails with verbose:

MSI (s) (5C:90) [17:03:47:608]: Hello, I'm your 32bit Elevated Non-remapped custom action server.
MSI (s) (5C!E0) [17:03:47:655]:
MSI (s) (5C:4C) [17:03:47:655]: Leaked MSIHANDLE (52) of type 790531 for thread 1248
MSI (s) (5C:4C) [17:03:47:655]: Note: 1: 2769 2: InstallSnapin_2012 3: 1
Error 1001. Error 1001. Exception occurred while initializing the installation:
System.BadImageFormatException: Could not load file or assembly 'file:///C:\Program Files (x86)\ABC\ABCClientSnapin.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format..
Info 2769. Custom Action InstallSnapin_2012 did not close 1 MSIHANDLEs.
CustomAction InstallSnapin_2012 returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)


Any ideas?
paasen
Posts: 6
Joined: Tue Jun 23, 2015 8:41 am

Re: .NET Installer Class Action with condition depending on OS results in "Leaked MSIHANDLE"

Dont know how but duplicated the entire Project folder and build again and no the installation works like it should on both OS.
Must have been something on my 2012 R2 server that caused the MSI leak.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: .NET Installer Class Action with condition depending on OS results in "Leaked MSIHANDLE"

Hi,

I'm glad you got your project working. Just let us know anytime you encounter a problem.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”