[cmake-developers] [CMake 0014466]: Deterministic file/directory IDs

Mantis Bug Tracker mantis at public.kitware.com
Wed Oct 9 05:42:08 EDT 2013


The following issue has been SUBMITTED. 
====================================================================== 
http://www.cmake.org/Bug/view.php?id=14466 
====================================================================== 
Reported By:                Ådne Hovda
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   14466
Category:                   CPack
Reproducibility:            always
Severity:                   feature
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2013-10-09 05:42 EDT
Last Modified:              2013-10-09 05:42 EDT
====================================================================== 
Summary:                    Deterministic file/directory IDs
Description: 
Automatically generated IDs for <File />, <Directory /> and
<Component /> tags, DIR_ID_1, FILE_ID_1, COMP_ID_1, are
non-deterministic and that makes it impossible to reference those
objects by ID from other parts of the WiX code, to execute an
installed binary, add service config and firewall exceptions, for
example.

So, instead compose the ID by concatenating the relative path from
INSTALL_ROOT and the file name, using some valid delimiter, a
combination which should always be unique within one installer.

A file and its component should simply share ID.

Example output:



directories.wxs:

<Directory Id="INSTALL_ROOT" Name="MyProduct">
  <Directory Id="bin" Name="bin"/>
  <Directory Id="include" Name="include"/>
  <Directory Id="lib" Name="lib"/>
  <Directory Id="share" Name="share">
    <Directory Id="share.man" Name="man">
      <Directory Id="share.man.man3" Name="man3"/>
    </Directory>
  </Directory>
</Directory>




files.wxs:

<DirectoryRef Id="bin">
  <Component Id="bin.prog1.exe" Guid="*" Win64="$(var.Win64)">
    <File Id="bin.prog1.exe" Source="c:/.../bin/prog1.exe" KeyPath="yes"/>
  </Component>
</DirectoryRef>
<DirectoryRef Id="include">
  <Component Id="include.lib1.h" Guid="*" Win64="$(var.Win64)">
    <File Id="include.lib1.h" Source="c:/.../include/lib1.h" KeyPath="yes"/>
  </Component>
</DirectoryRef>
<DirectoryRef Id="lib">
  <Component Id="lib.lib1.lib" Guid="*" Win64="$(var.Win64)">
    <File Id="lib.lib1.lib" Source="c:/.../lib/lib1.lib" KeyPath="yes"/>
  </Component>
</DirectoryRef>
<DirectoryRef Id="share.man.man3">
  <Component Id="share.man.man3.prog.3" Guid="*" Win64="$(var.Win64)">
    <File Id="share.man.man3.prog.3" Source="c:/.../share/man/man3/prog.3"
KeyPath="yes"/>
  </Component>
</DirectoryRef>

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2013-10-09 05:42 Ådne Hovda     New Issue                                    
======================================================================




More information about the cmake-developers mailing list