Dumb OSX App install question

Probably a dumb question. When my application is first run after the user installs it into the Applications folder (using a DMG), it looks for some files in its Application Support folder, and if it doesn’t see them, it creates and copies the necessary folders and files which it gets from the Resources folder and puts them into the proper locations. And it all works fine. But what happens if the user wants to remove the application and move it to the trash? The application is removed from the Applications folder, but doesn’t it leave all those secondary files and folders behind?

I know how this works with Windows installers, in the Uninstall script you can list all the folders and files you want to specifically cleanup at Uninstall time. But on the Mac this is not clear to me how this happens. Or is this something only an Installer can handle?

[quote=116994:@Merv Pate]Probably a dumb question. When my application is first run after the user installs it into the Applications folder (using a DMG), it looks for some files in its Application Support folder, and if it doesn’t see them, it creates and copies the necessary folders and files which it gets from the Resources folder and puts them into the proper locations. And it all works fine. But what happens if the user wants to remove the application and move it to the trash? The application is removed from the Applications folder, but doesn’t it leave all those secondary files and folders behind?

I know how this works with Windows installers, in the Uninstall script you can list all the folders and files you want to specifically cleanup at Uninstall time. But on the Mac this is not clear to me how this happens. Or is this something only an Installer can handle?[/quote]

You are right, simply dumping the app will not clean the AppSupport folder. Most applications leave things there. Unless they take a lot of room or need to be remove for confidential reasons, it should not be too much of an issue, since the user has no acces to that folder anyway.

You may provide a clean uninstall in your DMG, which will delete the data in AppSupport, and then delete the program from Applications. That is what some publishers do. But as a lot of users never read the manual, they may still dump the app in the trash and forget about it :wink:

Thanks for the reply, Michel. I’ll take a look at the DNG builder again and see if there is something I can add that will make the cleanup easier. Thanks again for the response.

An uninstaller program in this instance would just need to locate the files and erase them. It is pretty easy to code. Then you add it in the DMG under the traditional couple app and Applications shortcut. But if you ask me, I frankly would not worry about cleaning the files installed in the AppSupport folder after the user has trashed the app. Most publishers could not care less.

OK, I’ll think about that and maybe not take it into account.

Well it depends on what you’re storing there.

If you’re storing a few settings or small items nobody’s going to mind that they’re abandoned.
If you store massive amounts of data (like game patches) and your app support folder is upwards of 800mb, somebody’s going to notice and be a little upset (not much, it’s not at all difficult to remove)

tl;dr - a data remover is nice if you store large amounts of data in app support, but it’s not expected.

usually under 1 MB, just preferences and a couple of small DB files.

I wouldn’t bother with such a small amount :slight_smile:

Right, that’s what I was thinking, thanks for the reply. I was a little curious about what Michele said earlier:

“Unless they take a lot of room or need to be remove for confidential reasons, it should not be too much of an issue, since the user has no acces to that folder anyway.”

Can’t they just go in there and delete those folders in the App Support folder easily? Seems like it is easy to do.

[quote=117179:@Merv Pate]Right, that’s what I was thinking, thanks for the reply. I was a little curious about what Michele said earlier:

“Unless they take a lot of room or need to be remove for confidential reasons, it should not be too much of an issue, since the user has no acces to that folder anyway.”

Can’t they just go in there and delete those folders in the App Support folder easily? Seems like it is easy to do.[/quote]

Yes they can. If only they know where to look. Most basic users simply have no idea where that folder is. And it’s allright. Mac is supposed to be simple to use :wink:

Besides, deleting things in AppSupport could damage some apps which depend on their defaults and data stored there.

OK, thanks. I’ll leave things as they are unless I hear complaints.

In 12 years of selling Mac apps on my site, I never had a customer request assistance about uninstalling an app on Mac. On PC, yes, but not on Mac.

I know some apps like Steam auto-run a script when the app is moved to the trash and ask the user if they want to remove the extra stuff. Not sure how it’s done though.

I personally don’t like it when an app leaves stuff behind when I delete the app (unless I am deleting it because of an issue updating it). When I delete an app on my Mac, I check the Application Support folder and remove the excess data the app created.

I’ve been a Mac user for more than half of my life.

Apparently, Steam is also a download manager. Such applications often have a module that runs as sa service in the background. You can probably see it by typing ps aux in the terminal and search for “steam”. Adobe updater works that way. So such a program can check at regular intervals if the app file is still in the Applications folder, and if it has disappeared, prompt the user for a cleanup.

Personally, I do not appreciate publishers who install background updaters without asking permission. I especially hate Adobe Updater, which not only installs covertly, but has many cached copies hidden in my file system which reinstall its pesky self in case it gets deleted. So essentially I have no way to get rid of it. I find that way more offensive than a few files left in App Support.

Looks like Steam doesn’t do that anymore. I agree that I don’t like apps that have background processes for no reason. For some reason, when there is an update for an Adobe product, I most of the time have to manually run the updater, even though I set updates to install automatically. My main issue is when apps leave hundreds of MBs - GBs of data in the App Support folder when you remove the app.

I also hate apps that auto-install themselves to run at startup without asking me, like Steam.

I do like it when an app has an option in the app itself to uninstall itself fully.

In my opinion, an app should remove the extra stuff it creates when you want to trash it.

[quote=118175:@Charles Fasano]I do like it when an app has an option in the app itself to uninstall itself fully.
In my opinion, an app should remove the extra stuff it creates when you want to trash it.
[/quote]

Indeed, providing in the app itself a way for it to delete all files it created is a courteous gesture towards the user.

There have always been a bunch of files that don’t get deleted when moving the app to the trash, such as preferences, cache files and so on.

A lot of people now use a cleaning app to clean up these files. xTrash was written in Xojo. They dig in and related files.

Another addition:

when the application crash, a crash file is generated.

But this is not the only file added to the host hard disk. More exists.

In my project, I always add a MenuItem that is able to delete the files I (I mean I) add (Preferences, Application Support…). Of course, I cannot delete files added by someone else (Apple, Xojo, who knows… who can also add files ?).