Build Your Own GUI for RegSvr32

Incremental software upgrades can be a nightmare if they're not managed in an orderly and logical fashion. Learn how to simplify the registration of multiple DLLs from any location.

by Michael Sanchez

Jan 26, 2005

Page 1 of 3

am currently developing for a company that recently purchased a new content management system. Due to the number of requested custom enhancements, the vendor phased the implementation. They delivered the upgrades as versioned DLLs to replace their predecessors at each phase.

This process, to no one's surprise, was very prone to error. The constant unregister, copy, and registration of new, versioned DLLs became incredibly tedious. After the second phase of enhancements I figured it would be worth my time to build a simple GUI to automate the process for future upgrades for any user.

I started this task by planning out my GUI and necessary controls. I needed three command buttons to select the components, remove selected components, or clear the list box. I would need a list box to display the selected components, two option buttons to dictate whether to register or unregister the components, and a command button to execute the procedure.

I wanted to be able to easily choose components from anywhere on our server, so I added a common dialog control. I duly named each of the controls and was ready to begin creating my sub-procedures and functions.

Even when I'm not writing DLLs or classes, I make it a point to maintain a componentized structure. Aside from the procedures for the form controls, I created separate sub-procedures or functions to handle instantiating the Windows Script Host Shell object (WSH Shell), destroying the shell object, and registering/unregistering the components.