Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / Mac Programming / January 2006



Tip: Looking for answers? Try searching our database.

Packaging in DMG

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
djg@tramontana.co.hu - 08 Jan 2006 12:03 GMT
Hello,

I have finally succeeded in finishing my program (thanks to a couple of
people helping in these groups, too). It is packaged into a DMG all
right but I still have two questions.

First, I'd like to have a background image when the user opens the
package. It is described in quite a few places and, as far as I can
tell, I did follow the instructions, yet it fails to show up. I have a
background picture set up in the original folder, correctly showing up.
This will be copied to the DMG, including the .DS_Store file. The
picture will also be there, of course (invisible, in its own folder).
Yet, when I open the DMG, the icons will be in their proper customized
place (what seems to suggest that the .DS_Store *is* read by Finder)
but without the background image.

Second, I have to prepare my license agreement in Hungarian as well as
in English. The .r file containing the text resource refers to
languages using numbers like 50nn. I couldn't find and reference to the
code for Hungarian.

This is the script I use to create the disk image (as this operation
will be repeated often, I prefer to have it scripted rather than doing
it with the mouse every time):

=====
#!/bin/bash

if [ -z $1 ]; then
 echo "Error: specify serial number"
 exit 0
fi

echo "*** Creating Disk Image"
hdiutil create -ov -size 1m -fs HFS+ -volname "VOLUMENAME" temp.dmg
hdiutil attach temp.dmg

echo "*** Copying files"
/Developer/Tools/CpMac "path/Readme.rtf"
"/Volumes/VOLUMENAME/Readme.rtf"
/Developer/Tools/CpMac "path/.DS_Store" "/Volumes/VOLUMENAME/.DS_Store"
/Developer/Tools/CpMac -r "path/Product" "/Volumes/VOLUMENAME"
/Developer/Tools/CpMac -r "path/Background" "/Volumes/VOLUMENAME"
/Developer/Tools/SetFile -a V "/Volumes/VOLUMENAME/Background"
DEVICE=$(mount | grep "/Volumes/VOLUMENAME" | cut -f1 -d ' ')
hdiutil detach $DEVICE

echo "*** Resizing"
hdiutil resize -sectors min temp.dmg

echo "*** Compressing"
hdiutil convert temp.dmg -format UDZO -imagekey zlib-level=9 -o
"VOLUMENAME ($1).dmg"
rm temp.dmg

echo "*** Adding license agreement"
hdiutil unflatten "VOLUMENAME ($1).dmg"
/Developer/Tools/Rez /Developer/Headers/FlatCarbon/*.r "path/Licence.r"
-a -o "VOLUMENAME ($1).dmg"
hdiutil flatten "VOLUMENAME ($1).dmg"
=====

Thanks,
 Gábor
DEÁK JAHN, Gábor - 14 Jan 2006 19:37 GMT
Hello,

> Second, I have to prepare my license agreement in Hungarian as well
> as in English. The .r file containing the text resource refers to
> languages using numbers like 50nn. I couldn't find and reference to
> the code for Hungarian.

I did find documentation about these numbers, however, no matter how I tried to follow its description, it doesn't work. Could somebody quote a License.r file for me? I don't need several languages, monolingual is all right and I don't need the actual license text, of course, just the LPic resource structure.

Thanks,
 Gábor
Derek Ledbetter - 15 Jan 2006 08:33 GMT
> I did find documentation about these numbers, however, no matter how I
> tried to follow its description, it doesn't work. Could somebody quote
> a License.r file for me? I don't need several languages, monolingual is
> all right and I don't need the actual license text, of course, just the
> LPic resource structure.

Have you tried this SKD?

> Software License Agreements for UDIFs
Mac OS X's Disk Copy has the
> ability to display a multi-lingual software license agreement (SLA)
> before mounting a disk image. This SDK explains how to add license
> agreements to Mac OS X-native UDIF disk images. [May 9, 2003]
<ftp://ftp.apple.com/developer/Development_Kits/SLAs_for_UDIFs_1.0.dmg>

Signature

Derek Ledbetter
derekl@serve.com

DEÁK JAHN, Gábor - 15 Jan 2006 12:26 GMT
On Sun, 15 Jan 2006 09:33:43 +0100, Derek wrote:

Derek,

> Have you tried this SDK?

Yes, this was the one. It only has a few words about the LPic resource but no matter how I tried to follow them, the license agreement didn't show up. And I wasn't able to look into the accompanying resource file because it kept starting a PobToXml (if I remember correctly) application that offered no conversion or viewing at all.

Bye,
 Gábor
DEÁK JAHN, Gábor - 15 Jan 2006 20:44 GMT
Derek,

OK, I gave up, I use a multilingual .r file with only one license agreement actually provided. It works now although I'd be interested to know what went wrong with the monolingual one...

But that still leaves my second problem with the background image unsolved. To recap, the background image is in its place, the .DS_Store copied. When I mount the DMG, the background is not shown but the icons in the folder assume their customized positions, so .DS_Store is read by Finder. What can be the reason for the bitmap not showing up?
Eric Albert - 15 Jan 2006 21:00 GMT
> OK, I gave up, I use a multilingual .r file with only one license agreement
> actually provided. It works now although I'd be interested to know what went
[quoted text clipped - 5 lines]
> their customized positions, so .DS_Store is read by Finder. What can be the
> reason for the bitmap not showing up?

Have you tried this?

<http://c-command.com/dropdmg/>

-Eric

Signature

Eric Albert         ejalbert@cs.stanford.edu
http://outofcheese.org/

DEÁK JAHN, Gábor - 15 Jan 2006 23:02 GMT
Eric,

> Have you tried this?
> <http://c-command.com/dropdmg/>

I'd need a scripted solution, not something requiring me to mouse around. It will be a repeated process and automation is necessary.
Eric Albert - 16 Jan 2006 17:27 GMT
> > Have you tried this?
> > <http://c-command.com/dropdmg/>
>
> I'd need a scripted solution, not something requiring me to mouse around. It
> will be a repeated process and automation is necessary.

Read that page again.

"All the options are available from Automator, AppleScript, and from the
dropdmg command-line tool."

-Eric

Signature

Eric Albert         ejalbert@cs.stanford.edu
http://outofcheese.org/

DEÁK JAHN, Gábor - 16 Jan 2006 18:49 GMT
Eric,

> "All the options are available from Automator, AppleScript, and
> from the dropdmg command-line tool."

You're right, thanks, however, in the meantime, I gave up the pure programmatic approach (although I even tried something Larry was corresponding about on a mailing list somewhere about an AppleScript telling Finder to set various window options) and settled on creating a Template.dmg manually that will be populated by the script automatically. It seems to work for now.

Thanks,
 Gábor
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.