Commit 3ef703ad authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

msi: Track temp files as soon as they are created.

parent 1767989b
...@@ -307,6 +307,7 @@ static UINT store_binary_to_temp(MSIPACKAGE *package, LPCWSTR source, ...@@ -307,6 +307,7 @@ static UINT store_binary_to_temp(MSIPACKAGE *package, LPCWSTR source,
TRACE("Unable to create file\n"); TRACE("Unable to create file\n");
return ERROR_FUNCTION_FAILED; return ERROR_FUNCTION_FAILED;
} }
track_tempfile(package, tmp_file, tmp_file);
/* write out the file */ /* write out the file */
file = CreateFileW(tmp_file, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, file = CreateFileW(tmp_file, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
...@@ -327,7 +328,6 @@ static UINT store_binary_to_temp(MSIPACKAGE *package, LPCWSTR source, ...@@ -327,7 +328,6 @@ static UINT store_binary_to_temp(MSIPACKAGE *package, LPCWSTR source,
{ {
ERR("Failed to get stream\n"); ERR("Failed to get stream\n");
CloseHandle(file); CloseHandle(file);
DeleteFileW(tmp_file);
break; break;
} }
WriteFile(file, buffer, sz, &write, NULL); WriteFile(file, buffer, sz, &write, NULL);
...@@ -549,11 +549,6 @@ static UINT HANDLE_CustomType1(MSIPACKAGE *package, LPCWSTR source, ...@@ -549,11 +549,6 @@ static UINT HANDLE_CustomType1(MSIPACKAGE *package, LPCWSTR source,
r = process_handle(package, type, ThreadHandle, NULL, action, &finished ); r = process_handle(package, type, ThreadHandle, NULL, action, &finished );
if (!finished)
track_tempfile(package, tmp_file, tmp_file);
else
DeleteFileW(tmp_file);
return r; return r;
} }
...@@ -612,11 +607,6 @@ static UINT HANDLE_CustomType2(MSIPACKAGE *package, LPCWSTR source, ...@@ -612,11 +607,6 @@ static UINT HANDLE_CustomType2(MSIPACKAGE *package, LPCWSTR source,
r = process_handle(package, type, info.hThread, info.hProcess, action, r = process_handle(package, type, info.hThread, info.hProcess, action,
&finished); &finished);
if (!finished)
track_tempfile(package, tmp_file, tmp_file);
else
DeleteFileW(tmp_file);
return r; return r;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment