wineprefixcreate: Make sure the path returned by GetTempPath() during the $WINEPREFIX creation will be writable.

Francois Gouget fgouget at
Wed Sep 12 16:40:42 CDT 2007


mshtml.dll (and probably many others) use GetTempPath() during the 
self-registration process. But at that point the Windows environment 
variables, and in particular $TMP and $TEMP, have not been set yet, 
especially not in the currently running process. So when mshtml.dll 
calls GetTempPath(), that function returns the current directory, which 
obviously is no good if that directory is not writable (like '/' for 
instance). So this patch makes 'c:\windows\temp' the current directory, 
which we know will be writable (and the chdir() should have no other 
side effect in this script).

 tools/ |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/tools/ b/tools/
index fb60140..73cb8d0 100644
--- a/tools/
+++ b/tools/
@@ -170,6 +170,10 @@ done
 cp "$datadir/wine.inf" "$CROOT/windows/inf/wine.inf"
+# Make sure GetTempPath() will return a writable directory
+cd "$CROOT/windows/temp"
 "${WINELOADER:-$bindir/wine}" rundll32.exe setupapi.dll,InstallHinfSection DefaultInstall 128 wine.inf
 # Wait for the wineserver to finish

More information about the wine-patches mailing list