2

I am new to Wix installation toolkit and have been trying to create an installer. I am using it as a plugin to VS 2017. This is so far as I have got.

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util=" http://schemas.microsoft.com/wix/UtilExtension">

<Directory Id="CommonAppDataFolder">
        <Directory Id="ProgramDataVendorFolder" Name="ABC">
          <!--This will create the \ProgramData\MyVendor\MyProductName\ folder. -->
          <Directory Id="ProgramDataAppFolder" Name="DEF" />
        </Directory>
      </Directory>
        </Directory>
    <DirectoryRef Id="ProgramDataAppFolder">
      <Component Id="CmpCreateCommonAppDataFolderWithPermissions" Guid="*" Permanent="yes">
        <CreateFolder>
          <!--This will ensure that everyone gets full permissions to the folder that we create in the ProgramData folder.--> 
          <util:PermissionEx User="Everyone" GenericAll="yes" />
        </CreateFolder>
      </Component>
    </DirectoryRef>

Added a reference to "WixUtilExtension.dll" in the project.

But I get the error

Error : The CreateFolder element contains an unhandled extension element 'util:PermissionEx'. Please ensure that the extension for elements in the ' http://schemas.microsoft.com/wix/UtilExtension' namespace has been provided.

In addition I have also tried using the http://wixtoolset.org/schemas/v4/wxs/util instead of http://schemas.microsoft.com/wix/UtilExtension

I tried to comment out the code above and then get the error

The extension 'Microsoft.Tools.WindowsInstallerXml.Extensions.UtilExtension' contains a defintion for table 'EventManifest' that collides with a previously loaded table definition. Please remove one of the conflicting extensions or rename one of the tables to avoid the collision.

Could someone please help me out here.

Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164
saras
  • 145
  • 1
  • 10

2 Answers2

3

Missing Reference: You must have forgotten to add a reference to the WixUtilExtension.dll file in the WiX installation folder. Please follow the procedure below to add the reference.

In Visual Studio:

  1. Open your WiX project.
  2. Right click "References" in the right pane => Add References...
  3. Browse to the file, or paste the following (if using standard installation paths)C:\Program Files (x86)\WiX Toolset v3.11\bin\WixUtilExtension.dll.
  4. Click "Add" and then "OK".

WiX Sample Code: Some WiX sample code described here.


The most common namespaces to add to the WiX element:

 xmlns:bal="http://schemas.microsoft.com/wix/BalExtension" (Burn)
 xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension" (.NET)
 xmlns:iis="http://schemas.microsoft.com/wix/IIsExtension" (IIS)
 xmlns:util="http://schemas.microsoft.com/wix/UtilExtension" (Util)
 xmlns:wixloc="http://schemas.microsoft.com/wix/2006/localization" (Localization)

IsWiX is nice for namespaces and more (screenshot below). It is a free WiX tool from Chris Painter:

IsWiX Namespaces

Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164
  • As I mentioned earlier that I had WixUtilExtension.dll as reference.But still removing that file, closing the solution, reopening the solution and adding it again fixed the issue. I am not sure why. But the common namespaces was a good tip for me. Thanks a lot for the answer. – saras May 08 '19 at 11:23
  • Great, please set as accepted answer if it solved your problem. These things with references happen. I have seen it myself - those "intermittent problems". Often it can be a reference to a similar but different dll - for example to `WixUIExtension.dll` instead of `WixUtilExtension.dll` or you reference the WiX4 dlls from WiX3 or vice versa? – Stein Åsmul May 08 '19 at 11:30
0

You have a leading space in the xmlns:util namespace. Remove this and things should work OK.