lynne
Posts: 1
Joined: Mon Jan 02, 2006 5:20 pm
Contact: Website

Custom Actions - .NET Installer Class

Hello,

First of all, I would like to tell you that I am very impressed with Advanced Installer!

I have already created a working setup program using Visual Studio .NET 2003. Now I am attempting to use AI to create a better setup program. I've got most everything working except my custom action. In Visual Studio, this is how my working custom action is defined:

Name: Primary output from EasyThreadsInstaller (Active)
Condition:
Custom Actions: /CASE="Full" /DIR="[TARGETDIR]\" /MYDIR="[PersonalFolder]\" /WINDIR="[WindowsFolder]\" /USERDATADIR="[ALLUSERSAPPDATAFOLDER]\"
EntryPoint: EasyThreadsInstaller.cs
Installer Class: True
Source Path: C:\Documents and Settings\Lynne\My Documents\easythreads v1.9\EasyThreadsInstaller\EasyThreadsInstaller\obj\Debug\EasyThreadsInstaller.dll

(Source Path is greyed out.)

So, I have added the custom action in AI in every way I possibly can, and always get the same error:

There is a problem with this Windows Installer package. A program required for this install to complete could not be run. Contact your support personnel or package vendor.

How would I set up the custom action? Please give me the specifics as to which type and what exactly should go into the Function Name/Command Line textbox.

Thanks for your help,

Lynne
Mike
Posts: 292
Joined: Wed Jun 01, 2005 10:50 am
Location: Craiova, Romania
Contact: Website

Hi,

I am afraid that Windows Installer does not support .NET DLLs and neither does Advanced Installer. Only native Windows DLLs are supported.

You could use some utility that converts .NET code to binary Windows native code. Such a utility, called ngen.exe, comes with the .NET framework.

After this you can set up an attached custom action with the DLL as the source.

Hope this helps.

Regards,
Mihai
Mihai Bobaru
Advanced Installer Team
http://www.advancedinstaller.com
nickp
Posts: 8
Joined: Tue Jan 10, 2006 12:08 pm

Workaround

Hi there Lynne,

One way you can achieve what you are after is by making a seperate .net exe that can launch custom actions via the command line. So basically the EXE takes input of the assembly to install/uninstall and then passes that information to InstallUtil.exe.

It's a bit of a strange work around but means that your desired actions to the "Custom Actions" section in Advanced Installer. I've been doing it this way for a few months now and it works very reliably. You only need 2 arguments, 1 for filename and 1 for install/uninstall flag.

Hope this helps.

Nick

Return to “Common Problems”