-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from kambala-decapitator/macos-dmg
[macOS] produce dmg with CPack
- Loading branch information
Showing
9 changed files
with
115 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
on run argv | ||
set image_name to item 1 of argv | ||
|
||
tell application "Finder" | ||
tell disk image_name | ||
set dmg_topleft_x to 100 | ||
set dmg_topleft_y to 100 | ||
set dmg_width to 480 | ||
set dmg_height to 320 | ||
set dmg_bottomright_x to (dmg_topleft_x + dmg_width) | ||
set dmg_bottomright_y to (dmg_topleft_y + dmg_height) | ||
|
||
set le_icon_x to 130 | ||
set app_icon_x to 360 | ||
set both_icon_y to 180 | ||
|
||
open | ||
set viewOptions to the icon view options of container window | ||
set arrangement of viewOptions to not arranged | ||
set icon size of viewOptions to 72 | ||
set background picture of viewOptions to file ".background:background.png" | ||
close | ||
|
||
open | ||
update without registering applications | ||
tell container window | ||
set current view to icon view | ||
set sidebar width to 0 | ||
set pathbar visible to false | ||
set statusbar visible to false | ||
set toolbar visible to false | ||
set the bounds to { dmg_topleft_x, dmg_topleft_y, dmg_bottomright_x, dmg_bottomright_y } | ||
set position of item "@[email protected]" to { le_icon_x, both_icon_y } | ||
set position of item "Applications" to { app_icon_x, both_icon_y } | ||
|
||
-- set volume icon | ||
-- another possible solution (if SetFile disappears at some point): NSWorkspace.shared.setIcon from AppKit | ||
do shell script "cd '/Volumes/" & image_name & "' \\ | ||
&& ln -s '@[email protected]/Contents/Resources/icon.icns' .VolumeIcon.icns \\ | ||
&& SetFile -a C . | ||
" | ||
end tell | ||
delay 2 | ||
close | ||
end tell | ||
end tell | ||
end run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
4 changes: 0 additions & 4 deletions
4
dmg_osx/template.app/Contents/Resources/description.rtfd/TXT.rtf
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.