Control Your Program Files With Symlinks
Commenter Liam brought up the problem of some primitive installers that don’t let you choose where you want to install your programs. I assume space is the issue. You’ve got two hard drives, your C: is getting full, and the installer won’t let you choose – what then?
Expanding the issue a bit, what happens if you just have too much stuff to keep on your machine? I have a notebook with a 120GB hard drive. These days that’s not a whole lot of space. Games are in the multi-gig range now. But do you really want to uninstall/reinstall a game every time you need space, or every time you want to play? If you have a USB drive, do you want to shuffle files back and forth every time?
Enter the Symlink
The answer to both problems is symbolic links. These are very familiar to unix users of course, and is the reason that Standard C’s “delete a file” function is called unlink(). NTFS has supported this for a long time, but Microsoft hasn’t provided any consumer level tools to use symlinks. I read somewhere that they were concerned about users being confused about drive space. Like if they deleted a symlink with a ton of files “in it” and didn’t see any drive space freed, they would freak out.
In Vista Microsoft has finally started using symlinks in consumer-visible areas. From what I can tell they’re using it for backwards compatibility stuff. If you go to the Win95-ish “c:/users/default/my documents” it will work because there’s a symlink pointing it at the Vista-ish “c:/users/default/documents”.
Sysinternals (now part of MS) provides a tool to create/delete symlinks called junction. Vista comes with “mklink” but the Sysinternals tool works on all NTFS-capable Windows OS’s, like XP.
Fixing Lame Installers
Installer won’t let you choose where to install something? No problem.
Just let it install wherever. Then move the folder to a new drive. Then use junction to create a link in the old folder location to the new one.
For example:
junction "C:\Program Files\Cool Program" "D:\Bin\Cool Program"
The app thinks it’s sitting on your C drive but it’s not!
Managing Limited Space
So what about my notebook with a small 120GB SSD? I use junction points to move lesser-used apps to a USB drive.
I install everything to my C drive. When I’m getting low on space, I’ll pick big apps that I don’t use too often, or only use in certain scenarios. For example FPS games. I don’t play these very often, and when I do I have to be rooted anyway: plugged into AC power and using a corded mouse. That means I won’t mind pulling out a USB drive too. Those games tend to be pretty gigantic so it’s a big win. I’ll move those over to my USB drive and symlink the old folders to the external drive.
As a side benefit, I can share the storage across machines. So if I’m playing games on my home workstation I can just plug the USB drive into that thing instead. Same deal.
If it’s a game I play really rarely, I’ll move it off the external drive to the NAS, and only move it back on the occasion I want to play it. But in Windows I don’t have to worry about uninstalling/reinstalling, finding CD/DVD’s, and so on (I crack every PC game I buy so I don’t have to worry about dealing with discs).
Problem solved.
Incidentally, I don’t know why I’m talking about PC games so much. I almost never play them. The PSP gets all my love: it’s the ultimate hard core gaming device you can play casually! Brilliant design, and it’s been outselling the PS3 nicely (yuk yuk). On my stupid PC’s I spend more time screwing around with video drivers and graphics settings than playing games.


Thanks Scott I never thought of using semlinks until you mentioned it in the last post. You are correct the problem is to do with disk space but the real problem is that the hard drive needs reformatting and repartitioning which I am trying to put off. It just takes so long and is laborious to install all the programmes.
Liam
15 Feb 09 at 4:34 am
I did this on my machine, but beware. Twice in the last week my symlink has dissapeared, resulting in all sorts of broken software.
Peter Bajurny
22 Sep 09 at 9:24 pm
I have yet to run into this problem *except* for when I upgraded Vista to Win7 RC. The upgrade destroyed all of my junction points (I hadn’t been using true symlinks at the time, though this is what I use now). It simply deleted them and I had to recreate them all. But they haven’t gone away since.
I doubt that a low level OS feature such as this has such a major bug. You may consider looking into other problems with your setup. Can’t imagine what it could be, but I would doubt the OS last among other possibilities.
Scott
22 Sep 09 at 11:07 pm