Windows Installer using usb drive for temp purposes

14

3

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.

Douglas Anderson

Posted 2009-11-16T18:54:22.783

Reputation: 245

I don't know if there is a way to change it or not, but I'll tell you why this happens. It uses the drive which has more free space to output the temporary directory with the files and as you say, its name will be unique. – Xandy – 2009-11-16T19:26:23.297

2I believe you're on to something with the "using the largest available free space" edit. My experience is totally anecdotal, but I added a terabyte HDD to my Windows 7 box shortly after I installed the OS. The very next day it ran Windows updates. I hadn't put any files on the new drive yet and after the reboot I found a bunch of temp files stashed there. – TechParadox – 2009-11-16T19:58:27.363

Answers

14

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.

Andrew Flanagan

Posted 2009-11-16T18:54:22.783

Reputation: 1 680

I understand that if the ROOTDRIVE property is not set, the temporary files go to the disk with the hugest amount of free space. But the more interesting question is why are these temporary(!) files not automatically removed when the installation finished? – Erik – 2018-11-14T10:04:00.543

I bumped into similar situation. Not sure what the remedy is. – Vivek – 2012-07-21T22:46:45.400

I don't think so. My %TEMP% and %TMP% variables point to my C: drive and the installers often copy files to my R: drive. – Snark – 2009-11-16T19:20:59.250

TEMP and TMP are set to: C:\Users<me>\AppData\Local\Temp – Douglas Anderson – 2009-11-16T19:21:19.967

3

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.

needle

Posted 2009-11-16T18:54:22.783

Reputation: 31