Register FAQ/Rules Forum Spy Search Today's Posts Mark Forums Read

Welcome to the Mac Forums forums. Please read the FAQ if you have questions. Register to participate.

 
Go Back   Mac Forums > Apple Software > Mac OS X Forums > Mac OS X
TouchArcade.com - iPhone Game Reviews and News

Reply
 
Thread Tools Search this Thread Display Modes
Old Jun 11, 2006, 06:08 PM   #1
IJ Reilly
macrumors 603
 
IJ Reilly's Avatar
 
Join Date: Jul 2002
Location: Palookaville
Folder Background Image on a CD

I am trying to create a CD which has a background picture for the folder. So I created a disk image in Disk Utility, dragged in the items I wanted on the CD, then added the picture in View Options. Looks great. Now I burn a CD from the disk image. The finished CD mounts on the desktop, I open it -- still looks great. Then I insert the CD into two other Macs. Now the folder background is white. Apparently the background image has to be stored somewhere on the CD. How do I keep the folder background on the CD, so it can be seen on any Mac?
__________________
*The season starts too early and finishes too late and there are too many games in between.
Bill Veeck
IJ Reilly is offline   Reply With Quote
Old Jun 11, 2006, 06:25 PM   #2
robbieduncan
macrumors Demi-God
 
robbieduncan's Avatar
 
Join Date: Jul 2002
Location: London
It's probably best described as "complicated" as the Finder really likes messing around with the .DS_Store file that tells it which mode to display the folder in.

The basic approach is to copy the file to the CD as a hidden file.

If you download the source to Poster Paint (see my sig) you will see how I do this for the dmg I distribute the app as. I use a nice Mozilla tool (well as slightly modified version of it: see the source archive) to create the DMG, but it relies on having an appropriate .DS_Store file to start with.

You may find this page useful. I used it to get the info to make my dmg. If you can get the DMG to create you could just burn that as a CD.
__________________
My App Store Apps: DLR Times
robbieduncan is online now   Reply With Quote
Old Jun 11, 2006, 08:32 PM   #3
IJ Reilly
Thread Starter
macrumors 603
 
IJ Reilly's Avatar
 
Join Date: Jul 2002
Location: Palookaville
Yikes.

I wonder, if I just drag the background image file to the disk image, will that do the trick (assuming I don't care if anyone sees it there)?
__________________
*The season starts too early and finishes too late and there are too many games in between.
Bill Veeck
IJ Reilly is offline   Reply With Quote
Old Jun 11, 2006, 09:01 PM   #4
jimsowden
macrumors 68000
 
jimsowden's Avatar
 
Join Date: Sep 2003
Location: Boston, MA
Send a message via AIM to jimsowden
I think I remember seeing disks like that, yes.
__________________
King Donko of Punchstania
jimsowden is offline   Reply With Quote
Old Jun 12, 2006, 03:48 AM   #5
robbieduncan
macrumors Demi-God
 
robbieduncan's Avatar
 
Join Date: Jul 2002
Location: London
If everything is working when you put the image one the CD then making the image file itself hidden is quite easy.

Do this to set the image.

1) Create a folder on the cd called background
2) Copy the image into that folder
3) Rename the folder to .background (the Finder may not let you, if this is the case use the Terminal mv command to move background to .background).
4) The folder is now invisible
5) Set the background: you cannot navigate to the folder normally, when the window to navigate in is open hit Shift-Command-G to bring up the go-to-folder box and type in the full path including .background. Now you can select the file within the hidden folder.
__________________
My App Store Apps: DLR Times
robbieduncan is online now   Reply With Quote
Old Jun 12, 2006, 03:59 AM   #6
mad jew
Demi-God (Moderator emeritus)
 
mad jew's Avatar
 
Join Date: Apr 2004
Location: Adelaide, Australia
I think I remember doing this in Panther and you're right IJ Reilly, all I did was drag the image to the disk image and then set it as the background. I don't think it'll work the other way around, although I guess it's worth a try. I didn't bother hiding the image but that's always useful to know robbieduncan. I don't have any blank discs nearby to test this on although I guess I could try it with DMGs once I've finished this uni assignment.
__________________
Some things are better mad...
mad jew is offline   Reply With Quote
Old Jun 12, 2006, 05:20 AM   #7
bigandy
macrumors Demi-God
 
bigandy's Avatar
 
Join Date: Apr 2004
Location: Soho, London
Toast does it pretty easily if I remember correctly... either that or i'm still drunk from last night...
__________________
"any day that involves cat pee is a really bad day" - iBlue
bigandy is offline   Reply With Quote
Old Jun 12, 2006, 11:19 AM   #8
IJ Reilly
Thread Starter
macrumors 603
 
IJ Reilly's Avatar
 
Join Date: Jul 2002
Location: Palookaville
I found a freeware application called HideOut. I have not tried it yet, but it's supposed to make any file invisible. If I understand correctly, it only adds a dot before the name, which means I'd still have to navigate to it in the Finder to set it as the background.
__________________
*The season starts too early and finishes too late and there are too many games in between.
Bill Veeck
IJ Reilly is offline   Reply With Quote
Old Jun 15, 2006, 10:26 PM   #9
j-birder
macrumors newbie
 
Join Date: Jun 2006
cannot get pkg-dmg to work

I'm unable to get this to work programmatically using the mozilla pkg-dmg script. When I mount the .dmg, the finder window appears in the correct place and is the correct size, and the file icons appear in the correct places. But, the background image does not appear. It is present, just not displayed.

I can create a .dmg manually and have the background display nicely. It's just that I cannot get the pkg-dmg script to work. I assume that the problem has something to do with the .DS_Store file that I use, but I cannot figure out what the problem is. Here is how I create it.

1) Use disk utility to create a 10 MB image that is read/write.
2) Use command-line mkdir to create a hidden directory that will hold the background image.
3) Use command-line cp to copy the background image into the new directory. (It is a .png file.)
4) Use command-line mv to move into the new disk image the application and its file of release notes.
5) Use Finder -> View -> Show view options to set
- This folder only
- Set the background image
6) Close folder and unmount disk image by dragging it to the trash
7) Re-open disk image
8) Use command-line cp to copy .DS_Store from the image to a file named just DS_Store (no dot) in my application source tree.

Now, if I take the original image, unmount it and create a read-only image from it, the new read-only image works fine. If I create a new image using the pkg-dmg script and then open it, the background image does not appear.

It seems as if I'm doing everything correctly. Does anyone see anything that is obviously wrong? Any suggestions?

Thanks,

j-birder
j-birder is offline   Reply With Quote
Old Jun 16, 2006, 01:27 AM   #10
IJ Reilly
Thread Starter
macrumors 603
 
IJ Reilly's Avatar
 
Join Date: Jul 2002
Location: Palookaville
I don't know if you've done everything correctly (though I suppose obviously not, I just couldn't tell you why not), but I think the method I used is a lot easier. If the background image resides on the disk image and is selected by the Finder, it will "stick" when the disk image is burned. The trick is making that image file hidden, which I was able to do with a single command line instruction and no movement of .DS_STORE files. Try it!
__________________
*The season starts too early and finishes too late and there are too many games in between.
Bill Veeck
IJ Reilly is offline   Reply With Quote
Old Jun 16, 2006, 06:36 PM   #11
j-birder
macrumors newbie
 
Join Date: Jun 2006
looking for long-term ease

Yes, I understand that building a disk image manually is not difficult. What I want is an automated build of my application: I issue 2 words and the application is built from scatch and packaged. What I don't want to do is to have to manually build a disk image each time I want to release a new version of a my application. Hence, I'd really like to get the pkg-dmg script to work.
j-birder is offline   Reply With Quote
Old Jun 16, 2006, 11:51 PM   #12
IJ Reilly
Thread Starter
macrumors 603
 
IJ Reilly's Avatar
 
Join Date: Jul 2002
Location: Palookaville
I'm not entirely certain I understand what you are trying to accomplish, but you might want to look into Automater.
__________________
*The season starts too early and finishes too late and there are too many games in between.
Bill Veeck
IJ Reilly is offline   Reply With Quote
Old Jun 17, 2006, 03:29 AM   #13
robbieduncan
macrumors Demi-God
 
robbieduncan's Avatar
 
Join Date: Jul 2002
Location: London
Quote:
Originally Posted by j-birder
Yes, I understand that building a disk image manually is not difficult. What I want is an automated build of my application: I issue 2 words and the application is built from scatch and packaged. What I don't want to do is to have to manually build a disk image each time I want to release a new version of a my application. Hence, I'd really like to get the pkg-dmg script to work.
Poster Paint is able to do this (from within XCode). I simply change the Target to Package and it builds the app and then packages that into a nice .dmg with a background image and so on. The code is available to download.

The difficult bit is getting a .DS_Store file that works. The way I did it was to create a new folder and set that up the way I wanted and then copy the .DS_Store from it.
__________________
My App Store Apps: DLR Times
robbieduncan is online now   Reply With Quote
Old Jun 17, 2006, 01:08 PM   #14
j-birder
macrumors newbie
 
Join Date: Jun 2006
I've downloaded Poster Paint and poked around. I found your background image, the the copy of DS_Store that you use, and also pkg-dmg. I ran strings on your DMG_DS_Store to see if there was anything in it that is radically different from my DS_Store, and nothing turned up. I diffed your copy of pkg-dmg against the copy that I got from mozilla and found that it differs in ways that should not matter. I couldn't find where you actually invoke pkg-dmg to do its job. To be honest, I'm not familiar with XCode. I'm a java developer and use apache ant to build and package my application. That's part of why I'm really interested in getting pkg-dmg to work.
j-birder is offline   Reply With Quote
Old Jun 17, 2006, 01:52 PM   #15
robbieduncan
macrumors Demi-God
 
robbieduncan's Avatar
 
Join Date: Jul 2002
Location: London
I call pkg-dmg from a shell-script build phase in XCode. The shell script executed is below (I believe that it uses sh to execute this):

Code:
# Package App to pretty dmg.
mkdir "$SOURCE_ROOT/Packaging/PosterPaint"
cp -R "$BUILD_DIR/Release/Poster Paint.app" "$SOURCE_ROOT/Packaging/PosterPaint/"
cp -f "$SOURCE_ROOT/Read Me.rtf" "$SOURCE_ROOT/Packaging/PosterPaint/"
mkdir "$SOURCE_ROOT/Packaging/PosterPaint/.background"
cp -f "$SOURCE_ROOT/Packaging/DMG Background.tif" "$SOURCE_ROOT/Packaging/PosterPaint/.background/"
cp -f "$SOURCE_ROOT/Packaging/DMG_DS_Store" "$SOURCE_ROOT/Packaging/PosterPaint/.DS_Store"
$SOURCE_ROOT/Packaging/pkg-dmg --source "$SOURCE_ROOT/Packaging/PosterPaint" --target "$SOURCE_ROOT/Packaging/Poster Paint.dmg" --icon "$SOURCE_ROOT/Packaging/DMG.icns" --volname "Poster Paint" --applink
rm -rf "$SOURCE_ROOT/Packaging/PosterPaint"
$SOURCE_ROOT is an XCode variable that (not surprisingly) is the root of the source tree (basically where the .xcodeproj file is).

The .DS_Store file contains a lot of important stuff in binary form.

What, exactly, is the problem you are encountering?
__________________
My App Store Apps: DLR Times
robbieduncan is online now   Reply With Quote
Old Jun 18, 2006, 09:02 AM   #16
j-birder
macrumors newbie
 
Join Date: Jun 2006
My problem is that everything seems to be on the disk image but when I mount it the background image does not appear. Once the image is mounted I can use the finder to turn on the background image, but it does not appear when the image is mounted and opened.

Thanks for posting your code. One difference that I saw in it is that you copy the background image and .DS_Store to the image before invoking pkg-dmg. I was using arguments to pkg-dmg to do those things (--mkdir ... --copy ... --copy). (pkg-dmg uses rsync to copy files.) I tried copying prior to invoking pkg-dmg, as you did, but to no avail.

I'm still perplexed. I also use pkg-dmg to set a volume icon and to add a license dialog when the volume is opened. I may drop both of those to see if they make a difference and if so add them back sequentially. It shouldn't matter, but you never know.
j-birder is offline   Reply With Quote
Old Jun 18, 2006, 09:09 AM   #17
robbieduncan
macrumors Demi-God
 
robbieduncan's Avatar
 
Join Date: Jul 2002
Location: London
I still think the issue is with your .DS_Store file. Try doing this:

Create a new dmg on your desktop.
Copy ALL of the contents that will end up in your dmg into this dmg.
Set the background image and any other items you want. The image MUST be within this dmg.

Unmount the DMG.

Remount it. If everything is as you want it copy the .DS_Store out.
__________________
My App Store Apps: DLR Times
robbieduncan is online now   Reply With Quote
Old Jun 18, 2006, 04:25 PM   #18
j-birder
macrumors newbie
 
Join Date: Jun 2006
Yes, I agree that the problem must be in .DS_Store.

I took your advice and rebuilt a .DS_Store file from scratch.
1) New dmg file using disk utility. Outfitted it with the works:
2) Created .background directory and copied in background.png with mkdir and cp
3) Moved application into place using mv
4) Moved a file named RELEASE_NOTES into place using mv
5) Used finder to set background image (this folder only and using the copy of background.png that is on the dmg).
6) Set custom icon using /Developer/Tools/SetFile
7) Unmounted
8) Set license dialog resource using /Developer/Tools/Rez
9) Remounted
10) Copied .DS_Store out

Again, the diskimage that I create by hand works fine, and that produced by pkg-dmg does not display the background image. I've even made sure that my command-line arguments to pkg-dmg are in the same order as those in your script above.
j-birder is offline   Reply With Quote
Old Jun 18, 2006, 04:28 PM   #19
robbieduncan
macrumors Demi-God
 
robbieduncan's Avatar
 
Join Date: Jul 2002
Location: London
Then I'm out of ideas.

There are some suggestions here.
__________________
My App Store Apps: DLR Times
robbieduncan is online now   Reply With Quote
Old Jun 19, 2006, 07:58 AM   #20
j-birder
macrumors newbie
 
Join Date: Jun 2006
Thanks, I am out of ideas, too. I've accepted defeat on this one and have gone with a partial solution. I manually create an image, invoke an ant task to populate it, manually adjust size arrangement etc, and then invoke an ant task to pack it and set the license pop-up.

Thanks for your help,

j-birder
j-birder is offline   Reply With Quote
Old Jun 19, 2006, 08:07 AM   #21
robbieduncan
macrumors Demi-God
 
robbieduncan's Avatar
 
Join Date: Jul 2002
Location: London
Quote:
Originally Posted by j-birder
Thanks, I am out of ideas, too. I've accepted defeat on this one and have gone with a partial solution. I manually create an image, invoke an ant task to populate it, manually adjust size arrangement etc, and then invoke an ant task to pack it and set the license pop-up.

Thanks for your help,

j-birder
You might be able to use AppleScript to do the manual bit(s) for you...
__________________
My App Store Apps: DLR Times
robbieduncan is online now   Reply With Quote

Reply

Mac Forums > Apple Software > Mac OS X Forums > Mac OS X

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 10:39 AM.

Mac News | Mac Rumors | iPhone Game Reviews | iPhone Apps

Powered by vBulletin® Version 3.6.10
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright 2002-2009, MacRumors.com, LLC