Windows – Using the firewall extension in WiX

windowswixwix-extension

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?

Best Answer

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
Related Topic