static UINT HANDLE_CustomType34(MSIPACKAGE *package, LPCWSTR source,
LPCWSTR target, const INT type, LPCWSTR action)
{
- LPWSTR filename, deformated;
+ LPWSTR workingdir, filename;
STARTUPINFOW si;
PROCESS_INFORMATION info;
BOOL rc;
- memset(&si,0,sizeof(STARTUPINFOW));
+ memset(&si, 0, sizeof(STARTUPINFOW));
- filename = resolve_folder(package, source, FALSE, FALSE, TRUE, NULL);
+ workingdir = resolve_folder(package, source, FALSE, FALSE, TRUE, NULL);
- if (!filename)
+ if (!workingdir)
return ERROR_FUNCTION_FAILED;
- SetCurrentDirectoryW(filename);
- msi_free(filename);
+ deformat_string(package, target, &filename);
- deformat_string(package,target,&deformated);
-
- if (!deformated)
+ if (!filename)
+ {
+ msi_free(workingdir);
return ERROR_FUNCTION_FAILED;
+ }
- TRACE("executing exe %s\n", debugstr_w(deformated));
+ TRACE("executing exe %s with working directory %s\n",
+ debugstr_w(filename), debugstr_w(workingdir));
- rc = CreateProcessW(NULL, deformated, NULL, NULL, FALSE, 0, NULL,
- c_collen, &si, &info);
+ rc = CreateProcessW(NULL, filename, NULL, NULL, FALSE, 0, NULL,
+ workingdir, &si, &info);
if ( !rc )
{
- ERR("Unable to execute command %s\n", debugstr_w(deformated));
- msi_free(deformated);
+ ERR("Unable to execute command %s with working directory %s\n",
+ debugstr_w(filename), debugstr_w(workingdir));
+ msi_free(filename);
+ msi_free(workingdir);
return ERROR_SUCCESS;
}
- msi_free(deformated);
+
+ msi_free(filename);
+ msi_free(workingdir);
+
CloseHandle( info.hThread );
return wait_process_handle(package, type, info.hProcess, action);