Search code examples
comexeregsvr32

COM Server registration - Hide popup window


We use a com exposed server executable. In order for the exe to work properly we need to use this command.

This can be executed in command prompt or run.exe etc... [pathtofile]\filename.exe /regserver or [pathtofile]\filename.exe /unregserver

After this you get a messagebox. 'Component successfully registered'

The issue is that this blocks our InstallShield and it requires a manuel ok click for the installer to proceed. This behaviour we don't want for silent installs.

Does anyone know an idea how to supress this popups? I know this can be done for the com registration of dll's by regsvr32. However for com exe's I could not find anything that suppresses it. Registering it with RegSvr32 is not an option here as this will not work for our exe.

Thanks for the help!

Kind regards

Céderic


Solution

  • I found out that the exe I use is regged by the exe itself... . Therefore it is unpossible to silence it etc. It is sometimes possible but it has to be build in by the compiler that creates the exe.

    I made this vbscript do add to my IS project as a custom action and works fine.

    Set oShell = CreateObject("WScript.Shell")
    oShell.CurrentDirectory = "[YOURAPPINSTALLDIR]"
    
    'You can check here if the exe exits or not to execute to code below  - not implemented in this example
    oShell.Run "[YOURAPP].exe /regserver", 0, False
    
    
    Set oShell = CreateObject("WScript.Shell")
    
    While oShell.AppActivate("[YOUR WINDOW TITLE]") = False
      'WScript.Sleep 100 (does not work in IS)
    Wend
    oShell.SendKeys "{ENTER}"