Removing a Server Application
The DoRemove function in GWSETUP.C removes a gateway service's entire configuration. To write a custom application-removal routine, decide which steps are relevant for removing your own server application. The following procedure lists these steps in the order that DoRemove performs them:
To remove a server application
-
Present a dialog box that lets the administrator select an application to remove. The ShowChooseServiceDlg function displays this type of dialog box.
-
Determine whether the application's service is running by calling the FServiceRunning function. If it is running, attempt to stop the service.
-
Remove the directory object. Call the HrRemoveGateway function to remove a gateway object and the HrRemoveMailboxAgent function to remove a mailbox agent from a given site. Both functions are defined in EXCHINST.C.
-
Remove performance monitoring for the service by calling the HrRemoveServicePerfMon function. If the lpfUnloadCounters parameter returned from this function call is TRUE, continue with step 5. If it is FALSE, multiple instances of the application are installed. In this case, perform steps 7 and 8, and then begin again at step 1.
-
Call the FUnloadCounters function to unload the counters used in performance monitoring.
-
Remove the server application's keys from the Windows NT Registry. Do this by calling the HrRemoveRegistry function.
-
Remove the service from service control manager of Windows NT. Do this by calling the HrRemoveService function.
-
Delete the files belonging to the service using the EDKDeleteNode function.
The DoRemove function removes components from the local computer. Server components in the Microsoft Exchange Server directory must be removed in a separate step using directory access functions. For example, address types and Administrator extensions are not removed because they may be needed by other applications.