DropDMG: anyone managed to script that into a build?

Im trying to get to grips with the command line options for DropDMG, as I cant work out how to make it take my newly built App, and create a DMG from that using a previously set up config. Has anyone done that here?

[i](reason being: I started using the PKG output from the excellent App Wrapper, but I’m getting a lot of grief from users who tell me they run the install but can’t find the installed app.
.PKG doesnt seem to consistently put the app into Applications: I have even seen it install into Trash if the user has deleted a previous version before installing! So I figure if I can get DMG into the mix, then the user has full control of ‘copy to applications’)

[/i]

This should get you started:

[code]dim theVersion as String = PropertyValue(“App.ShortVersion”)
theVersion = NthField(theVersion, " ", 1)
dim FileName as String
dim VolumeName as String
VolumeName = getShellString("Mail Archiver Installer " + theVersion)
FileName = ReplaceAll(“Mail Archiver X”, " ", “”) + ReplaceAll(theVersion, “.”, “”)

dim PackageLocation as String = CurrentBuildLocation
dim CountSlashes as Integer = CountFields(PackageLocation, “/”)
dim ParentFolder as string = NthField(PackageLocation, “/”, CountSlashes)
dim ParentPath as String = Left(PackageLocation, Len(PackageLocation) - Len(ParentFolder))
ParentFolder = NthField(ParentPath, “/”, CountSlashes - 1)
ParentPath = Left(ParentPath, Len(ParentPath) - Len(ParentFolder) - 1)
PackageLocation = ParentPath + getShellString(“Builds - max.rbp/final”)

dim theCommand as String
theCommand = “dropdmg --config-name=Max31 --base-name=” + FileName + " --volume-name=" + VolumeName + " " + PackageLocation
dim theResult as String = DoShellCommand (theCommand)

function getShellString(theString as String) as string
Return ReplaceAll(theString, " ", "\ ")
end Function[/code]

Thank you… I’ll get started.

I use DMGCanvas which has an excellent command line option. Then in AppWrapper I simply create a little bash script to create the DMG.

+1 for DMGCanvas + AppWrapper combo. The post wrap script is easy too:

/Applications/DMG\\ Canvas.app/Contents/Resources/dmgcanvas ~/Apps/Answers/disk_image.dmgCanvas ~/Apps/Answers/builds/Answers_latest.dmg -v Answers;

Obviously you’d have to modify for your path to the dmgcanvas command line, and your disk image template.

Cheers all.
I just bought DropDMG… I may have a licence fro DMGCanvas somewhere although I recall giving up on that a few years back.

Where does the post wrap script go?
The build script from AppWrapper specifcally says ‘dont amend me’

By the way… happy birthday Tim!

There’s a spot for a post-wrap script in AppWrapper itself.
On the “Other” tab scroll down below the “Fine grained control over files” listbox for a section titled “On wrapping completion” You can add a bash script there.

And thanks :slight_smile:
Answers press releases and updates are just about done, up next is HTML Edit :smiley: