PDA

View Full Version : .NET Custom Actions?



VAKroese
02-05-2003, 06:39 AM
Hi,

I am very enthousiatic about the .NET development environment. Clearly this is where the future takes us.
Now I am wondering if it is already possible to write Custom Action DLL's in a .NET language (in my case C# managed code).
I haven't been programming C/C++ sinds the late 80's and I prefer not to go back to it (pre-.NET :) ).

Thanks,
Victor

Chandima
02-05-2003, 05:42 PM
We support calling Installer class CAs, but there is no entry point in the assembly that allows us to call directly into it. So you basically have to add an installer class to your assembly, then specify that the installer class should be called during the installation. The latter can be done by going to Files View, right clicking on the file and selecting the "installer class" checkbox from the "COM and .NET settings" tab of the Property dialog.

This means:
1. It won't be a traditional custom action because it won't show in the Custom Action View.
2. The file HAS to be deployed with your Setup.
3. The custom action will launch only just before the Setup Complete Success dialog launches. You cannot change this. This is because the file has to be installed for the Installer Class to launch.

So basically, it is technically possible, but very limited. Sorry.

VAKroese
02-06-2003, 03:53 AM
Thanks Chandima,

I already found out about the installer class. But there I don't seem to have access to all these usefull variables like SourceDir etc.
Also it seems that if you have more installer classes they will be called in order of name. I don't know if that order can be changed. Then with uninstalling they are called in the same order. Multiple installer classes in the same assembly are called in reverse order, but if they are over more files they are called in the same order.

So it seems the way to go here is a final .exe file where it is possible to pass SourceDir and the like via the commandline.

Victor.

VAKroese
02-06-2003, 04:27 AM
I was just thinking of another way that I may be able to call upon .NET classes. By actually calling upon executables that can be called from VBS. There I can also pass the information I need on the commandline, right?!
And these I can call on different moments in the installation process. For example I might need to call them before the installer classes are run (for creating evenLog entries, services and the like).
This could probably be done 'after the setup progress dialog'. Is this event called before the installers are triggered?

Thanks,
Victor.

Chandima
02-07-2003, 05:20 PM
That's a good workaround. "After Setup Progress dialog" is launched after these files are installed.

FYI-
Currently with Express 4.0, VBScript and DLL custom actions cannot use the following sequence locations that Exe custom actions have:

After File Transfer
After COM Registration
After Product Register

These will be enabled for VBScript and DLL Custom Actions in the Express 4.0 Service Pack (now in Beta).

VAKroese
02-08-2003, 05:32 AM
That's great news Chandima,

I'll be looking out for the service pack. My guess is that in this case I would be needing the 'After file transfer'.

Thanks again,

Victor.