WSJT-X/Darwin/developer read me.txt
Bill Somerville 2da92d8ead Include Mac install instructions in package root
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@4388 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
2014-09-27 15:48:22 +00:00

63 lines
3.3 KiB
Plaintext

Changing the content of the DragNDrop DMG root folder.
======================================================
The files and links in this folder are populated by the WSJT-X CMake build script. There are install commands which are only run on Apple hosts, this is important becuase they will get installed at the install root on other platforms, which would be very bad on Linux for example since that is /usr normally!
The symlink to /Applications, the background image (derived from "~/src/wsjtx/artwork/DragNDrop Background.svg") and, the custom .DS_Store file ("~/src/wsjtx_DMG.DS_Store") are all handled specifically by the CPack DragNDrop packager so you don't need to install those.
Modifying the .DS_Store folder options for the DragNDrop DMG root folder.
=========================================================================
The DragNDrop installer is a generated a DMG file that has a custom .DS_Store file that defines the layout, background image and, folder view options of the DMG root folder.
To modify this file, first you need to make a DragNDrop package then mount the DMG file, then modify the root .DS_Store file using Finder. Once you are happy with the results, you check into source control the modified .DS_Store file and then future package builds will use that file.
The installer DMG is read only and shrunk to exactly the size of the contents, also the .DS_Store file is read only and the background image PNG file is hidden. You need to undo all of these things before changing the .DS_Store file. Don't forget to redo these things before checking in a new version of the custom .DS_Store file.
# convert the DMG to a R/W copy
hdiutil convert wsjtx-1.4.0-rc1-Darwin.dmg -format UDRW -o rw.dmg
# expand the R/W copy to make room for changes
# first find the current number of sectors
hdiutil resize -limits rw.dmg
# the output looks like:
#
# min cur max
#109696 109696 33037872
#
# you need to increase the sector count to something a bit bigger than current
# e.g. in this case use 110000
hdiutil resize -sectors 110000 rw.dmg
# now you can mount the R/W DMG
hdiutil attach rw.dmg
# change the hidden attribute on the background PNG
chflags nohidden /Volumes/wsjtx-1.4.0-rc1-Darwin/background.png
# make the .DS_Store file writeable
chmod 644 /Volumes/wsjtx-1.4.0-rc1-Darwin/.DS_Store
# now you can change Finder view options, rearrange icons etc. Remember that you are only changing the folder options, not the folder content as that is controlled by the install steps in the project CMakeLists.txt
# if you are adding or removing a file to the DMG root folder, you need to have changed the install steps before doing this procedure so the content changes are reflected in the installer DMG you start with
# when you are happy with the layout etc.
# set the background PNG as a hidden file
chflags hidden /Volumes/wsjtx-1.4.0-rc1-Darwin/background.png
# make the .DS_Store file read only
chmod 444 /Volumes/wsjtx-1.4.0-rc1-Darwin/.DS_Store
# update the custom .DS_Store file in the source repository (NOTE the file name)
cp /Volumes/wsjtx-1.4.0-rc1-Darwin/.DS_Store ~/src/wsjtx/wsjtx_DMG.DS_Store
# build a new package and try out the new installer to test your changes
# if all is well commit the changes
# dismount and eject the R/W DMG and discard it
hdiutil detach /Volumes/wsjtx-1.4.0-rc1-Darwin
rm rw.dmg
# That's all Folks!