0

I have a weird msi!!!

I have installed my 32bit msi(target=x86) on 64 bit machine, every things seems to work fine except some COM dlls which fails to load and gets "An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)" this error.

I have noticed that the same COM dlls works fine on 64bit machine on development environment. I am clueless why msi installed COM's have the problem.

Regards,

Girish

Giri Deshi
  • 43
  • 7
  • Did you make sure that your 32bit installation package contains only 32bit COM dlls ? Also COM registration requires UAC elevation. – Indy9000 May 14 '12 at 16:07
  • thank you for the reply, i'm sure that those are 32bit COM dll's as it is working fine on the 32bit OS. Also what i noticed from this is the same COM DLL's loads fine when i work VS 2008 development on 64 bit machine – Giri Deshi May 14 '12 at 16:23

2 Answers2

0

Your C# program (exe projects) must be compiled as x86 (32 bit) in order to load x86 libraries.

Guillaume
  • 12,824
  • 3
  • 40
  • 48
  • Yes, my msi is built as platform target x86 – Giri Deshi May 14 '12 at 16:20
  • Your msi contains your exe, your exe should also be built as x86. – Guillaume May 15 '12 at 07:52
  • I don't have source of those DLLs & EXE's those are developed long back and given to us. Is there any work around other than building it as x86 – Giri Deshi May 15 '12 at 08:58
  • some more info: The solution consists of more than 60 projects, except for the wixproject(WIX, project for creating msi) all are set to platform='ANY CPU'. should i change all the projects in solution as 'x86' – Giri Deshi May 15 '12 at 09:18
  • Doing this to the exe project(s) should be enough. – Guillaume May 15 '12 at 09:30
  • Thanks a ton, i have set exe project(s) to platform=x86. the problem disappeared, thanks again – Giri Deshi May 15 '12 at 11:42
  • Hi Guillaume: I'm again stuck in the same problem this time other module is not loading the 3rd party COMs. I have set all the Project(s) of type exe's in the solution to platform=x86. Any other ways of doing it. – Giri Deshi May 28 '12 at 09:43
  • Be sure that 3rd praty COMs are compiled as 32bit (x86) and not 64bit. Also, you can accept my answer. – Guillaume May 29 '12 at 14:01
0

If you're using InstallShield to create the MSI, then the COM information merged into the registry may or may not be in the correct location. Since InstallShield will typically extract the registry information during installer build, and merges that into the registry at install time it may or may not be getting things correct if you haven't double checked this.

You'll want to ensure that the COM information for the 32bit components exists only under the Wow6432Node key.

Tra5is
  • 146
  • 1
  • 7
  • Tra5is: I'm using WIX to create MSI, can you please share a link which gives me idea of registering COM's into Registry. – Giri Deshi May 14 '12 at 18:50
  • http://stackoverflow.com/questions/1105031/can-my-32-bit-and-64-bit-com-components-co-reside-on-the-same-machine and http://msdn.microsoft.com/en-us/library/windows/desktop/ms724072(v=vs.85).aspx – Tra5is May 14 '12 at 21:11