Menu
Jan 01, 2015 Create a dmg image at your application need size, Quit Disk Utilities. Now, the hard part: define (draw) your image background and save it using 'background.png” as its name. In the dmg, create a folder and name it “background”. Copy your “background.png” image into that “background” folder. Dec 15, 2017 Create a background image. One of the great things about using a DMG is that you can create a custom background for the disk image. You can add your logo and provide some simple instructions that people should drag and drop your app into the Applications folder. If you're using Photoshop, make sure you set it up as a high DPI image.
Anyone found a way to insert a background image in a .dmg disk image (a la OmniGroup - see OmniWeb.dmg for an example)?
I have noticed that the image is in an invisible folder called .windowbg (the image itself being called .windowbg.jpeg). I tried replicating that folder (and its corresponding image) in a newly created .dmg (using dmgmaker) but it did not work.
While we're at it: anyone found a way to define a fixed window position and size for .dmg disk images (quite useful if a background image is there...).
Colddiver, newbie Cocoa developer
I have noticed that the image is in an invisible folder called .windowbg (the image itself being called .windowbg.jpeg). I tried replicating that folder (and its corresponding image) in a newly created .dmg (using dmgmaker) but it did not work.
While we're at it: anyone found a way to define a fixed window position and size for .dmg disk images (quite useful if a background image is there...).
Colddiver, newbie Cocoa developer
How do I create a nice-looking DMG for Mac OS X using command-line tools? (10)
.DS_Store files stores windows settings in Mac. Windows settings include the icons layout, the window background, the size of the window, etc. The .DS_Store file is needed in creating the window for mounted images to preserve the arrangement of files and the windows background.
![Make Make](https://cdn.makeuseof.com/wp-content/uploads/2017/10/10-Enter-password-to-open-dmg-file.png)
How To Make A Background Image In A Dmg Download
Once you have .DS_Store file created, you can just copy it to your created installer (DMG).
I need to create a nice installer for a Mac application. I want it to be a disk image (DMG), with a predefined size, layout and background image.
I need to do this programmatically in a script, to be integrated in an existing build system (more of a pack system really, since it only create installers. The builds are done separately).
![How to make a background image in a dmg download How to make a background image in a dmg download](/uploads/1/2/5/4/125482147/590010415.png)
I already have the DMG creation done using 'hdiutil', what I haven't found out yet is how to make an icon layout and specify a background bitmap.
How To Make A Background Image In A Dmg Free
After lots of research, I've come up with this answer, and I'm hereby putting it here as an answer for my own question, for reference:
- Make sure that 'Enable access for assistive devices' is checked in System Preferences>>Universal Access. It is required for the AppleScript to work. You may have to reboot after this change (it doesn't work otherwise on Mac OS X Server 10.4).
- Create a R/W DMG. It must be larger than the result will be. In this example, the bash variable 'size' contains the size in Kb and the contents of the folder in the 'source' bash variable will be copied into the DMG:
- Mount the disk image, and store the device name (you might want to use sleep for a few seconds after this operation):
- Store the background picture (in PNG format) in a folder called '.background' in the DMG, and store its name in the 'backgroundPictureName' variable.
- Use AppleScript to set the visual styles (name of .app must be in bash variable 'applicationName', use variables for the other properties as needed):
- Finialize the DMG by setting permissions properly, compressing and releasing it:
On Snow Leopard, the above applescript will not set the icon position correctly - it seems to be a Snow Leopard bug. One workaround is to simply call close/open after setting the icons, i.e.: