problem with custom action on windows 2003 32-bit - Advanced Installer Community
psf
Posts: 43
Joined: Wed Jun 04, 2014 11:00 am

problem with custom action on windows 2003 32-bit

Using AI 11.2.1, I have created a very simple 32-bit install package.
It delivers a merge module, created with VIsual Studio 2008. The merge module has a custom action which is some managed code within an 'Install'-derived class in a .net 3.5 assembly.
I can install the package on a 32-bit Windows7 system. However, it does not install on a Windows 2003 32-bit system. It puts out a message box , shown in the attachment, indicating a problem "System.BadImageFormatException" in the assembly containing the custom action.
Any ideas as to what could be causing this difference in behaviour?
Attachments
installerrorr.png
installerrorr.png (7.47 KiB) Viewed 5071 times
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: problem with custom action on windows 2003 32-bit

Hi,

This problem may appear if the version of the ".NET Framework" software installed on the Windows 2003 machine is older than the version required by your custom action. For more details you can take a look on the BadImageFormatException Class article.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
psf
Posts: 43
Joined: Wed Jun 04, 2014 11:00 am

Re: problem with custom action on windows 2003 32-bit

The target machine has .net frameworks installed ('4 extended', '4 client profile', '3.5SP1', '3.0 Service Pack 2', '2.0 service pack 2').
I tried building my .net assembly to target .net 2, but that made no difference.
I created a simple visual studio 2008 setup project to deliver the same merge module as the AI project, and the Visual Studio setup installed fine.
If it's of any use, I have attached the merge module which my setup delivers, and which has the install custom action. I have also attached the .cs file which the assembly included in the merge module is built from.
Attachments
MyCustact.zip
zip containing merge module (VS2008) and source code for the install custom action
(47.76 KiB) Downloaded 386 times
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: problem with custom action on windows 2003 32-bit

Hi,

I tested your merge module, but I couldn't install it on a Windows 7 machine either and it seems like it is corrupted.

Can you please send me a package that contains that merge module, so I can install it and try to reproduce the problem? The merge module project and the package project may also be helpful. You can send them to support at advancedinstaller dot com.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
psf
Posts: 43
Joined: Wed Jun 04, 2014 11:00 am

Re: problem with custom action on windows 2003 32-bit

Problem was traced to the config.xml file associated with the VSDFxConfigFile 'Set Installer Property' custom action which had been added to the setup in order for the c# custom actions to be invoked. That file specifies the supported .net framework runtime versions. There were entries in that xml file for .net framework 1, and it seems that on the target system, that was what was being used by the installer to run the custom action. The problem was fixed by removing those entries for .net framework 1.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: problem with custom action on windows 2003 32-bit

Hi,

I'm glad you resolved the problem. Thank you for sharing the solution with us, I'm sure it will help other users in the future.

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

Return to “Common Problems”