View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014467CMakeCPackpublic2013-10-09 05:462015-07-08 08:57
ReporterÅdne Hovda 
Assigned ToNils Gladitz 
PrioritynormalSeverityfeatureReproducibilityalways
StatusclosedResolutionwon't fix 
PlatformOSOS Version
Product VersionCMake 2.8.11.2 
Target VersionFixed in Version 
Summary0014467: WiX Generator: Move the TARGETDIR directory from directories.wxs to the main template
DescriptionMove 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>
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0034794)
Nils Gladitz (developer)
2013-12-18 13:04

set(CPACK_PACKAGE_INSTALL_DIRECTORY "company/product") would probably cover your example use case.

Would this suffice or do you have additional requirements?
(0035444)
Richard Ulrich (reporter)
2014-03-20 04:36

Just stumbled over this entry...
I had the same use case, and I solved it almost as you propose.
As this is for Windows, I had to use four backslashes instead of the single forward slash in your example.
(0035445)
Nils Gladitz (developer)
2014-03-20 05:11

0014467:0035444 : are you sure you had to use backslashes?
The single forward slash worked for me as-is.
(0037967)
Nils Gladitz (developer)
2015-02-13 06:19

There hasn't been any feedback on the issue since it was created so I am resolving it for now. Feel free to reopen or create a new issue if you have additional requirements that aren't already covered.
(0039051)
Robert Maynard (manager)
2015-07-08 08:57

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2013-10-09 05:46 Ådne Hovda New Issue
2013-10-12 17:12 Nils Gladitz Status new => assigned
2013-10-12 17:12 Nils Gladitz Assigned To => Nils Gladitz
2013-12-18 13:04 Nils Gladitz Note Added: 0034794
2013-12-18 13:04 Nils Gladitz Status assigned => feedback
2014-03-20 04:36 Richard Ulrich Note Added: 0035444
2014-03-20 05:11 Nils Gladitz Note Added: 0035445
2015-02-13 06:19 Nils Gladitz Note Added: 0037967
2015-02-13 06:19 Nils Gladitz Status feedback => resolved
2015-02-13 06:19 Nils Gladitz Resolution open => won't fix
2015-07-08 08:57 Robert Maynard Note Added: 0039051
2015-07-08 08:57 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team