View Full Version : Where do I put a Custom DLL to use during install?

01-21-2003, 06:58 AM
Where do I put a Custom DLL so I can use it through out the install?


01-21-2003, 03:24 PM
I don't quite follow. Are you trying to run the same file multiple times as custom actions? If it is an exe file you can:

1. Put the file in the "English" node of the Setup Files View
2. Create a new Exe Custom Action
3. Set it's "Source Location" property to 'File exists on Target Machine"
4. Set "Folder" property to "[SUPPORTDIR]" (you will have to type this in)
5. Set the "Filename and Command Line" to "MyFile.exe"

Basically by putting the file in "Setup Files" view you are making the file be temporarily available for the entire duration of the install (and uinstall). So you can have any amount of custom action (as configured above) calling it. The only difference between this and setting "Browse for File Location" is that the file doesn't get streamed in to the setup more than once.

01-22-2003, 05:47 AM
I have a custom action dll that contains a number of functions one set of which checks to see if the interbase server is running so it needs to be run at the begining of the install. If it's 9x it gives a message box for the user to stop the program, if NT and running as a service it shuts it down. So that part of the custom action dll needs to be available at the begining of the install. The dll also contains functions to install Interbase as a service and unintall interbase as a service and to set the service file. Installing and setting the service file need to be run after file transfer. Uninstalling the service needs to be run before uninstall.



01-22-2003, 11:33 AM
I'm afraid you are going to have to create DLL custom actions that have source locations of "Browse File System" for each time you want to call this DLL. This means that the DLL will be inlcuded multiple times in to your msi file - once for each call. So if the DLL is 50K and you have 10 custom actions, your msi will be 450K larger than it should. Is this a problem?

If not, proceed as mentioned above and let me know if you have any problems. This type of Custom Action can be run any time in the install and uninstall.

Please note that the Windows Installer does not allow you to run DLL or VBScript custom actions that "Exist on the Target Machine" (like Exe custom actions). That's why you have to resort to this approach.

01-25-2003, 10:56 AM
Where do I put the dll's when I use "Browse File System" so I can use them with the install? When I use "Installed with Product" I can only invoke "after setup complete success dialog".

Thanks for your help.


01-25-2003, 12:49 PM
Are you saying that if I choose "Browse File System" the install program puts an image of the file from my system into the msi file that will be available to the user's system through the msi file during install?


01-27-2003, 01:37 PM
Yes. When you use "Browse File System", and point at a file and build, Express will this file inside the msi. Then at runtime, when the custom action needs it, it will extract it to a temporary location and run it from there. The Windows Installer knows where this file is being extracted to so you don't need to worry about any of that. If you need to call 5 functions from this DLL, just create 5 Custom Actions with "Source Location" set to "Browse File System". Build and install.