[vlc-devel] [PATCH] Make the Mac DMG prettier.

Rafaël Carré rafael.carre at gmail.com
Tue Dec 27 03:39:43 CET 2011


Hello,

Le 2011-12-26 21:07, Brendon Justin a écrit :
> ---
>   extras/package/macosx/dmg_setup.scpt |   25 +++++++++++++++++++++++++
>   extras/package/macosx/package.mak    |    5 ++++-
>   2 files changed, 29 insertions(+), 1 deletions(-)
>   create mode 100644 extras/package/macosx/dmg_setup.scpt
>
> diff --git a/extras/package/macosx/dmg_setup.scpt b/extras/package/macosx/dmg_setup.scpt
> new file mode 100644
> index 0000000..f50ab36
> --- /dev/null
> +++ b/extras/package/macosx/dmg_setup.scpt
> @@ -0,0 +1,25 @@
> +on run argv
> +    tell application "Finder"
> +        tell disk (item 1 of argv)
> +            open
> +            set current view of container window to icon view
> +            set toolbar visible of container window to false
> +            set statusbar visible of container window to false
> +            set the bounds of container window to {300, 100, 750, 500}
> +            set theViewOptions to the icon view options of container window
> +            set arrangement of theViewOptions to not arranged
> +            set icon size of theViewOptions to 104
> +            # Don't set a background image, for now
> +            # set background picture of theViewOptions to file ".background/background.png"
> +            set position of item "VLC.app" of container window to {110, 100}
> +            set position of item "Applications" of container window to {335, 100}
> +            set position of item "Read Me.rtf" of container window to {110, 275}
> +            set position of item "Goodies" of container window to {335, 275}
> +	    # Force saving changes to the disk by closing and opening the window
> +            close
> +            open
> +            update without registering applications
> +            delay 5
> +        end tell
> +    end tell
> +end run
> diff --git a/extras/package/macosx/package.mak b/extras/package/macosx/package.mak
> index ab4d096..1c8b2f6 100644
> --- a/extras/package/macosx/package.mak
> +++ b/extras/package/macosx/package.mak
> @@ -67,7 +67,10 @@ package-macosx: VLC-release.app
>   	cp $(srcdir)/extras/package/macosx/Resources/about_bg.png $(top_builddir)/vlc-$(VERSION)/.background/background.png
>   	$(LN_S) -f /Applications $(top_builddir)/vlc-$(VERSION)/
>   	rm -f "$(top_builddir)/vlc-$(VERSION)-rw.dmg"
> -	hdiutil create -verbose -srcfolder "$(top_builddir)/vlc-$(VERSION)" "$(top_builddir)/vlc-$(VERSION)-rw.dmg" -scrub
> +	hdiutil create -verbose -srcfolder "$(top_builddir)/vlc-$(VERSION)" "$(top_builddir)/vlc-$(VERSION)-rw.dmg" -scrub -format UDRW
> +	hdiutil attach -readwrite -noverify -noautoopen "vlc-$(VERSION)-rw.dmg"

I think it'd be better to mount the dmg to a mount point in the current 
directory instead of /Volumes

> +	osascript $(srcdir)/extras/package/macosx/dmg_setup.scpt vlc-$(VERSION)

$(srcdir) should be in quotes "" in case it has spaces in it.

> +	hdiutil detach /Volumes/vlc-$(VERSION)
>   # Make sure the image is not writable
>   # Note: We can't directly create a read only dmg as we do the bless stuff
>   	rm -f "$(top_builddir)/vlc-$(VERSION).dmg"




More information about the vlc-devel mailing list