1 Commits

Author SHA1 Message Date
Alexander Batalov
071563beb9 Customize macos disk image 2025-02-15 10:03:55 +03:00
3 changed files with 48 additions and 1 deletions

View File

@@ -391,7 +391,8 @@ if(APPLE)
install(TARGETS ${EXECUTABLE_NAME} DESTINATION .)
set(CPACK_GENERATOR "DragNDrop")
set(CPACK_DMG_DISABLE_APPLICATIONS_SYMLINK ON)
set(CPACK_DMG_DS_STORE_SETUP_SCRIPT "${CMAKE_SOURCE_DIR}/os/macos/dmg/setup.scpt")
set(CPACK_DMG_BACKGROUND_IMAGE "${CMAKE_SOURCE_DIR}/os/macos/dmg/background.png")
set(CPACK_PACKAGE_FILE_NAME "Fallout II Community Edition")
endif()

BIN
os/macos/dmg/background.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

46
os/macos/dmg/setup.scpt Normal file
View File

@@ -0,0 +1,46 @@
on run argv
set image_name to item 1 of argv
tell application "Finder"
tell disk image_name
set open_attempts to 0
repeat while open_attempts < 4
try
open
delay 1
set open_attempts to 5
close
on error errStr number errorNumber
set open_attempts to open_attempts + 1
delay 10
end try
end repeat
delay 5
open
set current view of container window to icon view
set theViewOptions to the icon view options of container window
set background picture of theViewOptions to file ".background:background.png"
set arrangement of theViewOptions to not arranged
set icon size of theViewOptions to 128
delay 5
close
open
update without registering applications
tell container window
set sidebar width to 0
set statusbar visible to false
set toolbar visible to false
set the bounds to {400, 100, 1040, 609}
set position of item "Fallout II Community Edition.app" to {160, 240}
set position of item "Applications" to {480, 240}
end tell
update without registering applications
delay 5
close
end tell
delay 1
end tell
end run