static UINT iterate_appsearch(MSIRECORD *row, LPVOID param) { MSIPACKAGE *package = param; LPCWSTR propName, sigName; LPWSTR value = NULL; MSISIGNATURE sig; MSIRECORD *uirow; UINT r; /* get property and signature */ propName = MSI_RecordGetString(row, 1); sigName = MSI_RecordGetString(row, 2); TRACE("%s %s\n", debugstr_w(propName), debugstr_w(sigName)); r = ACTION_AppSearchSigName(package, sigName, &sig, &value); if (value) { r = msi_set_property( package->db, propName, value ); if (r == ERROR_SUCCESS && !strcmpW( propName, cszSourceDir )) msi_reset_folders( package, TRUE ); msi_free(value); } ACTION_FreeSignature(&sig); uirow = MSI_CreateRecord( 2 ); MSI_RecordSetStringW( uirow, 1, propName ); MSI_RecordSetStringW( uirow, 2, sigName ); ui_actiondata( package, szAppSearch, uirow ); msiobj_release( &uirow->hdr ); return r; }
static void msi_file_update_ui( MSIPACKAGE *package, MSIFILE *f, const WCHAR *action ) { MSIRECORD *uirow; LPWSTR uipath, p; /* the UI chunk */ uirow = MSI_CreateRecord( 9 ); MSI_RecordSetStringW( uirow, 1, f->FileName ); uipath = strdupW( f->TargetPath ); p = strrchrW(uipath,'\\'); if (p) p[1]=0; MSI_RecordSetStringW( uirow, 9, uipath); MSI_RecordSetInteger( uirow, 6, f->FileSize ); ui_actiondata( package, action, uirow); msiobj_release( &uirow->hdr ); msi_free( uipath ); ui_progress( package, 2, f->FileSize, 0, 0); }
static UINT ITERATE_UnregisterFonts( MSIRECORD *row, LPVOID param ) { MSIPACKAGE *package = param; LPWSTR name; LPCWSTR filename; MSIFILE *file; HKEY hkey1, hkey2; MSIRECORD *uirow; LPWSTR uipath, p; filename = MSI_RecordGetString( row, 1 ); file = get_loaded_file( package, filename ); if (!file) { ERR("Unable to load file\n"); return ERROR_SUCCESS; } if (!file->Component->Enabled) { TRACE("component is disabled\n"); return ERROR_SUCCESS; } if (file->Component->ActionRequest != INSTALLSTATE_ABSENT) { TRACE("Component not scheduled for removal\n"); return ERROR_SUCCESS; } RegCreateKeyW( HKEY_LOCAL_MACHINE, regfont1, &hkey1 ); RegCreateKeyW( HKEY_LOCAL_MACHINE, regfont2, &hkey2 ); if (MSI_RecordIsNull( row, 2 )) name = font_name_from_file( file->TargetPath ); else name = msi_dup_record_field( row, 2 ); if (name) { RegDeleteValueW( hkey1, name ); RegDeleteValueW( hkey2, name ); } msi_free( name ); RegCloseKey( hkey1 ); RegCloseKey( hkey2 ); /* the UI chunk */ uirow = MSI_CreateRecord( 1 ); uipath = strdupW( file->TargetPath ); p = strrchrW( uipath,'\\' ); if (p) p++; else p = uipath; MSI_RecordSetStringW( uirow, 1, p ); ui_actiondata( package, szUnregisterFonts, uirow ); msiobj_release( &uirow->hdr ); msi_free( uipath ); /* FIXME: call ui_progress? */ return ERROR_SUCCESS; }
static UINT ITERATE_RegisterFonts(MSIRECORD *row, LPVOID param) { MSIPACKAGE *package = param; LPWSTR name; LPCWSTR filename; MSIFILE *file; static const WCHAR regfont1[] = {'S','o','f','t','w','a','r','e','\\', 'M','i','c','r','o','s','o','f','t','\\', 'W','i','n','d','o','w','s',' ','N','T','\\', 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\', 'F','o','n','t','s',0}; static const WCHAR regfont2[] = {'S','o','f','t','w','a','r','e','\\', 'M','i','c','r','o','s','o','f','t','\\', 'W','i','n','d','o','w','s','\\', 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\', 'F','o','n','t','s',0}; HKEY hkey1; HKEY hkey2; MSIRECORD *uirow; LPWSTR uipath, p; filename = MSI_RecordGetString( row, 1 ); file = get_loaded_file( package, filename ); if (!file) { ERR("Unable to load file\n"); return ERROR_SUCCESS; } /* check to make sure that component is installed */ if (!ACTION_VerifyComponentForAction( file->Component, INSTALLSTATE_LOCAL)) { TRACE("Skipping: Component not scheduled for install\n"); return ERROR_SUCCESS; } RegCreateKeyW(HKEY_LOCAL_MACHINE,regfont1,&hkey1); RegCreateKeyW(HKEY_LOCAL_MACHINE,regfont2,&hkey2); if (MSI_RecordIsNull(row,2)) name = load_ttfname_from( file->TargetPath ); else name = msi_dup_record_field(row,2); if (name) { msi_reg_set_val_str( hkey1, name, file->TargetPath); msi_reg_set_val_str( hkey2, name, file->TargetPath); } msi_free(name); RegCloseKey(hkey1); RegCloseKey(hkey2); /* the UI chunk */ uirow = MSI_CreateRecord( 1 ); uipath = strdupW( file->TargetPath ); p = strrchrW(uipath,'\\'); if (p) p++; else p = uipath; MSI_RecordSetStringW( uirow, 1, p ); ui_actiondata( package, szRegisterFonts, uirow); msiobj_release( &uirow->hdr ); msi_free( uipath ); /* FIXME: call ui_progress? */ return ERROR_SUCCESS; }
static UINT ITERATE_FindRelatedProducts(MSIRECORD *rec, LPVOID param) { MSIPACKAGE *package = (MSIPACKAGE*)param; WCHAR product[GUID_SIZE]; DWORD index = 0; DWORD attributes = 0; DWORD sz = GUID_SIZE; LPCWSTR upgrade_code; HKEY hkey = 0; UINT rc = ERROR_SUCCESS; MSIRECORD *uirow; upgrade_code = MSI_RecordGetString(rec,1); rc = MSIREG_OpenUpgradeCodesKey(upgrade_code, &hkey, FALSE); if (rc != ERROR_SUCCESS) return ERROR_SUCCESS; uirow = MSI_CreateRecord(1); attributes = MSI_RecordGetInteger(rec,5); while (rc == ERROR_SUCCESS) { rc = RegEnumValueW(hkey, index, product, &sz, NULL, NULL, NULL, NULL); TRACE("Looking at (%li) %s\n",index,debugstr_w(product)); if (rc == ERROR_SUCCESS) { WCHAR productid[GUID_SIZE]; LPCWSTR ver; LPCWSTR language; LPCWSTR action_property; DWORD check = 0x00000000; DWORD comp_ver = 0x00000000; DWORD sz = 0x100; HKEY hukey; INT r; unsquash_guid(product,productid); rc = MSIREG_OpenUserProductsKey(productid, &hukey, FALSE); if (rc != ERROR_SUCCESS) { rc = ERROR_SUCCESS; index ++; continue; } sz = sizeof(DWORD); RegQueryValueExW(hukey, INSTALLPROPERTY_VERSIONW, NULL, NULL, (LPBYTE)&check, &sz); /* check min */ ver = MSI_RecordGetString(rec,2); comp_ver = msi_version_str_to_dword(ver); r = check - comp_ver; if (r < 0 || (r == 0 && !(attributes & msidbUpgradeAttributesVersionMinInclusive))) { RegCloseKey(hukey); index ++; continue; } /* check max */ ver = MSI_RecordGetString(rec,3); comp_ver = msi_version_str_to_dword(ver); r = check - comp_ver; if (r > 0 || (r == 0 && !(attributes & msidbUpgradeAttributesVersionMaxInclusive))) { RegCloseKey(hukey); index ++; continue; } /* check language*/ sz = sizeof(DWORD); RegQueryValueExW(hukey, INSTALLPROPERTY_LANGUAGEW, NULL, NULL, (LPBYTE)&check, &sz); RegCloseKey(hukey); language = MSI_RecordGetString(rec,4); TRACE("Checking languages 0x%lx and %s\n", check, debugstr_w(language)); if (!check_language(check, language, attributes)) { index ++; continue; } action_property = MSI_RecordGetString(rec,7); append_productcode(package,action_property,productid); ui_actiondata(package,szFindRelatedProducts,uirow); } index ++; } RegCloseKey(hkey); msiobj_release( &uirow->hdr); return ERROR_SUCCESS; }