From f3f12ab56b82f6f86a10c50ba9408741f513de00 Mon Sep 17 00:00:00 2001 From: Mike McCormack Date: Wed, 21 Sep 2005 10:20:03 +0000 Subject: [PATCH] Simplify the InstallValidate action a little. --- dlls/msi/action.c | 36 +++++++----------------------------- dlls/msi/msiquery.c | 3 ++- 2 files changed, 9 insertions(+), 30 deletions(-) diff --git a/dlls/msi/action.c b/dlls/msi/action.c index ec25b370e1d..5eec261cd7c 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -2145,47 +2145,25 @@ static UINT ACTION_InstallValidate(MSIPACKAGE *package) '`','R','e','g','i','s','t','r','y','`',0}; UINT rc; MSIQUERY * view; - MSIRECORD * row = 0; MSIFEATURE *feature; MSIFILE *file; - TRACE(" InstallValidate \n"); + TRACE("InstallValidate\n"); rc = MSI_DatabaseOpenViewW(package->db, q1, &view); - if (rc != ERROR_SUCCESS) - return ERROR_SUCCESS; - - rc = MSI_ViewExecute(view, 0); - if (rc != ERROR_SUCCESS) - { - MSI_ViewClose(view); - msiobj_release(&view->hdr); - return rc; - } - while (1) + if (rc == ERROR_SUCCESS) { - rc = MSI_ViewFetch(view,&row); - if (rc != ERROR_SUCCESS) - { - rc = ERROR_SUCCESS; - break; - } - progress +=1; - - msiobj_release(&row->hdr); + MSI_IterateRecords( view, &progress, NULL, package ); + msiobj_release( &view->hdr ); + total += progress * REG_PROGRESS_VALUE; } - MSI_ViewClose(view); - msiobj_release(&view->hdr); - total = total + progress * REG_PROGRESS_VALUE; LIST_FOR_EACH_ENTRY( comp, &package->components, MSICOMPONENT, entry ) - { total += COMPONENT_PROGRESS_VALUE; - } + LIST_FOR_EACH_ENTRY( file, &package->files, MSIFILE, entry ) - { total += file->FileSize; - } + ui_progress(package,0,total,0,0); LIST_FOR_EACH_ENTRY( feature, &package->features, MSIFEATURE, entry ) diff --git a/dlls/msi/msiquery.c b/dlls/msi/msiquery.c index a18f4dfd15b..a98819075ed 100644 --- a/dlls/msi/msiquery.c +++ b/dlls/msi/msiquery.c @@ -183,7 +183,8 @@ UINT MSI_IterateRecords( MSIQUERY *view, DWORD *count, r = MSI_ViewFetch( view, &rec ); if( r != ERROR_SUCCESS ) break; - r = func( rec, param ); + if (func) + r = func( rec, param ); msiobj_release( &rec->hdr ); if( r != ERROR_SUCCESS ) break; -- 2.11.4.GIT