Commits

Thomas Kluyver committed 39beb6e

iconfile parameter to specify the location of an icns icon for Mac apps.

  • Participants
  • Parent commits 8913025
  • Branches mac-iconfile

Comments (0)

Files changed (1)

cx_Freeze/macdist.py

 <plist version="1.0">
 <dict>
 	<key>CFBundleIconFile</key>
-	<string>%(bundle_iconfile)s</string>
+	<string>icon.icns</string>
 	<key>CFBundleDevelopmentRegion</key>
 	<string>English</string>
 	<key>CFBundleExecutable</key>
     description = "create a Mac application bundle"
 
     user_options = [
-        ('bundle-iconfile=', None, 'Name of the application bundle icon ' \
-                'file as stored in the Info.plist file'),
+        ('iconfile=', None, 'Path to an icns icon file for the application.'),
         ('qt-menu-nib=', None, 'Location of qt_menu.nib folder for Qt ' \
                 'applications. Will be auto-detected by default.')
     ]
 
     def initialize_options(self):
-        self.bundle_iconfile = 'icon.icns'
+        self.iconfile = None
         self.qt_menu_nib = False
 
     def finalize_options(self):
         self.mkpath(self.binDir)
 
         self.copy_tree(build.build_exe, self.binDir)
+        
+        # Copy the icon
+        if self.iconfile:
+            self.copy_file(self.iconfile, os.path.join(self.resourcesDir, 'icon.icns')
 
         # Create the Info.plist file
         self.execute(self.create_plist,())