Moving your Windows Installer Directory

27 Feb

Moving your Windows Installer Directory

http://blog.ray1.net/2009/04/moving-your-windows-installer-directory.html

I mostly work with Virtual Machines and I like to pre-allocating the disk size. When I created my VM I figured 10GB would be enough for C:\ with Win2003 Server and a couple of SDK’s and if I needed more I could always add another drive. I was wrong.

After 2 years my faithful Win2003 dev VM is out of space on C: and I can’t shuffle any more files around.

My C:\windows\installer directory is >2GB so this is my prime candidate to move. Luckily there are always solutions to problems… no I’m not going to delete the directory, or change my registry to point to a new location.
I’m going to add a symbolic link from C:\windows\installer to F:\installer.

  1. Download Junction from http://technet.microsoft.com/en-us/sysinternals/bb896768.aspx
  2. Copy OR move C:\windows\installer to F:\installer
  3. Delete all the files in C:\windows\installer
  4. Close all your Explorer windows
  5. Run > cmd> C:\junction C:\WINDOWS\Installer F:\installer

That should do it. I wrote a batch (run.bat) script to do the whole procedure.

@set src=C:\WINDOWS\Installer
@set trg=F:\Installer
::copy %src%\* %trg%
::detele %src%\*
move /y %src%\* %trg%
junction %src% %trg%
pause

This should work for most directories. The batch file should be in the same directory as junction.exe.

Posted by rayone at 12:26 PM