+ RegDeleteValueW( hkey, product );
+ res = RegQueryInfoKeyW( hkey, NULL, NULL, NULL, NULL, NULL, &count, NULL, NULL, NULL, NULL, NULL );
+ RegCloseKey( hkey );
+ if (!res && !count) MSIREG_DeleteUpgradeCodesKey( code );
+ }
+ if (!MSIREG_OpenUserUpgradeCodesKey( code, &hkey, FALSE ))
+ {
+ RegDeleteValueW( hkey, product );
+ res = RegQueryInfoKeyW( hkey, NULL, NULL, NULL, NULL, NULL, &count, NULL, NULL, NULL, NULL, NULL );
+ RegCloseKey( hkey );
+ if (!res && !count) MSIREG_DeleteUserUpgradeCodesKey( code );
+ }
+ if (!MSIREG_OpenClassesUpgradeCodesKey( code, &hkey, FALSE ))
+ {
+ RegDeleteValueW( hkey, product );
+ res = RegQueryInfoKeyW( hkey, NULL, NULL, NULL, NULL, NULL, &count, NULL, NULL, NULL, NULL, NULL );
+ RegCloseKey( hkey );
+ if (!res && !count) MSIREG_DeleteClassesUpgradeCodesKey( code );