Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using the firewall extension in WiX

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?

like image 485
Alexander Kjäll Avatar asked Jun 13 '12 12:06

Alexander Kjäll


2 Answers

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
like image 72
Alexander Kjäll Avatar answered Sep 28 '22 02:09

Alexander Kjäll


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

like image 22
aa aa Avatar answered Sep 28 '22 02:09

aa aa