Browse Source

CPack/DragNDrop: Place the background image file in a hidden folder

By using a hidden folder we avoid the need to mark the file as hidden
from finder, and it makes it easier for future work to refer to the
background image file.
Robert Maynard 11 years ago
parent
commit
9c1dfbfd60
1 changed files with 2 additions and 16 deletions
  1. 2 16
      Source/CPack/cmCPackDragNDropGenerator.cxx

+ 2 - 16
Source/CPack/cmCPackDragNDropGenerator.cxx

@@ -400,6 +400,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
 
   // Optionally add a custom background image ...
   // Make sure the background file type is the same as the custom image
+  // and that the file is hidden so it doesn't show up.
   if(!cpack_dmg_background_image.empty())
     {
     const std::string extension =
@@ -409,7 +410,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
 
     std::ostringstream package_background_destination;
     package_background_destination << staging.str()
-                                   << "/background" << extension;
+                                   << "/.background/background" << extension;
 
     if(!this->CopyFile(package_background_source,
         package_background_destination))
@@ -421,21 +422,6 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
 
       return 0;
       }
-
-    std::ostringstream temp_background_hiding_command;
-    temp_background_hiding_command << this->GetOption("CPACK_COMMAND_SETFILE");
-    temp_background_hiding_command << " -a V \"";
-    temp_background_hiding_command << package_background_destination.str();
-    temp_background_hiding_command << "\"";
-
-    if(!this->RunCommand(temp_background_hiding_command))
-      {
-        cmCPackLogger(cmCPackLog::LOG_ERROR,
-          "Error setting attributes on disk volume background image."
-          << std::endl);
-
-      return 0;
-      }
     }
 
   // Create a temporary read-write disk image ...