Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Register ActiveX exe server using WiX

I have several VB6 ActiveX server exe files which need to be registered on install before they can be used.

I have tried using Heat to extract the information but it only generates a file element.

These files can be registered by calling them with the /regserver switch and unregister by calling them with the /unregserver switch. I understand this is not the correct way to this. Instead I should add the registry keys and other required elements to my wix source.

My question is how do I find out what registry keys and other element I require to register these ActiveX exe files. Seeing as Heat seems unable to harvest this information.

like image 845
trampster Avatar asked Jan 23 '23 01:01

trampster


2 Answers

how do I find out what registry keys and other element I require to register these ActiveX exe files

In general, you can discover registry changes like this:

  1. Bring the registry in a clean state, e.g. use myapp.exe /unregserver

  2. Create a dump of the registry content like this

    c:\WINDOWS\system32\reg.exe export dump1.reg
    
  3. Run the command that will change the registry, e.g. myapp.exe /regserver

  4. Create another dump2.reg of the registry.

  5. Find the differences between dump1.reg and dump2.reg with a diffing tool (e.g. TortoiseSVN adds a "diff" command to the explorer context menu when you have two files selected)

There might be some noise in the differences that you should ignore. A typical example is HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\RNG\Seed. This registry key is used by the windows CryptoAPI to store continuously gathered entropy. Incidentally, this key sometimes shows up in MSI packages generated by commercial setup generators. This seems to indicate that they use a similar registry-sniffing technique :-)

like image 124
Wim Coenen Avatar answered Jan 26 '23 10:01

Wim Coenen


I had the same problem with tallow from WiX 2.0 and had to implement registry harvesting for out-of-proc servers. Here is the patched tallow. Would be nice to merge the ProcessWithInjectedDll class to Heat and probably converge to the main trunk at some point.

Beware that lots of cruft from VB6 runtime gets in the generated registry keys. The generated output is unusable without some tweaking. That's when CleanupRegInclude.vbs can be useful.

Last but not least, absolute filenames and paths are useless. You have to use #YourComponent and $YourComponent instead (check the MSI documentation).

like image 38
wqw Avatar answered Jan 26 '23 11:01

wqw