[Qt-interest] how to copy any app bundle on MacOS from one location to the other using QT methods?

Oliver.Knoll at comit.ch Oliver.Knoll at comit.ch
Tue May 18 14:54:47 CEST 2010


Serge wrote on Tuesday, May 18, 2010 1:44 PM:

> Hello,
> 
> my QT program needs to copy another application bundle from one
> location to the other on Mac OS and launch it?

An application bundle under Mac OS X is nothing more than a directory ending with ".app" extension (http://en.wikipedia.org/wiki/Application_Bundle), containing sub-directories (the binaries, resources etc.) of well-known names, so basically a "cp -r" ("recursive copy") should do it, as far as the copying is concerned.

According to the Wiki page the class CFBundle in the Mac "Core Foundation" API is used to manipulate app bundles, if you don't mind messing around with the Mac API. Or maybe setting the working directory into the "app bundle" directory and calling the executable therein with QProcess does the job as well (not sure about how the resources/shared libraries etc. are then resolved though).

Cheers, Oliver
-- 
Oliver Knoll
Dipl. Informatik-Ing. ETH
COMIT AG - ++41 79 520 95 22



More information about the Qt-interest-old mailing list