Adding a Software License Agreement to a DMG file

This thread has moved to my new site here: http://pyhacker.com/archive2011/adding-software-license-agreement-dmg-file/

As part of the software distribution process I go through at my job (Qforma, Inc), I package up our software for both Windows and Mac. For Windows, I create an installer using NSIS which requires a user to agree to a Software License Agreement (SLA) before installing the software. For Mac, rather than using an installer, I have a customized disk image (DMG) that contains the app and a symlink to the /Applications directory. 

Since we require a user to agree to our SLA before using our software on Windows, I wanted to require the same on Mac. I searched the internet for an easy way to add an SLA to a DMG and couldn't find a solution that didn't involve using a third party GUI program. Of course all my build processes are automated and run headless so those GUI programs won't work for me. I also wanted to use utilities built in to OS X (or available through Xcode).

Anyway, I figured out how to add an SLA to a DMG and was able to add it to my automated build process. I figured I'd create a simple python script that'll do it too and share it with everyone.

To use the script, make sure Xcode is installed to the default location (/Developer). Download the file, make it executable, then simply run:

./licenseDMG.py <dmgFile> <licenseFile>

where dmgFile is the path to your DMG file and licenseFile is the path to your plain ascii text license file.

Hopefully someone else will also find this useful.

Oh, and I use the with statement in the script so it's python 2.6+ (or python 2.5 if you add from __future__ import with_statement to the top line). If you use the default system python, that means this script works on OS X 10.6+.

Meta

Published: July 28, 2011

Author: Jared Hobbs

Comments:  

Word Count: 300

Next: Install OS X Client as a guest inside VMWare Fusion 4

Previous: Fuse4X

Bookmark and Share

Tags

dmg license mac python sla

Article Links

  1. PyHacker - Adding a Software License Agreement to a DMG ...
  2. Qforma Analytics
  3. NSIS Wiki
  4. Xcode 4 - Apple Developer
Comments powered by Disqus
  • From our blogs...

    • No solo cuando es conveniente para ti...
    • Updated: Aug. 5, 2011, 1:53 p.m.

      Ya no me voy a estresar mas por problemas de nadie. Como dice Jared: "Solo enforcarme en mi familia" ...

    • 26 going on 62.
    • Updated: Aug. 4, 2011, 9:33 p.m.

      No creo que soy la unica que ha deseado verse mas adulta cuando era mas joven. Por alguna razon nadie me tomaba muy enserio aunque yo estaba casada po...

    • Ya.
    • Updated: July 11, 2011, 6:43 p.m.

      Siempre hay gente con una mala vibra. Gente que no se cansa de hablar caca, mi hermana por ejemplo escribiendo que yo me busque una vida porque yo nad...

    • Pictures of us at Sam and Kiley's Wedding.
    • Updated: July 7, 2011, 5:59 p.m.

      Jacob and Shauna took some pictures of us at the temple for Sam's wedding.  Today, Jacob sent me these beautiful pictures of us but I didn't get ...

    • Hola otra vez.
    • Updated: July 2, 2011, 11:45 p.m.

      Hoy me siento mucho mejor. No creo que tener malos sentimientos o pensar en venganza sea mi estilo.  Aunque yo quiera no soy una de esas personas...

    More posts...

  • Tag Cloud


  • Twitter updates

  •  

    Copyright © 2012 Jared Hobbs. All rights reserved.