AVG Link Scanner removal problem

I have at least two failings… that I know of! First is that I like trying new software on the Mac. Second is that I’m a little bit OCD about everything on the Mac working as it should. Actually those two shortcomings of mine probably don’t sit happily together because trying out software inevitably means you end up uninstalling stuff a lot of the time and that’s where problems can easily start under OS X.

Ok I don’t know what possessed me (and you can reprimand me in the comments below for being such a wuss) but I decided to try out AVG Link Scanner for the Mac, just to see if it was any good. Ok I know that viruses for the Mac are a rare item, but the threat from malicious web sites is a bit more real and I figured… well a little bit of extra protection couldn’t hurt surely? So I installed AVG Link Scanner thinking it would happily warn me if ever I accidentally clicked on a link that would take me to somewhere that would steal my Mac’s soul! After a few weeks trying it out, I decided that it wasn’t for me and set about removing it. At this point I would normally turn to my trusty CleanApp, but seeing as AVG Link Scanner comes with an uninstaller I decided to use that instead. I always prefer to use the developers own uninstall routine if there’s one available as I figure they will know all the ins and outs of what needs to be removed. So I ran it, gave it the password it asked for and it happily told me that it had uninstalled the product successfully. End of story… or so I thought.

Next time I had occasion o reboot my Mac (to get rid of a stubborn “Firefox is already open, please close Firefox” problem, when Firefox wasn’t even running), I spotted that the AVG Link Scanner cleanup hadn’t done it’s job. There sitting in my console messages were four lines that read:

18/11/2010 06:12:34    com.apple.launchctl.Background[275]    launchctl: Couldn’t stat(“/Library/LaunchAgents/com.avg.LinkScannerAgent.plist”): No such file or directory

18/11/2010 06:12:34    com.apple.launchctl.Background[275]    launchctl: Couldn’t stat(“/Library/LaunchAgents/com.avg.LoaderAgent.plist”): No such file or directory

18/11/2010 06:12:34    com.apple.launchctl.Aqua[276]    launchctl: Couldn’t stat(“/Library/LaunchAgents/com.avg.LinkScannerAgent.plist”): No such file or directory

18/11/2010 06:12:34    com.apple.launchctl.Aqua[276]    launchctl: Couldn’t stat(“/Library/LaunchAgents/com.avg.LoaderAgent.plist”): No such file or directory

Obviously on bootup my Mac was attempting to launch components of AVG Link Scanner that were no longer present, so why hadn’t the uninstall routine cleaned up properly and prevented this from happening? First thing was to launch Lingon and check that there were no launchd entries anywhere that might be triggering AVG. Kinda unrelated in a way, but I felt it best to check. Everything looked fine, there was nothing relating to AVG in the launchd entries anywhere. Next it was off to check my ~\Library\LaunchAgents folder just to check nothing was amiss – all looked just fine, there were no AVG plist files as I’d expected. Ok, so now I figure the problem is that launchctl has a list somewhere of the agents it thinks it needs to start on bootup, and that list hasn’t been updated to say that AVG has been uninstalled. But where to find that list, and when (if) I do – how to edit it to remove the duff entries for AVG Link Scanner?

Well typing the error messages above and/or various keywords into Google proved a bit fruitless. Most of the hits related to cases where the thing that launchctl was trying to load did actually exist, whereas in my case they don’t.

Now this is where I have to disappoint my readers (reader?) because as yet I haven’t found the solution. Perhaps I’ll give Apple a call today and see if they can shed some light on it but I suspect a question like “Where does launchctl find it’s list of what to load and how can I edit it?!” will be met with either a deathly silence or something along the lines of “Apple does not support this sort of action”. If that’s the case then I’ll probably email AVG and see if they can’t shed some light on it – in fact I’ll do that now anyway. Sure I know it’s not ‘hurting’ my Mac because it still boots just fine and the above messages are really just a warning that something’s out of line, but I’d like to get to the bottom of it all the same and when I do I shall add the results below.

What it does go to show though is that uninstalling software from your Mac isn’t always as straight forward as it seems, even if the app comes with it’s own uninstaller!

Automatically mount a TrueCrypt volume at Login (Mac OS X tip)

Everyone these days is banging on at us about taking more care of our personal data, but we’re a lazy bunch you & me and like every other bit of advice we get, we tend to push it to the back of our minds unless it’s easy to follow. Securing your personal data is all very well, but quite frankly it can be a pain in the butt if every time you login to your Mac you have to launch a program and navigate through various options to get something done.

I’m just as guilty and having installed TrueCrypt on the Mac some months ago, I’d barely given it a second thought until I had to get it to automatically mount a volume on my Windows XP work laptop the other day. In Windows it’s a relatively straightforward taks to get TrueCrypt to run at startup and then automatically mount your ‘favourite’ volumes. Doing the same under Mac OS X took a little more effort! Yes Mac OS X can automatically mount network volumes if you simply drag the relevant icon into your User Account/Login items, but sadly this doesn’t seem to work for TrueCrypt volumes, so here we go…

For the purposes of this exercise I use the excellent Lingon utility to create an agent that runs when I login, but it should be just as easy to do this using a script, or even an Automator Action – the syntax of the actual command line will be the same.

Lingon details

Lingon details

Assuming you have already installed TrueCrypt in your Applications folder, create the volume you want mounted at login if you haven’t already done so. In my case I created a folder called Document_Store in the root of my ‘user’ folder, and then created a 2Gb TrueCrypt file called ‘docvault‘ inside it.  What you now need to do is work out the full pathname of your TrueCrypt file – in my case it’s:


…where ‘macbitz’ is my user name, Document_Store is the name of the folder I created to hold my TrueCrypt files, and docvault being the name of the file I want to automatically mount.

Now fire up Lignon and click on the + button to create a new agent and choose User Agents from the list. First thing to do is to give your agent a name – in my case I called it ‘com.truecrypt.mount_docvault’ but you can call it whatever makes sense to you. Next step is to tell Lingon what application to run by using the ‘Choose’ button and navigating to where you installed the TrueCrypt application. Once you’ve done this, you should see some text in the ‘What’ box that looks something like:


…that’s Lingon telling your Mac what application to run. The next thing you need to do is add the parameters that tell TrueCrypt what it’s supposed to do. In our case we want TrueCrypt to mount a file called ‘docvault’ and to put it somewhere where it’s easily accessible, like a volume on the desktop, so we add the following text into the Lingon ‘What’ window after the TrueCrypt stuff

--mount /Users/macbitz/Document_Store/docvault /Volumes/VAULT

Once you’ve done that you’ll have a long command line that looks like this:

--mount /Users/macbitz/Document_Store/docvault /Volumes/VAULT
Custom icon

Custom icon

One last thing is to tell Lingon when it should run your command. Do this by ticking the box that says – Run it when it is loaded by the system (at startup or login). Now if you’ve done this correctly then the next time you login to your Mac, TrueCrypt will load, and then prompt you for the password to access the encrypted file before mounting it in the location specified. In my example I asked TrueCrypt to mount the file as a volume called ‘VAULT’ which then appears on my desktop (as per my Finder preferences). With a little bit of imagination you can even create a custom icon for your encrypted volume (see left) which Finder kindly remembers. If you want to auto-mount your TrueCrypt volume using a script then just put the TrueCrypt command line and it’s parameters into a compiled script that you run as a login item.

Nicest of all, TrueCrypt is free so now you’ve got no excuse for not locking up your super-secret data away from prying eyes! Having said that, the authors of both TrueCrypt and Lingon are happy to accept donations.