wixtoolset / issues

WiX Toolset Issues Tracker
http://wixtoolset.org/
129 stars 36 forks source link

Not possible to configure all tempfile locations #2414

Open wixbot opened 14 years ago

wixbot commented 14 years ago

When using WIX to create large MSI's, it would be convenient to redirect the storing of temp files created by WIX to some other storage media. As I understand, this is done by setting WIX_TEMP environment variable.

And yes, it does redirect some of the temp files, but not ALL. Some still end up in C:\Documents and Settings\Local Settings\Temp.

What light does:

1) Create directory called something like xvnt3tm8. This directory contains a directory called cab_0_WixUIExtension and a file called cab_0_WixUIExtension.cab. The location of this dierctory can be configured with WIX_TEMP.

2) Create temp file(s), called something like 00000003.1188 in C:\Documents and Settings\Local Settings\Temp. These files are the CAB files, I think, so they can be up to 2 GB each.

3) Copy temp files (e.g. 00000003.1188) from C:\Documents and Settings\Local Settings\Temp to xvnt3tm8.

4) Remove 00000003.1188 from C:\Documents and Settings\Local Settings\Temp

Here is the problem (bug): WIX stores the temp file 00000003.1188 in C:\Documents and Settings\Local Settings\Temp instead of location in WIX_TEMP? I've also tried setting the -cc option in light

I would like to store it elsewhere, as there is more space on other disks.

To summarize: It is possible to use envoronment variable WIX_TEMP, to set where some temp files end up. The problem is the CAB-temp-files.

Originally opened by mattihagerlund from http://sourceforge.net/p/wix/bugs/1884/

wixbot commented 10 years ago

Originally changed by barnson Area changed from light to ` Releasechanged fromfuturetov3.x`

wixbot commented 10 years ago

Originally changed by bmurri AssignedTo set to wixsupport

philippeqc commented 7 months ago

Hi,

Should anyone find themself in this situation, here is my work around. The TL;DR is that you need to set both environment variables WIX_TEMP and TMP. Setting TEMP doesn't impact the process.

I've wrapped the call to Wix with the following in powershell:

# Store current temporary directory location
$previousTmpDir = $env:tmp

# Create a local temporary directory
$name = [System.Guid]::NewGuid()
$localTmpDir = Join-Path (pwd) $name
New-Item -ItemType Directory -Path $localTmpDir

# Set relevant variables to local temporary directory
$env:WIX_TEMP=$localTmpDir
[Environment]::SetEnvironmentVariable('tmp', $localTmpDir, 'User')

# Call Wix
msbuild ./Installer/GamePackageInstaller.sln  /p:Configuration=Release

# Restore $env:tmp
[Environment]::SetEnvironmentVariable('tmp', $previousTmpDir, 'User')

# Remove local temporary directory
Remove-Item $localTmpDir

This code has been modified as not to expose any of my specifics, so I appologize for the introduction of errors. Hopefully, it will be of value for someone else.