Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
    
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 Nov 16 '09 at 19:26
1  
I 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 Nov 16 '09 at 19:58
add comment

2 Answers

up vote 9 down vote accepted

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.

share|improve this answer
    
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 Nov 16 '09 at 19:20
    
TEMP and TMP are set to: C:\Users\<me>\AppData\Local\Temp –  Douglas Anderson Nov 16 '09 at 19:21
    
I bumped into similar situation. Not sure what the remedy is. –  Vivek Jul 21 '12 at 22:46
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.