[Qt-interest] mac app store - file locations
Oliver.Knoll at comit.ch
Oliver.Knoll at comit.ch
Tue Jan 11 11:25:29 CET 2011
On 2011-01-11 Peter Peter Lee wrote:
> Hello,
>
> Have been following the prior thread and it's brought up a related
> question - according to the guidelines it seems that an application
> can't write to /Library/Application Support/<company> if it's on the
> appstore? Can anybody confirm that? Is this so that the app doesn't need increase privileges to install?
2.27: "Apps that request escalation to root privileges or use setuid attributes will be rejected"
[http://www.readwriteweb.com/archives/apples_guidelines_revealed_apps_you_cant_sell_in_the_mac_app_storep2.php]
(But note that these are "leaked" rules, so they might be outdated)
So assuming 2.27 still holds, you can only write to (certain) directories within ~, e.g. ~/Library/Preferences/..., taking into account the proper naming conventions as well (e.g. ~/Library/Preferences/com.trolltech.plist seems to violate these naming conventions, most likely due to different domain than the application specifies, but not 100% sure).
> Does anybody know if an application can request admin privileges when
> running
According to 2.27: no.
> If not how can applications share
> data between users transparently and without the user having to 'Save' a database etc somewhere?
Since the idea of an "uninstaller" on a Mac is quite revolutionary (and practically non-existent, unless your application provides your own "clean-up" shell script or so - and Mac users go crazy if you mention the word "uninstaller" anyway ;) the idea of the app store is that when a user removes your application by dragging it from the Application folder to the trashcan simply the *.app folder within /Applications is deleted. In other words: all configuration files (and cached data etc.) will remain in the user's home directory.
Since these are - usually - only a few Kbytes that is not so bad. But if your app would install huge data anywhere in the system (just like Apple's own iDVD does with all its "DVD templates" which take up several Mbytes or even GBytes (1); and that is the point when Mac users usually get quiet when confronted with the need of an uninstaller concept - but that just as a side node ;) the App store concept would not work so well if applications started to install dozens of (possibly large) files anywhere in the system, e.g. /Library/Application Support, due to lack of an uninstall concept.
I guess that is the reason why Apple is quite restrictive with App Store applications. Otherwise Mac users seem to be quite happy with googling for "uninstall application XY" and follow the procedures given there ;) Or most likely they just ignore the fact that their OS "collects" more and more config files ("But hey, at least we don't have a registry like Windows!" ;).
But as for your actual question: I think for now App Store application are meant to be "simple" and "single user". Or you share data via web sites (just mark your application as "cloud compatible", hehe), shared memory, sockets, ... (http://doc.qt.nokia.com/latest /ipc-sharedmemory.html)
(1) "Application support files can take up anywhere from a few kilobytes to several gigabytes of space, depending on the application installed. Examples of applications that have large support files are multimedia programs such as Garageband and DVD Studio Pro. They are located in the Application Support folder within your user's Library folder, or in "/Library/Application Support/" [http://guides.macrumors.com/Uninstalling_Applications_in_Mac_OS_X]
Cheers,
Oliver
--
Oliver Knoll
Dipl. Informatik-Ing. ETH
COMIT AG - ++41 79 520 95 22
More information about the Qt-interest-old
mailing list