Recent

Author Topic: Deploying your Mac app bundle in ZIP format  (Read 18922 times)

pasquale

  • Sr. Member
  • ****
  • Posts: 267
    • Esposito Software
Deploying your Mac app bundle in ZIP format
« on: April 02, 2012, 07:40:05 am »
Hello, everybody.

I read elsewhere in this Forum that, when you want to deploy your Mac application, you should generate a disk image file (.dmg) for distribution.

My question is, isn't it enough to place the bundle in a folder and compress it? After compressing the folder, you could just provide the final user with the ZIP file. By unzipping the file, the user will get a folder containing the app ready for use.

Is this procedure correct or am I missing something?

TIA
Apple loves breaking backward compatibility to make money. If you want to be sure that your apps will never stop working, use Windows and trash macOS!

pasquale

  • Sr. Member
  • ****
  • Posts: 267
    • Esposito Software
Re: Deploying your Mac app bundle in ZIP format
« Reply #1 on: April 02, 2012, 09:58:24 am »
To restate my question, what's the point in creating a disk image?
Apple loves breaking backward compatibility to make money. If you want to be sure that your apps will never stop working, use Windows and trash macOS!

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Deploying your Mac app bundle in ZIP format
« Reply #2 on: April 02, 2012, 10:45:20 am »
I think it will look more professional if you build the disk image, so I would recommend it if you selling your software. If it is something given for free then it might not be worth the extra work.

In the Virtual Magnifying Glass I have simply zipped the .app bundle and I never had complains about it:

http://magnifier.sourceforge.net/#download

So I think it is a safe way of deployment, since I have tens of thousands of Mac downloads.

pasquale

  • Sr. Member
  • ****
  • Posts: 267
    • Esposito Software
Re: Deploying your Mac app bundle in ZIP format
« Reply #3 on: April 02, 2012, 12:10:22 pm »

In the Virtual Magnifying Glass I have simply zipped the .app bundle and I never had complains about it:

http://magnifier.sourceforge.net/#download

So I think it is a safe way of deployment, since I have tens of thousands of Mac downloads.

So, if I understand correctly, you believe that creating and distributing a zip file instead of a disk image file is a safer way to deploy your applications.

I am wondering whether there is any reason why an app deployed in ZIP format may not work. What I mean is, if the app works locally, can we be certain that it will work on another Mac if we deliver a zipped folder only containing the bundle?
Apple loves breaking backward compatibility to make money. If you want to be sure that your apps will never stop working, use Windows and trash macOS!

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Deploying your Mac app bundle in ZIP format
« Reply #4 on: April 02, 2012, 12:20:27 pm »
Felipe said safe, not safer. He also said using a dmg image would look more professional.

"I am wondering whether there is any reason why an app deployed in ZIP format may not work. What I mean is, if the app works locally, can we be certain that it will work on another Mac if we deliver a zipped folder only containing the bundle?"
His post on experiences with Virtual Magnifying Glass would indicate that deplying in a zip seems to work... I'd suspect not many Lazarus/FPC applications have so many OSX downloads.

AFAIU, creating a dmg is not that hard either; you can do it via the command line as well and therefore call it as an after compile action in your Lazarus IDE... if that feature is not already present...
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

pasquale

  • Sr. Member
  • ****
  • Posts: 267
    • Esposito Software
Re: Deploying your Mac app bundle in ZIP format
« Reply #5 on: April 02, 2012, 12:32:11 pm »
Does anybody know how to create a dmg file? Is there a tutorial somewhere?
Apple loves breaking backward compatibility to make money. If you want to be sure that your apps will never stop working, use Windows and trash macOS!

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Deploying your Mac app bundle in ZIP format
« Reply #6 on: April 02, 2012, 12:54:46 pm »
I'm sure Mr Google has many hits for you on that.

IIRC, you can create them with the Disk Image (or something) tool.

Below my notes on mount/unmounting .dmg from the command line:
#Mount .dmg image on OSX;mount dmg;OSX
hdiutil attach fpcup-0.1.dmg
cd /Volumes/fpcup
#do whatever

#unmount:
cd ~
#hdiutil detach fpcup-0.1.dmg

Perhaps hdiutil will also allow you to create .dmg files?
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

kamischi

  • Full Member
  • ***
  • Posts: 177
Re: Deploying your Mac app bundle in ZIP format
« Reply #7 on: April 02, 2012, 01:09:55 pm »
script snippet from the Makefile of heatwizard:


Code: [Select]
DISKIMAGESIZE = $(shell expr `stat -f "%z" Heat\ Wizard` / 300000)
macosx-dmg: Heat\ Wizard.app
hdiutil create -type SPARSE -size $(DISKIMAGESIZE)m -fs HFS+ -volname Heat\ Wizard -ov Heat\ Wizard.sparseimage
hdiutil attach Heat\ Wizard.sparseimage

cp -fR Heat\ Wizard.app /Volumes/Heat\ Wizard
rm -f Heat\ Wizard.app/Contents/MacOS/Heat\ Wizard

./CreateApplicationFolderAlias.sh

hdiutil detach /Volumes/Heat\ Wizard
rm -f  Heat\ Wizard.dmg
hdiutil convert Heat\ Wizard.sparseimage -format UDBZ -o Heat\ Wizard.dmg

rm -f Heat\ Wizard.sparseimage
fpc 2.6.4, lazarus 1.4.0, Mac OS X, fink

IndianaJones

  • Hero Member
  • *****
  • Posts: 509
Re: Deploying your Mac app bundle in ZIP format
« Reply #8 on: April 02, 2012, 02:17:38 pm »

You can use PackageMaker.app in Developer directory. It is Mac default tool to create dmg file or installable Mac applications.
The exact location is "/Developer/Applications/Utilities"

jwdietrich

  • Hero Member
  • *****
  • Posts: 1236
    • formatio reticularis
Re: Deploying your Mac app bundle in ZIP format
« Reply #9 on: April 02, 2012, 06:14:06 pm »
DMG is a perfect and professionally looking format, as felipemdc noted. In addition to the excellent tools suggested above you might also want to try dmgCreator, a free (GPL) application that is easy to use and has a lot of options. See http://dmgcreator.sourceforge.net for details.

However, Zip is also perfectly suited for distributing applications, although it looks a bit more "Windows like". Zip files may be created via context menu in Finder. An even better option is YemuZip, a free tool that has more configuration options. See http://www.yellowmug.com/yemuzip/, there is also a version in the Mac App Store, but the version on the website is for free.
function GetRandomNumber: integer; // xkcd.com
begin
  GetRandomNumber := 4; // chosen by fair dice roll. Guaranteed to be random.
end;

http://www.formatio-reticularis.de

Lazarus 3.4.0 | FPC 3.2.2 | PPC, Intel, ARM | macOS, Windows, Linux

pasquale

  • Sr. Member
  • ****
  • Posts: 267
    • Esposito Software
Re: Deploying your Mac app bundle in ZIP format
« Reply #10 on: April 02, 2012, 06:30:07 pm »
Thank you, everybody, for your help.

I noticed that, when creating a dmg file with the Mac Disk Utility, you are requested to specify the package size. Now, if I enter the uncompressed size of the bundle, the resulting file is enormous. On the contrary, zipping the bundle will reduce the size of the file to deploy at least by 50%. For this reason, I am tempted to stick with the "zip deployment mode", unprofessional as this may seem.

Talking about size, under Windows we can use the strip.exe application to remove the debug lines from the executable and this reduces the exe size significantly. Is there any tool like strip.exe for Mac?

Thanks again.
Apple loves breaking backward compatibility to make money. If you want to be sure that your apps will never stop working, use Windows and trash macOS!

IndianaJones

  • Hero Member
  • *****
  • Posts: 509
Re: Deploying your Mac app bundle in ZIP format
« Reply #11 on: April 02, 2012, 07:07:05 pm »

The same strip in Windows also exists in Mac, which is under /usr/bin/ directory.
But I am not sure if it comes with mac port or not. You have to install mac port first then try something like that.

Install Mac port first.

1. sudo port selfupdate
2. sudo port search <strip> // I dont know the exact package name
3. Then voulaaaa. You have a strip in Mac. :)
Thanks.


IndianaJones

  • Hero Member
  • *****
  • Posts: 509
Re: Deploying your Mac app bundle in ZIP format
« Reply #12 on: April 02, 2012, 07:11:30 pm »

Sorry my mistake,
here is the mac port web site.
http://www.macports.org/
Download port and install first. You can think like Debian/apt tool.
Thanks.

pasquale

  • Sr. Member
  • ****
  • Posts: 267
    • Esposito Software
Re: Deploying your Mac app bundle in ZIP format
« Reply #13 on: April 03, 2012, 07:36:01 am »

The same strip in Windows also exists in Mac, which is under /usr/bin/ directory.
But I am not sure if it comes with mac port or not. You have to install mac port first then try something like that.

Install Mac port first.

1. sudo port selfupdate
2. sudo port search <strip> // I dont know the exact package name
3. Then voulaaaa. You have a strip in Mac. :)
Thanks.

Thanks for your reply.

A search for "strip" produced no result on my iMac.

I'm using the latest version of Lazarus. Is the strip utility provided with Lazarus 0.9.30.4?
Apple loves breaking backward compatibility to make money. If you want to be sure that your apps will never stop working, use Windows and trash macOS!

kamischi

  • Full Member
  • ***
  • Posts: 177
Re: Deploying your Mac app bundle in ZIP format
« Reply #14 on: April 03, 2012, 08:32:09 am »
Two notes:

1) "strip" comes with the system. No need for MacPorts or fink.  You can simply invoke it from the commandline.

2) compressed disk images can be created with hdiutil. This line from my script above does the trick and makes the result a bit more Mac-like from a user's perspective:

hdiutil convert Heat\ Wizard.sparseimage -format UDBZ -o Heat\ Wizard.dmg

Replace 'Heat\ Wizard' with the name of your disk image.

All the best - MiSchi.
fpc 2.6.4, lazarus 1.4.0, Mac OS X, fink

 

TinyPortal © 2005-2018