Commit b376f417 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

msi: Don't try to install or remove ODBC drivers if the component is disabled.

parent 4e1ff0b8
......@@ -5953,8 +5953,9 @@ static UINT ITERATE_InstallODBCDriver( MSIRECORD *rec, LPVOID param )
LPWSTR driver, driver_path, ptr;
WCHAR outpath[MAX_PATH];
MSIFILE *driver_file = NULL, *setup_file = NULL;
MSICOMPONENT *comp;
MSIRECORD *uirow;
LPCWSTR desc, file_key;
LPCWSTR desc, file_key, component;
DWORD len, usage;
UINT r = ERROR_SUCCESS;
......@@ -5965,6 +5966,17 @@ static UINT ITERATE_InstallODBCDriver( MSIRECORD *rec, LPVOID param )
static const WCHAR usage_fmt[] = {
'F','i','l','e','U','s','a','g','e','=','1',0};
component = MSI_RecordGetString( rec, 2 );
comp = get_loaded_component( package, component );
if (!comp)
return ERROR_SUCCESS;
if (!comp->Enabled)
{
TRACE("component is disabled\n");
return ERROR_SUCCESS;
}
desc = MSI_RecordGetString(rec, 3);
file_key = MSI_RecordGetString( rec, 4 );
......@@ -6035,8 +6047,9 @@ static UINT ITERATE_InstallODBCTranslator( MSIRECORD *rec, LPVOID param )
LPWSTR translator, translator_path, ptr;
WCHAR outpath[MAX_PATH];
MSIFILE *translator_file = NULL, *setup_file = NULL;
MSICOMPONENT *comp;
MSIRECORD *uirow;
LPCWSTR desc, file_key;
LPCWSTR desc, file_key, component;
DWORD len, usage;
UINT r = ERROR_SUCCESS;
......@@ -6045,6 +6058,17 @@ static UINT ITERATE_InstallODBCTranslator( MSIRECORD *rec, LPVOID param )
static const WCHAR setup_fmt[] = {
'S','e','t','u','p','=','%','s',0};
component = MSI_RecordGetString( rec, 2 );
comp = get_loaded_component( package, component );
if (!comp)
return ERROR_SUCCESS;
if (!comp->Enabled)
{
TRACE("component is disabled\n");
return ERROR_SUCCESS;
}
desc = MSI_RecordGetString(rec, 3);
file_key = MSI_RecordGetString( rec, 4 );
......@@ -6108,8 +6132,9 @@ static UINT ITERATE_InstallODBCTranslator( MSIRECORD *rec, LPVOID param )
static UINT ITERATE_InstallODBCDataSource( MSIRECORD *rec, LPVOID param )
{
MSIPACKAGE *package = param;
MSICOMPONENT *comp;
LPWSTR attrs;
LPCWSTR desc, driver;
LPCWSTR desc, driver, component;
WORD request = ODBC_ADD_SYS_DSN;
INT registration;
DWORD len;
......@@ -6119,6 +6144,17 @@ static UINT ITERATE_InstallODBCDataSource( MSIRECORD *rec, LPVOID param )
static const WCHAR attrs_fmt[] = {
'D','S','N','=','%','s',0 };
component = MSI_RecordGetString( rec, 2 );
comp = get_loaded_component( package, component );
if (!comp)
return ERROR_SUCCESS;
if (!comp->Enabled)
{
TRACE("component is disabled\n");
return ERROR_SUCCESS;
}
desc = MSI_RecordGetString(rec, 3);
driver = MSI_RecordGetString(rec, 4);
registration = MSI_RecordGetInteger(rec, 5);
......@@ -6196,9 +6232,21 @@ static UINT ACTION_InstallODBC( MSIPACKAGE *package )
static UINT ITERATE_RemoveODBCDriver( MSIRECORD *rec, LPVOID param )
{
MSIPACKAGE *package = param;
MSICOMPONENT *comp;
MSIRECORD *uirow;
DWORD usage;
LPCWSTR desc;
LPCWSTR desc, component;
component = MSI_RecordGetString( rec, 2 );
comp = get_loaded_component( package, component );
if (!comp)
return ERROR_SUCCESS;
if (!comp->Enabled)
{
TRACE("component is disabled\n");
return ERROR_SUCCESS;
}
desc = MSI_RecordGetString( rec, 3 );
if (!SQLRemoveDriverW( desc, FALSE, &usage ))
......@@ -6222,9 +6270,21 @@ static UINT ITERATE_RemoveODBCDriver( MSIRECORD *rec, LPVOID param )
static UINT ITERATE_RemoveODBCTranslator( MSIRECORD *rec, LPVOID param )
{
MSIPACKAGE *package = param;
MSICOMPONENT *comp;
MSIRECORD *uirow;
DWORD usage;
LPCWSTR desc;
LPCWSTR desc, component;
component = MSI_RecordGetString( rec, 2 );
comp = get_loaded_component( package, component );
if (!comp)
return ERROR_SUCCESS;
if (!comp->Enabled)
{
TRACE("component is disabled\n");
return ERROR_SUCCESS;
}
desc = MSI_RecordGetString( rec, 3 );
if (!SQLRemoveTranslatorW( desc, &usage ))
......@@ -6248,9 +6308,10 @@ static UINT ITERATE_RemoveODBCTranslator( MSIRECORD *rec, LPVOID param )
static UINT ITERATE_RemoveODBCDataSource( MSIRECORD *rec, LPVOID param )
{
MSIPACKAGE *package = param;
MSICOMPONENT *comp;
MSIRECORD *uirow;
LPWSTR attrs;
LPCWSTR desc, driver;
LPCWSTR desc, driver, component;
WORD request = ODBC_REMOVE_SYS_DSN;
INT registration;
DWORD len;
......@@ -6258,6 +6319,17 @@ static UINT ITERATE_RemoveODBCDataSource( MSIRECORD *rec, LPVOID param )
static const WCHAR attrs_fmt[] = {
'D','S','N','=','%','s',0 };
component = MSI_RecordGetString( rec, 2 );
comp = get_loaded_component( package, component );
if (!comp)
return ERROR_SUCCESS;
if (!comp->Enabled)
{
TRACE("component is disabled\n");
return ERROR_SUCCESS;
}
desc = MSI_RecordGetString( rec, 3 );
driver = MSI_RecordGetString( rec, 4 );
registration = MSI_RecordGetInteger( rec, 5 );
......
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