[cmake-developers] [CMake 0014467]: WiX Generator: Move the TARGETDIR directory from directories.wxs to the main template

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


The following issue has been SUBMITTED. 
====================================================================== 
http://www.cmake.org/Bug/view.php?id=14467 
====================================================================== 
Reported By:                Ådne Hovda
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   14467
Category:                   CPack
Reproducibility:            always
Severity:                   feature
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2013-10-09 05:46 EDT
Last Modified:              2013-10-09 05:46 EDT
====================================================================== 
Summary:                    WiX Generator: Move the TARGETDIR directory from
directories.wxs to the main template
Description: 
Move the main <Directory Id="TARGETDIR" Name="SourceDir" /> tag
including the program files folder entry to the main.wxs file, leaving
only INSTALL_ROOT and below in directories.wxs. That makes it possible to
override the install location using a custom template (e.g. C:\program
files\company\product). Selecting the
correct ProgramFilesFolder/ProgramFiles64Folder should be handled by a
new include variable and a new <?if ?> block.

Here are some excerpts to (hopefully) clarify my ideas:


cpack_variables.wxi:

<?define CPACK_WIX_ARCH="x86" ?>


WIX.template.in:

<?if $(var.CPACK_WIX_ARCH) = x86 ?>
  <?define Win64 = "no" ?>
  <?define SystemFolder = "SystemFolder" ?>
  <?define CAQuietExec = "CAQuietExec" ?>
  <?define ProgramFilesFolder = "ProgramFilesFolder" ?>
  <?define ExecSecureObjects = "ExecSecureObjects" ?>
<?else?>
  <?define Win64 = "yes" ?>
  <?define SystemFolder = "System64Folder" ?>
  <?define CAQuietExec = "CAQuietExec64" ?>
  <?define ProgramFilesFolder = "ProgramFiles64Folder" ?>
  <?define ExecSecureObjects = "ExecSecureObjects_64" ?>
<?endif?>


<Directory Id="TARGETDIR" Name="SourceDir">
  <Directory Id="$(var.ProgramFilesFolder)">
    <DirectoryRef Id="INSTALL_ROOT" />
  </Directory>
</Directory>


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>

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

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




More information about the cmake-developers mailing list