With Wix, distribute a program that uses SQLite (must work on both 32bit and 64bit)
Asked Answered
I

2

12

With WiX, I want to distribute a C# program that uses SQLite.

SQLite recommends the files structure below, so I use it:

enter image description here

In Wix, I create the x86 and x64 folders and put the right DLL in each:

 <Directory Id='x86' Name='x86'>
   <Component Id='x86' Guid='...'>
     <CreateFolder />
     <File Id='f86' Name='SQLite.Interop.dll' Source='x86\SQLite.Interop.dll' />
   </Component>
 </Directory>
 <Directory Id='x64' Name='x64'>
   <Component Id='x64' Guid='...'>
     <CreateFolder />
     <File Id='f64' Name='SQLite.Interop.dll' Source='x64\SQLite.Interop.dll' />
   </Component>
 </Directory>

PROBLEM: WiX says error LGHT0204 : ICE99: The directory name: x64 is the same as one of the MSI Public Properties and can cause unforeseen side effects.


Tip: If I remove the two directories from the WiX script, and then copy them manually to the place where the program is installed, then it works. It sounds dumb, but maybe the solution is to create x86_ and x64_ directories in the WiX script, and rename them at first execution of the program?

Inaudible answered 31/5, 2013 at 6:39 Comment(0)
F
24

There is no issue with SQLite. You are using x64 as the Directory ID. This is the issue here. ICE99 throws error if you use any Windows reserved property as Directory ID like WindowsVolume.

You have to Change the x64 directory ID. It will fix this issue.

  <Directory Id='DIR_x64' Name='x64'>
Fallonfallout answered 31/5, 2013 at 8:52 Comment(1)
Do you have an Idea if the file is harvested/generated by heat.exe?Darcidarcia
H
0

It turns out heat.exe also causes this problem, so fixing it can be automated by passing the -t transform.xslt command-line option to heat.exe and placing a file named transform.xslt in the same directory as your WiX project. Contents should be as follows:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:wix="http://schemas.microsoft.com/wix/2006/wi">
  <!-- Copy everything unless stated otherwise -->
  <xsl:template match="@*|node()">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
  </xsl:template>
  <!-- Replace <Directory Id='x64'> with <Directory Id='DIR_x64'> to keep the compiler happy -->
  <xsl:template match="//wix:Directory[@Id='x64']">
    <xsl:copy>
      <!-- Copy all attributes from the Directory element -->
      <xsl:apply-templates select="@*"/>
      <!-- Replace the Id attribute with "DIR_x64" -->
      <xsl:attribute name="Id">
        <xsl:text>DIR_x64</xsl:text>
      </xsl:attribute>
      <!-- Copy all the descendant nodes of the Directory element -->
      <xsl:apply-templates select="node()"/>
    </xsl:copy>
  </xsl:template>
</xsl:stylesheet>
Harryharsh answered 10/7 at 11:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.