Ross
Posts: 6
Joined: Fri Jun 24, 2005 4:10 pm

Controlling the order in which DLLs are registered

My installation has a number of DLLs that are auto-registered. Unfortunately, they are being registered in the wrong order which causes the first registration to fail.

How do I change the order in which the files in a directory are installed and registered?

Thanks,

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

Hi Ted,

I am afraid you cannot specify the order in which the installer registers or unregisters self-registering DLLs. This is why Microsoft recommends against self-registration and for entering the necessarry Registry Keys directly instead.

So, the only solution is to use custom actions to register and unregister those DLLs, because the order of execution of the custom actions can be specified.

For more information on this please visit:
http://msdn.microsoft.com/library/defau ... ration.asp

What you must do is:
- add the DLLs to your package
- for each DLL schedule a pair of custom actions, one under "Install" and one under "Uninstall".
- the custom action under "Install" will be of type "New Attached Custom Action", with the target file "\WINDOWS\system32\msiexec.exe". For the command line parameters use the <Edit> button to select the DLL. The "Command Line" field should look something like:
[#mydll.dll]
Finally edit the field to:
/y "[#mydll.dll]"
The qutation marks (") must be included for the file names which contain spaces.
- repeat the same steps for the custom action under "Uninstall" but with the "/y" option replaced with "/z":
/z "[#mydll.dll]"

The order of the custom actions under each section is the one in which the DLLs are registered / unregistered.
Ross
Posts: 6
Joined: Fri Jun 24, 2005 4:10 pm

Mike,

Thanks for the reply. We fixed the problem by doing some restructuring of our project to eliminate the dependencies.

-Ted

Return to “Common Problems”