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

msi: Use an INSTALLSTATE variable to track install state of classes and extensions.

parent 347da355
...@@ -296,7 +296,7 @@ static MSICLASS *load_class( MSIPACKAGE* package, MSIRECORD *row ) ...@@ -296,7 +296,7 @@ static MSICLASS *load_class( MSIPACKAGE* package, MSIRECORD *row )
cls->Feature = msi_get_loaded_feature(package, buffer); cls->Feature = msi_get_loaded_feature(package, buffer);
cls->Attributes = MSI_RecordGetInteger(row,13); cls->Attributes = MSI_RecordGetInteger(row,13);
cls->action = INSTALLSTATE_UNKNOWN;
return cls; return cls;
} }
...@@ -425,7 +425,7 @@ static MSIEXTENSION *load_extension( MSIPACKAGE* package, MSIRECORD *row ) ...@@ -425,7 +425,7 @@ static MSIEXTENSION *load_extension( MSIPACKAGE* package, MSIRECORD *row )
buffer = MSI_RecordGetString(row,5); buffer = MSI_RecordGetString(row,5);
ext->Feature = msi_get_loaded_feature( package, buffer ); ext->Feature = msi_get_loaded_feature( package, buffer );
ext->action = INSTALLSTATE_UNKNOWN;
return ext; return ext;
} }
...@@ -856,7 +856,7 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package) ...@@ -856,7 +856,7 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package)
} }
TRACE("Registering class %s (%p)\n", debugstr_w(cls->clsid), cls); TRACE("Registering class %s (%p)\n", debugstr_w(cls->clsid), cls);
cls->Installed = TRUE; cls->action = INSTALLSTATE_LOCAL;
mark_progid_for_install( package, cls->ProgID ); mark_progid_for_install( package, cls->ProgID );
RegCreateKeyW( hkey, cls->clsid, &hkey2 ); RegCreateKeyW( hkey, cls->clsid, &hkey2 );
...@@ -1014,7 +1014,7 @@ UINT ACTION_UnregisterClassInfo( MSIPACKAGE *package ) ...@@ -1014,7 +1014,7 @@ UINT ACTION_UnregisterClassInfo( MSIPACKAGE *package )
} }
TRACE("Unregistering class %s (%p)\n", debugstr_w(cls->clsid), cls); TRACE("Unregistering class %s (%p)\n", debugstr_w(cls->clsid), cls);
cls->Installed = FALSE; cls->action = INSTALLSTATE_ABSENT;
mark_progid_for_uninstall( package, cls->ProgID ); mark_progid_for_uninstall( package, cls->ProgID );
res = RegDeleteTreeW( hkey, cls->clsid ); res = RegDeleteTreeW( hkey, cls->clsid );
...@@ -1116,13 +1116,12 @@ UINT ACTION_RegisterProgIdInfo(MSIPACKAGE *package) ...@@ -1116,13 +1116,12 @@ UINT ACTION_RegisterProgIdInfo(MSIPACKAGE *package)
LIST_FOR_EACH_ENTRY( progid, &package->progids, MSIPROGID, entry ) LIST_FOR_EACH_ENTRY( progid, &package->progids, MSIPROGID, entry )
{ {
/* check if this progid is to be installed */ /* check if this progid is to be installed */
if (progid->Class && progid->Class->Installed) if (progid->Class && progid->Class->action == INSTALLSTATE_LOCAL)
progid->InstallMe = TRUE; progid->InstallMe = TRUE;
if (!progid->InstallMe) if (!progid->InstallMe)
{ {
TRACE("progid %s not scheduled to be installed\n", TRACE("progid %s not scheduled to be installed\n", debugstr_w(progid->ProgID));
debugstr_w(progid->ProgID));
continue; continue;
} }
...@@ -1152,7 +1151,7 @@ UINT ACTION_UnregisterProgIdInfo( MSIPACKAGE *package ) ...@@ -1152,7 +1151,7 @@ UINT ACTION_UnregisterProgIdInfo( MSIPACKAGE *package )
LIST_FOR_EACH_ENTRY( progid, &package->progids, MSIPROGID, entry ) LIST_FOR_EACH_ENTRY( progid, &package->progids, MSIPROGID, entry )
{ {
/* check if this progid is to be removed */ /* check if this progid is to be removed */
if (progid->Class && !progid->Class->Installed) if (progid->Class && progid->Class->action != INSTALLSTATE_LOCAL)
progid->InstallMe = FALSE; progid->InstallMe = FALSE;
if (progid->InstallMe) if (progid->InstallMe)
...@@ -1302,7 +1301,7 @@ UINT ACTION_RegisterExtensionInfo(MSIPACKAGE *package) ...@@ -1302,7 +1301,7 @@ UINT ACTION_RegisterExtensionInfo(MSIPACKAGE *package)
} }
TRACE("Registering extension %s (%p)\n", debugstr_w(ext->Extension), ext); TRACE("Registering extension %s (%p)\n", debugstr_w(ext->Extension), ext);
ext->Installed = TRUE; ext->action = INSTALLSTATE_LOCAL;
/* this is only registered if the extension has at least 1 verb /* this is only registered if the extension has at least 1 verb
* according to MSDN * according to MSDN
...@@ -1408,7 +1407,7 @@ UINT ACTION_UnregisterExtensionInfo( MSIPACKAGE *package ) ...@@ -1408,7 +1407,7 @@ UINT ACTION_UnregisterExtensionInfo( MSIPACKAGE *package )
} }
TRACE("Unregistering extension %s\n", debugstr_w(ext->Extension)); TRACE("Unregistering extension %s\n", debugstr_w(ext->Extension));
ext->Installed = FALSE; ext->action = INSTALLSTATE_ABSENT;
if (ext->ProgID && !list_empty( &ext->verbs )) if (ext->ProgID && !list_empty( &ext->verbs ))
mark_progid_for_uninstall( package, ext->ProgID ); mark_progid_for_uninstall( package, ext->ProgID );
...@@ -1478,8 +1477,8 @@ UINT ACTION_RegisterMIMEInfo(MSIPACKAGE *package) ...@@ -1478,8 +1477,8 @@ UINT ACTION_RegisterMIMEInfo(MSIPACKAGE *package)
* extension or Class * extension or Class
*/ */
mt->InstallMe = (mt->InstallMe || mt->InstallMe = (mt->InstallMe ||
(mt->Class && mt->Class->Installed) || (mt->Class && mt->Class->action == INSTALLSTATE_LOCAL) ||
(mt->Extension && mt->Extension->Installed)); (mt->Extension && mt->Extension->action == INSTALLSTATE_LOCAL));
if (!mt->InstallMe) if (!mt->InstallMe)
{ {
...@@ -1532,8 +1531,8 @@ UINT ACTION_UnregisterMIMEInfo( MSIPACKAGE *package ) ...@@ -1532,8 +1531,8 @@ UINT ACTION_UnregisterMIMEInfo( MSIPACKAGE *package )
LPWSTR mime_key; LPWSTR mime_key;
mime->InstallMe = (mime->InstallMe || mime->InstallMe = (mime->InstallMe ||
(mime->Class && mime->Class->Installed) || (mime->Class && mime->Class->action == INSTALLSTATE_LOCAL) ||
(mime->Extension && mime->Extension->Installed)); (mime->Extension && mime->Extension->action == INSTALLSTATE_LOCAL));
if (mime->InstallMe) if (mime->InstallMe)
{ {
......
...@@ -614,7 +614,7 @@ typedef struct tagMSICLASS ...@@ -614,7 +614,7 @@ typedef struct tagMSICLASS
MSIFEATURE *Feature; MSIFEATURE *Feature;
INT Attributes; INT Attributes;
/* not in the table, set during installation */ /* not in the table, set during installation */
BOOL Installed; INSTALLSTATE action;
} MSICLASS; } MSICLASS;
typedef struct tagMSIMIME MSIMIME; typedef struct tagMSIMIME MSIMIME;
...@@ -629,7 +629,7 @@ typedef struct tagMSIEXTENSION ...@@ -629,7 +629,7 @@ typedef struct tagMSIEXTENSION
MSIMIME *Mime; MSIMIME *Mime;
MSIFEATURE *Feature; MSIFEATURE *Feature;
/* not in the table, set during installation */ /* not in the table, set during installation */
BOOL Installed; INSTALLSTATE action;
struct list verbs; struct list verbs;
} MSIEXTENSION; } MSIEXTENSION;
......
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