Navigation:  Actions > Server >

COM Register Action

Previous pageReturn to chapter overviewNext page

This action creates a step to register or unregister a COM EXE, DLL, .NET assembly, OCX, type library, or Visual Build user-defined action.

 

Filename: The filename of the component, assembly, control, executable, type library, or custom action to register or unregister (note: when unregistering a custom user action, this can be the action name or filename).

 

Unregister the component or type library: Determines whether the file or component is registered or unregistered.

 

.NET Assembly: Check this option to register a .NET assembly using RegAsm (otherwise, RegSvr32 will be used to register DLLs).

 

Create Codebase entry: Creates a Codebase entry in the registry (for .NET assemblies only). The Codebase entry specifies the file path for an assembly that is not installed in the global assembly cache. You should not check this option if you will subsequently install the assembly that you are registering into the global assembly cache. The assembly must be a strong-named assembly.

 

REG file: Generates the specified .reg file for the assembly, which contains the needed registry entries (optional, for .NET assemblies only). Specifying this option does not register the assembly.

 

TLB file: Generates a type library from the specified assembly containing definitions of the accessible types defined within the assembly.

 

Log the compiler command-line: Shows the command-line or steps used to register or unregister the component. This can be useful for debugging purposes.

 

The following logic is performed based on the filename extension:

For files with an .exe extension, the EXE is called with flags of /regserver or /unregserver.
For .tlb files, the action loads and registers or unregisters the type library.
For .action components or files with no extension, the user-defined action is registered (by reading the .action file contents and adding to the registry) or unregistered (by removing that action's key from the registry).  After registering or unregistering a user action, choose View | Refresh on the menu bar to refresh the Actions pane and Step panes with any changes.
For all other files, the action registers or unregisters the file using regsvr32.exe or regasm.exe (.NET assemblies).

 

Notes:

When registering/unregistering a .NET assembly, this action uses regasm.exe and expects the DOTNET_DIR macro to be defined, pointing to the base directory of the .NET Framework installation path where regasm.exe resides.  A global DOTNET_DIR macro for the latest version of the .NET Framework is initialized during installation and can be updated by clicking the Reload button on the File Locations tab of the Application Options dialog.  Or a project or temporary DOTNET_DIR macro can be created to specify the path to use.
When registering/unregistering a COM DLL or OCX, this action expects regsvr32.exe to be available in the PATH environment variable.
See the VStudio.bld sample for a project utilizing this action.