Using the firewall extension in WiX

大城市里の小女人 提交于 2019-12-30 17:56:58

问题


I'm trying to write a WiX script that uses the firewall extension to WiX, and it doesn't seem to find the extension dll (I think).

The error I'm seeing is this:

The File element contains an unhandled extension element 'fire:FirewallException'.
Please ensure that the extension for elements in the 'http://schemas.microsoft.com /wix/FirewallExtension' namespace has been provided.

and the relevant part of my WiX source is this:

<?xml version="1.0" encoding="windows-1252"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     xmlns:fire="http://schemas.microsoft.com/wix/FirewallExtension">
 <Component Id="Firewall" Guid="7278f07d-de6f-497f-9267-d5feb5216a5c" Directory="NotUsed">
  <File KeyPath="yes" Source="C:\Program Files\Java\jdk1.6.0_32\bin\java.exe">
   <fire:FirewallException Id="FWX1" Name="My Program" Port="80" Protocol="tcp"/>

If i try to register the WixFirewallExtension.dll file with regsrv32 i get this error:

The module C:\Program Files (x86)\Windows Installer XML v3.5\bin\WixFirewallExtension.dll was loaded but the entry-point DllRegisterServer was not found.

Make sure that C:\Program Files (x86)\Windows Installer XML v3.5\bin\WixFirewallExtension.dll is a valid DLL or OCX file and then try again

The dll file is in my path, but that might not matter? Do i need to do anything else to get WiX to start using it?


回答1:


Found the answer after some more digging:

I needed to specify the extension on the commandline of light.exe, like this:

light myfile.wxs -ext WixFirewallExtension -out myfile.wixobj



回答2:


You must add the reference of "WixFirewallExtension.dll" inside your WIX Project to resolve the issue.




回答3:


Adding "WixFirewallExtension.dll" inside your WIX Project will resolve the issue. To do it follow the below steps:-

  • Open the project in visual studio.
  • Right click on wix project
  • Add reference to the above dll...


来源:https://stackoverflow.com/questions/11015063/using-the-firewall-extension-in-wix

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!