Summary
InstallShield supports self-registering DLLs and EXEs. Although it is likely that it will know which DLLs and EXEs in the installation package are self-registering, there may be times when you do not know. Because self-registering DLLs and EXEs are handled differently than non-self-registering DLLs and EXEs, there needs to be a way to determine if a DLL or EXE is self-registering.Synopsis
This article discusses how determine if a DLL or EXE is self-registering.
Discussion
InstallShield supports self-registering DLLs and EXEs. Although it is likely that it will know which DLLs and EXEs in the installation package are self-registering, there may be times when you do not know. Because self-registering DLLs and EXEs are handled differently than non-self-registering DLLs and EXEs, there needs to be a way to determine if a DLL or EXE is self-registering.
The standards for self-registration do not require that DLLs and EXEs indicate whether they are self-registering. Therefore, there is no single method for determining this information. However, a few methods will tell you whether a DLL or EXE is self-registering.
DLLs
One way to tell if a file is self-registering is to use Regsvr32.exe. If Regsvr32.exe is able to register the file, you will see this message:
DllRegisterServer in C:\windows\system\mydll.dll succeeded.
If the file is not self-registering, you will see this message:
C:\windows\system\mydll.dll was loaded, but the DllRegisterServer entry point was not found.
Another way to tell if a DLL is self-registering is to right click the DLL in Explorer and look at its properties sheet. If OLESelfRegister is listed, it is a self-registering DLL. Unfortunately, developers are not required to make the OLESelfRegister entry in the version resource of a self-registering DLL; so many self-registering DLLs will not have OLESelfRegister on their properties sheet.
If the properties sheet method (above) does not indicate that a DLL is self-registering, you can look at the DLL's export table. Self-registering DLLs must export the DllRegisterServer and DllUnregisterServer functions so that programs that use the DLLs can call the functions to register and unregister the DLLs. Therefore, DllRegisterServer and DllUnregisterServer are listed in the export tables of self-registering DLLs.
Use an executable header viewing utility such as Exehdr.exe (16-bit) or Dumpbin.exe (32-bit) to look at the DLL's export table. If you see DllRegisterServer and DllUnregisterServer listed, you know it is a self-registering DLL. You can also use the Explorer Shell's QuickView utility to view DLL header information. However, be aware that there are cases where QuickView does not display a DLL's export table, in which case you may wish to use Exehdr.exe or Dumpbin.exe instead.
If you wish to search a folder containing DLLs to see which ones are self-registering, you can use the Explorer Shell's Find command to search DLLs for references to DllRegisterServer and DllUnregisterServer. Once you have a list of candidate files, you can employ any of the other methods described in this article to determine individually which files are self-registering. For example, to determine which files in your Windows System folder are self-registering, follow these steps:
- In Explorer, log onto the Windows System folder.
- From the Tools menu in Explorer, select Find and Files or Folders.
- The Find All Files dialog opens with the Name & Location tab in view. The Named field should be empty and the Look in field should contain the folder you last selected in Explorer (in this example, the Windows System folder). You can select a different folder using the Browse button.
- Once the Look in field contains the folder you wish to search, select the Advanced tab to bring it into view. The Of type field should contain "All Files and Folders." To search only DLL files, select "Application Extension" in the Of type field drop-down list.
- Enter DllRegisterServer or DllUnregisterServer in the Containing text field and click the Find Now button. Explorer searches for files matching the Of type specification in the folder you specified in the Name & Location tab for the string you entered in the Containing text field. Explorer lists the files containing the string in an output window at the bottom of the dialog.
- Once you have a list of files containing references to DllRegisterServer or DllUnregisterServer, use any of the methods described above to individually verify whether each listed file is in fact self-registering.
EXEs
EXEs present greater difficulties than DLLs when it comes to determining self-registration status. The best way to know if an EXE is self-registering is to confirm it with the developer or vendor who produced the EXE.
If you cannot learn from the creator of the EXE whether or not it is a self-registering EXE, there are still a couple methods you can try to determine self-registration status. As with DLLs, if you right click the EXE in Explorer and find that OLESelfRegister is listed on the properties sheet, then you know the EXE is self-registering. However, as with DLLs, there is no requirement to make the OLESelfRegister entry in the EXE's version resource table, so the absence of the OLESelfRegister entry does not necessarily mean that the EXE is not a self-registering file.
Unfortunately, EXEs do not contain entry points and export tables like DLLs, so you cannot check an export table to determine if DllRegisterServer or DllUnregisterServer are exported. Therefore, if the properties sheet method (above) does not indicate that an EXE is self-registering, you are left with little to work with. One possibility is to search the EXE or its resources for the string "regserver" or "unregserver". Self-registration and unregistration in EXEs are initiated by command line arguments /REGSERVER and /UNREGSERVER (not case sensitive), respectively. Therefore, locating the string "regserver" or "unregserver" in the EXE or its resources may indicate that the EXE takes these command line arguments. However, this method is not foolproof.
You may also use a program, such as InstallShield Application Repackager, which logs changes made to the system registry. Launch the EXE in question and examine the log of registry changes.
Even without such a registry tracking utility, one simple method is to perform a before and after examination of the system registry using RegEdit's Find command. Look for the name of the EXE in question. If it has never been registered, it should not show up in the search. Then, launch the EXE. Then, look for it in the Registry again. If it has registered itself, you should find an entry for it in the Registry.
Additional Information
For more information on self-registration, see the InstallShield Help Library topics
Related KB Articles
Q111120Related Articles
Fix "ndtrack.exe is not marked for installation" error when installing the FlexNet Inventory Agent on Windows 45Number of Views Determining if MSI Setup Was Launched from Setup.exe 3Number of Views Determining If an Application Is Currently Running 4Number of Views How to Use Flexible API to Determine if a FEATURE Supports BORROW 8Number of Views Determining If an MSI Install Is Running with Administrative Privileges 3Number of Views
Hi, I am Reva - Ask me anything.
No new updates
Thanks for the feedback!
Your feedback has been saved.Rate this response:
Add Additional feedback ( Optional )
Are you sure you want to cancel
the case creation?
Are you sure you want to cancel the case creation?
Are you sure you want to close this case
| Products | Region | Phone Numbers |
|---|---|---|
| FlexNet Operations FlexNet Embedded FlexNet Publisher FlexNet Connect FlexNet Code Insight InstallAnywhere InstallShield |
North America * |
+1 630-332-2513 (toll) +1 877-279-2853 (toll-free in North America) |
| Europe * |
+44 1925 944367 (toll) +44 800 047 8642 (toll-free in Europe) |
|
| Japan * | +81 3-4540-5335 (select option 2) | |
| Australia * |
+61 3 9895 2177 +61 1800 560 603 (toll-free in Australia) |
|
|
Usage Intelligence (formerly
Revulytics) Compliance Intelligence |
Please use the Case Portal to submit your support ticket or reach out to your Revenera contact. | |
Revenera Assistant
Case id: 00001065
Activity: Status change: 2 hours ago