views:

202

answers:

4

I am currently still fiddling with our msbuild & deployment script and one of the steps is to register a (legacy) com component on the machine the code is deployed to. Is there any 'elegant' way to accomplish this or would I have to call the regsvr32.exe via wmi on the remote machine?

A: 

You could use PowerShell v2 remoting via an MSBuild PowerShell task

Ruben Bartelink
A: 

You can use PsExec (from formerly SysInternals - but now part of Microsoft) to execute shell commands on remote machines.

Just use a standard MSBuild Exec task that wraps PsExec.

Wim Hollebrandse
A: 

As part of your build you could create an MSI that installs your COM component (e.g. using WiX -- Votive has msbuild support).

Then you'd run the installation on the remote machine by invoking the Win32_Product.Install method.

Daryn
A: 

You could manually perform the COM component registration by using the StdRegProv WMI class to write to the registry on the remote machine (i.e. create the HKLM\CLSID{guid} entries, etc)

Daryn