Basically to register/unregister a DLL COM you can use the regsvr32 tool as described in the "Regsvr32" article. For EXE COMs you should be able to register/unregister them by calling them with /regserver and /unregserver commands.
So, considering your case (we have 2 EXE COMs and 3 OCX/DLL COMs) you can create 4 BAT file as it follows:
1. registerEXE.bat
Code: Select all
%1 /regserver
%2 /regserver
Code: Select all
%1 /unregserver
%2 /unregserver
Code: Select all
regsvr32 /s %1
regsvr32 /s %2
regsvr32 /s %3
Code: Select all
regsvr32 /s /u %1
regsvr32 /s /u %2
regsvr32 /s /u %3
1.add your EXE and DLL files in "Files and Folders" page
2. add the above BAT files as temporary files in "Files and Folders" page
3. go to "Custom Actions" page and add a "Launch file" custom action, scheduled on install as deferred after Install Execution Stage -> Add Resources" action group, which will launch the " registerEXE.bat" like this:
- File To Launch: [®isterexe.bat]
Command Line: "[#COM1.exe]" "[#COM2.exe]" <the COM filepaths are passed as parameters, i.e. %1, %2, to the BAT file>
Hide program's window: checked
- File To Launch: [®isterdll.bat]
Command Line: "[#COM1.ocx]" "[#COM2.ocx]" "[#COM3.ocx]"
Hide program's window: checked
6. using custom actions as above you should add another 2 "Launch file" custom actions which will launch the "unregisterDLL.bat" file: 1 custom action scheduled on install as rollback just before the "[®isterdll.bat]" action and, the other scheduled on uninstall as deferred before "Install Execution Stage -> Remove Resources" action group
7. build and test the installation
All the best,
Daniel