[Cmake-commits] CMake branch, next, updated. v3.6.1-1137-g25bd0c3

Nils Gladitz nilsgladitz at gmail.com
Mon Aug 8 08:46:37 EDT 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  25bd0c3824b55ba10c23bc837ca28879487686bc (commit)
       via  17bbf6af1ecca15194a693d31fdd8163aacfd994 (commit)
       via  5a62e0c1721281503c8b4cd9d4d3d0de8abebf0f (commit)
      from  8c38d8ed5f41f8b57e94b1e9dff923462f992d87 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=25bd0c3824b55ba10c23bc837ca28879487686bc
commit 25bd0c3824b55ba10c23bc837ca28879487686bc
Merge: 8c38d8e 17bbf6a
Author:     Nils Gladitz <nilsgladitz at gmail.com>
AuthorDate: Mon Aug 8 08:46:35 2016 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Aug 8 08:46:35 2016 -0400

    Merge topic 'wix-custom-install-dir' into next
    
    17bbf6af CPackWIX: Implement new CPACK_WIX_SKIP_PROGRAM_FOLDER feature
    5a62e0c1 CMake Nightly Date Stamp


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=17bbf6af1ecca15194a693d31fdd8163aacfd994
commit 17bbf6af1ecca15194a693d31fdd8163aacfd994
Author:     Michael Stürmer <michael.stuermer at schaeffler.com>
AuthorDate: Wed Jul 20 15:32:38 2016 +0200
Commit:     Nils Gladitz <nilsgladitz at gmail.com>
CommitDate: Mon Aug 8 13:42:23 2016 +0200

    CPackWIX: Implement new CPACK_WIX_SKIP_PROGRAM_FOLDER feature
    
    The new variable allows setting of a custom absolute installation prefix
    outside of the ProgramFiles folders.

diff --git a/Help/release/dev/wix-custom-install-dir.rst b/Help/release/dev/wix-custom-install-dir.rst
new file mode 100644
index 0000000..cd12a88
--- /dev/null
+++ b/Help/release/dev/wix-custom-install-dir.rst
@@ -0,0 +1,7 @@
+wix-custom-install-dir
+----------------------
+
+* The CPack WIX generator now supports
+  :variable:`CPACK_WIX_SKIP_PROGRAM_FOLDER` to allow specification
+  of a custom absolute installation prefix outside
+  of the ProgramFiles folders.
diff --git a/Modules/CPackWIX.cmake b/Modules/CPackWIX.cmake
index 10926c0..08ff0cb 100644
--- a/Modules/CPackWIX.cmake
+++ b/Modules/CPackWIX.cmake
@@ -248,6 +248,23 @@
 # Sets the description of the root install feature in the WIX installer. Same as
 # CPACK_COMPONENT_<compName>_DESCRIPTION for components.
 #
+# .. variable:: CPACK_WIX_SKIP_PROGRAM_FOLDER
+#
+# If this variable is set to true, the default install location
+# of the generated package will be CPACK_PACKAGE_INSTALL_DIRECTORY directly.
+# The install location will not be located relatively below
+# ProgramFiles or ProgramFiles64.
+#
+#   .. note::
+#     Installers created with this feature do not take differences
+#     between the system on which the installer is created
+#     and the system on which the installer might be used into account.
+#
+#     It is therefor possible that the installer e.g. might try to install
+#     onto a drive that is unavailable or unintended or a path that does not
+#     follow the localization or convention of the system on which the
+#     installation is performed.
+#
 
 #=============================================================================
 # Copyright 2014-2015 Kitware, Inc.
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
index 3ecc14d..d7f69a1 100644
--- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx
+++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
@@ -18,6 +18,7 @@
 #include <cmGeneratedFileStream.h>
 #include <cmInstalledFile.h>
 #include <cmSystemTools.h>
+#include <cmUuid.h>
 
 #include "cmWIXDirectoriesSourceWriter.h"
 #include "cmWIXFeaturesSourceWriter.h"
@@ -441,6 +442,11 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles()
   cmWIXFilesSourceWriter fileDefinitions(this->Logger,
                                          fileDefinitionsFilename);
 
+  // if install folder is supposed to be set absolutely, the default
+  // component guid "*" cannot be used
+  fileDefinitions.GenerateComponentGuids =
+    cmSystemTools::IsOn(GetOption("CPACK_WIX_SKIP_PROGRAM_FOLDER"));
+
   fileDefinitions.BeginElement("Fragment");
 
   std::string featureDefinitionsFilename =
@@ -566,6 +572,9 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles()
 
 std::string cmCPackWIXGenerator::GetProgramFilesFolderId() const
 {
+  if (cmSystemTools::IsOn(GetOption("CPACK_WIX_SKIP_PROGRAM_FOLDER"))) {
+    return "";
+  }
   if (GetArchitecture() == "x86") {
     return "ProgramFilesFolder";
   } else {
diff --git a/Source/CPack/WiX/cmWIXDirectoriesSourceWriter.cxx b/Source/CPack/WiX/cmWIXDirectoriesSourceWriter.cxx
index de64059..97e3a51 100644
--- a/Source/CPack/WiX/cmWIXDirectoriesSourceWriter.cxx
+++ b/Source/CPack/WiX/cmWIXDirectoriesSourceWriter.cxx
@@ -52,8 +52,12 @@ size_t cmWIXDirectoriesSourceWriter::BeginInstallationPrefixDirectory(
   std::string const& programFilesFolderId,
   std::string const& installRootString)
 {
-  BeginElement("Directory");
-  AddAttribute("Id", programFilesFolderId);
+  size_t offset = 1;
+  if (!programFilesFolderId.empty()) {
+    BeginElement("Directory");
+    AddAttribute("Id", programFilesFolderId);
+    offset = 0;
+  }
 
   std::vector<std::string> installRoot;
 
@@ -77,7 +81,7 @@ size_t cmWIXDirectoriesSourceWriter::BeginInstallationPrefixDirectory(
     AddAttribute("Name", installRoot[i]);
   }
 
-  return installRoot.size();
+  return installRoot.size() - offset;
 }
 
 void cmWIXDirectoriesSourceWriter::EndInstallationPrefixDirectory(size_t size)
diff --git a/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx b/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx
index 9a143cc..dde9635 100644
--- a/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx
+++ b/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx
@@ -16,6 +16,9 @@
 
 #include <cmInstalledFile.h>
 
+#include <cmSystemTools.h>
+#include <cmUuid.h>
+
 #include <sys/types.h>
 // include sys/stat.h after sys/types.h
 #include <sys/stat.h>
@@ -23,6 +26,7 @@
 cmWIXFilesSourceWriter::cmWIXFilesSourceWriter(cmCPackLog* logger,
                                                std::string const& filename)
   : cmWIXSourceWriter(logger, filename)
+  , GenerateComponentGuids(false)
 {
 }
 
@@ -126,12 +130,20 @@ std::string cmWIXFilesSourceWriter::EmitComponentFile(
   std::string componentId = std::string("CM_C") + id;
   std::string fileId = std::string("CM_F") + id;
 
+  std::string guid = "*";
+  if (this->GenerateComponentGuids) {
+    std::string md5 = cmSystemTools::ComputeStringMD5(componentId);
+    cmUuid uuid;
+    std::vector<unsigned char> ns;
+    guid = uuid.FromMd5(ns, md5);
+  }
+
   BeginElement("DirectoryRef");
   AddAttribute("Id", directoryId);
 
   BeginElement("Component");
   AddAttribute("Id", componentId);
-  AddAttribute("Guid", "*");
+  AddAttribute("Guid", guid);
 
   if (installedFile) {
     if (installedFile->GetPropertyAsBool("CPACK_NEVER_OVERWRITE")) {
diff --git a/Source/CPack/WiX/cmWIXFilesSourceWriter.h b/Source/CPack/WiX/cmWIXFilesSourceWriter.h
index c577e5b..eeb84cb 100644
--- a/Source/CPack/WiX/cmWIXFilesSourceWriter.h
+++ b/Source/CPack/WiX/cmWIXFilesSourceWriter.h
@@ -47,6 +47,8 @@ public:
                                 std::string const& id,
                                 std::string const& filePath, cmWIXPatch& patch,
                                 cmInstalledFile const* installedFile);
+
+  bool GenerateComponentGuids;
 };
 
 #endif

-----------------------------------------------------------------------

Summary of changes:
 Help/release/dev/wix-custom-install-dir.rst       |    7 +++++++
 Modules/CPackWIX.cmake                            |   17 +++++++++++++++++
 Source/CMakeVersion.cmake                         |    2 +-
 Source/CPack/WiX/cmCPackWIXGenerator.cxx          |    9 +++++++++
 Source/CPack/WiX/cmWIXDirectoriesSourceWriter.cxx |   10 +++++++---
 Source/CPack/WiX/cmWIXFilesSourceWriter.cxx       |   14 +++++++++++++-
 Source/CPack/WiX/cmWIXFilesSourceWriter.h         |    2 ++
 7 files changed, 56 insertions(+), 5 deletions(-)
 create mode 100644 Help/release/dev/wix-custom-install-dir.rst


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list