return ERROR_SUCCESS;
}
-static DWORD WINAPI ACTION_CallDllFunction( const GUID *guid )
+static DWORD ACTION_CallDllFunction( const GUID *guid )
{
MsiCustomActionEntryPoint fn;
MSIHANDLE hPackage, handle;
hModule = LoadLibraryW( dll );
if (!hModule)
{
- ERR("failed to load dll %s\n", debugstr_w( dll ) );
+ ERR("failed to load dll %s (%u)\n", debugstr_w( dll ), GetLastError() );
return r;
}
TRACE("calling %s\n", debugstr_w( function ) );
handle_msi_break( function );
- CoInitialize(NULL);
-
__TRY
{
r = fn( hPackage );
}
__ENDTRY;
- CoUninitialize();
-
MsiCloseHandle( hPackage );
}
else
return rc;
}
-static DWORD WINAPI ACTION_CAInstallPackage(const GUID *guid)
+static DWORD ACTION_CAInstallPackage(const GUID *guid)
{
msi_custom_action_info *info;
UINT r = ERROR_FUNCTION_FAILED;
msi_custom_action_info *info;
WCHAR package_path[MAX_PATH];
DWORD size;
+ UINT r;
static const WCHAR backslash[] = {'\\',0};
info = do_msidbCAConcurrentInstall(package, type, package_path, target, action);
- return wait_thread_handle(info);
+ r = wait_thread_handle(info);
+ release_custom_action_data( info );
+ return r;
}
static UINT HANDLE_CustomType1(MSIPACKAGE *package, LPCWSTR source,
info = do_msidbCustomActionTypeDll( package, type, tmp_file, target, action );
- return wait_thread_handle( info );
+ r = wait_thread_handle( info );
+ release_custom_action_data( info );
+ return r;
}
static UINT HANDLE_CustomType2(MSIPACKAGE *package, LPCWSTR source,
{
msi_custom_action_info *info;
MSIFILE *file;
+ UINT r;
TRACE("%s %s\n", debugstr_w(source), debugstr_w(target));
info = do_msidbCustomActionTypeDll( package, type, file->TargetPath, target, action );
- return wait_thread_handle( info );
+ r = wait_thread_handle( info );
+ release_custom_action_data( info );
+ return r;
}
static UINT HANDLE_CustomType18(MSIPACKAGE *package, LPCWSTR source,
if( row )
{
LPCWSTR error = MSI_RecordGetString( row, 1 );
- MessageBoxW( NULL, error, NULL, MB_OK );
+ if ((gUILevel & INSTALLUILEVEL_MASK) != INSTALLUILEVEL_NONE)
+ MessageBoxW( NULL, error, NULL, MB_OK );
msiobj_release( &row->hdr );
}
- else
+ else if ((gUILevel & INSTALLUILEVEL_MASK) != INSTALLUILEVEL_NONE)
MessageBoxW( NULL, deformated, NULL, MB_OK );
msi_free( deformated );
- return ERROR_FUNCTION_FAILED;
+ return ERROR_INSTALL_FAILURE;
}
static UINT HANDLE_CustomType50(MSIPACKAGE *package, LPCWSTR source,
return wait_process_handle(package, type, info.hProcess, action);
}
-static DWORD WINAPI ACTION_CallScript( const GUID *guid )
+static DWORD ACTION_CallScript( const GUID *guid )
{
msi_custom_action_info *info;
MSIHANDLE hPackage;
else
ERR("failed to create handle for %p\n", info->package );
- if (info->type & msidbCustomActionTypeAsync &&
- info->type & msidbCustomActionTypeContinue)
- release_custom_action_data( info );
+ release_custom_action_data( info );
return S_OK;
}
static UINT HANDLE_CustomType37_38(MSIPACKAGE *package, LPCWSTR source,
LPCWSTR target, const INT type, LPCWSTR action)
{
+ UINT r;
msi_custom_action_info *info;
TRACE("%s %s\n", debugstr_w(source), debugstr_w(target));
info = do_msidbCustomActionTypeScript( package, type, target, NULL, action );
- return wait_thread_handle( info );
+ r = wait_thread_handle( info );
+ release_custom_action_data( info );
+ return r;
}
static UINT HANDLE_CustomType5_6(MSIPACKAGE *package, LPCWSTR source,
info = do_msidbCustomActionTypeScript( package, type, bufferw, target, action );
r = wait_thread_handle( info );
+ release_custom_action_data( info );
done:
msi_free(bufferw);
info = do_msidbCustomActionTypeScript( package, type, bufferw, target, action );
r = wait_thread_handle( info );
+ release_custom_action_data( info );
done:
msi_free(bufferw);
{
msi_custom_action_info *info;
WCHAR *prop;
+ UINT r;
TRACE("%s %s\n", debugstr_w(source), debugstr_w(target));
info = do_msidbCustomActionTypeScript( package, type, prop, NULL, action );
msi_free(prop);
- return wait_thread_handle( info );
+ r = wait_thread_handle( info );
+ release_custom_action_data( info );
+ return r;
}
void ACTION_FinishCustomActions(const MSIPACKAGE* package)