Windows Installer using usb drive for temp purposes
When installing apps that are built around Windows Installer, it would appear that it often uses my external usb hard disk (when it's connected) as the temp location while it expands and installs the application (creates a folder off the root with a guid name). Is there anyway to change this so it always defaults to a specific drive?
This appears to be the case on Windows Vista and 7, not sure about previous releases.
EDIT: Current environment variables look like this:
TEMP=C:\Users\<me>\AppData\Local\Temp
TMP=C:\Users\<me>\AppData\Local\Temp
EDIT: I have a funny suspicion that it's using the drive with the largest available free space.
Solution 1:
I believe that the Windows Installer uses the %TMP%
environment variable. You may want to check this value and see if it happens to be pointing to your External HD drive letter.
UPDATE
Weird... this does seem to be a "feature" of Windows Installer (to use the drive with the most free space). I can't find an option to disable it. I wonder if you can lock the system out by permissions/read-only flag or something similar. It bugs me that Microsoft wouldn't give you an option to turn this off.
2nd UPDATE
Ok -- so I found this article about the ROOTDRIVE property. Of particular note:
If ROOTDRIVE is not set at a command line or authored into the Property table, the installer sets this property. During an administrative installation the installer sets ROOTDRIVE to the first connected network drive it finds that can be written to. If it is not an administrative installation, or if the installer can find no network drives, the installer sets ROOTDRIVE to the local drive that can be written to having the most free space.
Solution 2:
I had this problem with an external HDD that was used exclusively for personal photos and home video. I disabled 'delete' permissions for all users to prevent any data being lost. However, the drive began to fill up with MSI tmp files. Any automated removal was refused as was any cleaning tool because (as I mentioned) I had refused delete permissions. My solution was to turn off all permissions on the target drive for all users (with the exception of 'write' priviliges for one user), preventing the OS from writing to the drive in the first place. Hope this helps.