Installing Capicom Without SelfReg: No Wix Custom Actions Found (Err 2721)

After successfully discussing this, I've added a few extra lines of code for another custom activity. This method is for calling regsvr32 on a copy of capicom that I tried to put in the user's system folder. However, I am getting error 2721, which seems to be the usual action not found error from what I have seen. Any suggestions? I am trying to maintain consistency with previous iterations of my installer by calling regsvr, rather than just adding registry entries during install, which might be a good idea. :: shrug

<Directory Id="SystemFolder" Name="Sys">
  ...
  <component ...>
     ...
    <File Id="CapiCom.Dll" LongName="CapiCom.Dll" Name="CAPICOM.DLL" Source=... />
  </component>
</directory>
...
<CustomAction Id="REGCAPICOM" ExeCommand='regsvr32.exe "[SystemFolder]capicom.dll"' Return = "ignore" Execute="deferred" />
...
<InstallExecuteSequence>
  ...
  <Custom Action="REGCAPICOM" After="InstallFiles" />
</InstallExecuteSequence>

      

Edit: Yes, using regsvr32 as the installer is ugly. But when I downloaded the Capicom SDK, this is what MS told to do to get it installed. Searching around found a lot of people saying this is a stupid way to do it ... but it is also a MS mechanism. I will listen to suggestions for a better way. I don't consider it a big deal if Capicom is left behind when my application is uninstalled, given that it is a standard Windows component.

Edit: Hmmm. Apparently one of the things selfreg does on the dll is to generate a random seed to add to the registry. Not sure what mechanism it uses to generate this seed, but I suspect it would reckon with bad taste to just create it myself, especially if I gave all users the same seed. Not sure ... Apparently if I miss this Capicom it will do it on its own, so I'm fine.

+1


source to share


3 answers


The right way:

  • c: \ Program Files \ Microsoft Visual Studio .NET 2003 \ Common7 \ Tools \ Deployment \ regcap.exe "/ O capicom.reg capicom.dll

  • Run the program from Adam Tengen here.

Please note that Heat (and Tallow, IIRC) does not work with this Capicom post.



Wrong Way:

<CustomAction Id="RegisterCapicom" Directory="SystemFolder" ExeCommand="regsvr32.exe /s &quot;[SystemFolder]Capicom.dll&quot;" Return="check" Execute="deferred" />
...
<InstallExecuteSequence>
  <Custom Action="RegisterCapicom" After="InstallFiles" />
</InstallExecuteSequence>

      

+3


source


Uhh, are you really trying to install the windows system file yourself? This is not allowed at many different levels. Also, regsvr32.exe is SelfReg and SelfReg is known to be evil in installations. In fact, using Windows Installer to record registration is much more complicated



However, the whole construction is very suspicious here.

+1


source


You can use the heat in the file to create a WXS output file that will put information about capicom.dll in the registry without using regsvr32 when running msi

Something like that:

heat file [Path\Capicom.dll] -template:product -out capicom.wxs

      

Then add capicom.wxs to your installer, in this file create a ComponentGroup element containing the elements of the component (s):

<ComponentGroup Id="capicom">
  <ComponentRef Id="capicom.dll"/>
</ComponentGroup>

      

After in the main WXS file add a Fragment element that will bind the capicom component

The final step is to add a ComponentGroupRef component to the property it belongs to:

<Feature Id="PRODUCTFEATURE">
  <ComponentGroupRef Id="capicom" />
  ... [Other components or ComponentGroups references]
</Feature>

      

0


source







All Articles