On Oct 31, 2010, at 12:08, eveningnick eveningnick wrote: > Perhaps you should take a different approach, and do what many apps do: distribute it as a drag-and-droppable .app bundle, and the first time a particular user runs your app, install your LaunchAgent.
> Since you're only installing stuff into the running user's home folder, you don't need root permissions or anything like that.
>
> What you're trying to do will not work properly if there is more than one user account on the system that wants to use your app, whereas installer per-user when the user runs your app should work for multi-user configurations.
I am sorry, i have posted this message privately (wrong button). I'm reposting it to the mailing list to make it available for everyone
Hi Dave The problem with my app is that it needs to install some other files,
except that plist. Installer, besides creating .plist, copies some "template" documents to the user folder (more specifically, to /Users/<username>/Library/Application Support/MyAppName/...) and
provides uninstaller as well (an Applescript bundle).
Once again, you're fine as long as the user who installed it is the ONLY user using it on the system. What happens when another user on the system wants to use it? Or when you have a user who's using network home directories? Unless we're talking about hundreds of megs of content (like Office), there's very little reason you can't include these "Template files" in your app's bundle, then allow the user to add more at their own discretion (via your application or manually), and have that "extra" content stored in their home directory. You should also properly obey the domain's of OS X (User, Machine, Network, System) and read content from the Machine's stores (/Library) in the event the machine is administrated by a central body and wants to put files in a central location as well. I want to create installer, because the presence of an installer is a sign for a user that application "does something more that just runs when the bundle is double clicked". And if i provide only an
application bundle, the user will feel tempted to just move it to trash when he doesn't need my application.
Which is how OS X software should behave. Don't break the guidelines just because you want to bring a little Windows to the Mac. This plist file, that is supposed to launch my app everytime the system starts, will cause problems (because, user had qlreqdy moved
bundle to trash, Launchd can't find app's executable - it'll pop up that annoying message every 10 seconds). These template documents, that i install to /Users/<Username>/Library/Application Support/MyAppName... will take
some of the disc space like a garbage that otherwise would have been cleaned by uninstaller, etc
Or you could just put everything in your app's bundle and it'll all get cleaned up nicely when the user's delete's the bundle. And you really need to re-evaluate your LaunchAgent if you have it built in such a way that it prompts every few seconds. I just want to make it obvious and intuitive for a user, that he should uninstall the app the same way he installed it - using an
installer or uninstaller.
That's why i need an Installer (just like Microsoft Office does). I am aware of that it is not recommended to install a decent application in
any other way than copying a bundle.
Office is a complicated program that is installing several hundred megs of files, not to mention multiple applications. It sounds like you need to go back and re-think how you have your app structured, rather than trying to burden your users with some kind of messy installer/uninstaller. Unless you're installing kernel extensions (drivers), plugins, multiple applications, or severely complicated applications (AutoCAD, Office, etc), you shouldn't need an installer.
I am considering also a possibility to install all the files not to user home directory, but to /Library/Application Support/MyApp... and /Library/Launch Agents/MyApp/... , but: my application needs to manage
that plist file (it should be possible for it to create that file, modify it or delete it). Unfortunately, the system doesn't let me to do that - an application doesn't have enough of privileges. Maybe if i
solved this problem, i wouldnt have needed that $user variable from a script. Although i have no idea how to modify a file in /Library/LaunchAgents/... from an "ordinary user" application. Can it be done somehow?
Thank again, George
Lets see: A) You're trying to install an application that runs constantly for a user. B) you want to do this in such a way that it can be done without admin priviledges on a machine. C) you're trying to dump extra content outside the app bundle into the user's profile. As a SysAdmin, you just became one of the developers I dislike. The user either has Admin privs, or they don't. If they don't, they probably don't have any business installing said software anyway. Regardless, your app should launch and ASK the user if they want to start it all the time, at which point you build and place your plist in ~/Library/LaunchAgents. Your installer shouldn't be doing this. Build the smarts into the program and you'll save yourself a lot of support headache down the road. |