From c90c781a32202441a20847a2634b33bc2238555a Mon Sep 17 00:00:00 2001 From: Mike McCormack Date: Fri, 9 Jul 2004 22:58:27 +0000 Subject: [PATCH] Implement MsiVerifyPackage, cosmetic fixes. --- dlls/msi/action.c | 22 +++++++++++----------- dlls/msi/cond.y | 2 -- dlls/msi/msi.c | 32 ++++++++++++++++++++++++++++---- dlls/msi/package.c | 2 +- 4 files changed, 40 insertions(+), 18 deletions(-) diff --git a/dlls/msi/action.c b/dlls/msi/action.c index d5b93a6c20f..c20cb59566f 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -3026,7 +3026,7 @@ static UINT ACTION_InstallInitialize(MSIPACKAGE *package) } /* - * components FeatureState defaults to FALSE. the idea is we want to + * Components FeatureState defaults to FALSE. The idea is we want to * enable the component is ANY feature that uses it is enabled to install */ for(i = 0; i < package->loaded_features; i++) @@ -3053,7 +3053,7 @@ static UINT ACTION_InstallInitialize(MSIPACKAGE *package) if (override != NULL) HeapFree(GetProcessHeap(),0,override); /* - * so basically we ONLY want to install a component if its Enabled AND + * So basically we ONLY want to install a component if its Enabled AND * FeatureState are both TRUE */ return ERROR_SUCCESS; @@ -3306,10 +3306,10 @@ end: static UINT ACTION_RegisterTypeLibraries(MSIPACKAGE *package) { /* - * ok this is a bit confusting.. I am given a _Component key and i believe + * OK this is a bit confusing.. I am given a _Component key and I believe * that the file that is being registered as a type library is the "key file - * of that component" which i interpert to mean "The file in the KeyPath of - * that component" + * of that component" which I interpret to mean "The file in the KeyPath of + * that component". */ UINT rc; MSIQUERY * view; @@ -3391,8 +3391,8 @@ static UINT ACTION_RegisterTypeLibraries(MSIPACKAGE *package) debugstr_w(package->files[index].TargetPath)); else { - /* yes the row has more fields than i need, but #1 is - correct and the only one i need. why make a new row */ + /* Yes the row has more fields than I need, but #1 is + correct and the only one I need. Why make a new row? */ ui_actiondata(package,szRegisterTypeLibraries,row); @@ -3536,8 +3536,8 @@ static UINT register_appid(MSIPACKAGE *package, LPCWSTR clsid, LPCWSTR app ) static UINT ACTION_RegisterClassInfo(MSIPACKAGE *package) { /* - * Again I am assuming the words, "Whose key file respesents" when refering - * to a Component as to mean the Components KeyPath file + * Again I am assuming the words, "Whose key file represents" when refering + * to a Component as to meaning that Components KeyPath file * * Also there is a very strong connection between ClassInfo and ProgID * that I am mostly glossing over. @@ -3814,12 +3814,12 @@ static UINT register_progid(MSIPACKAGE *package, MSIRECORD * row, LPWSTR clsid) static UINT ACTION_RegisterProgIdInfo(MSIPACKAGE *package) { /* - * Sigh, here i am just brute force registering all progid + * Sigh, here I am just brute force registering all progids * this needs to be linked to the Classes that have been registerd * but the easiest way to do that is to load all these stuff into * memory for easy checking. * - * gives me something to continue to work toward + * Gives me something to continue to work toward. */ UINT rc; MSIQUERY * view; diff --git a/dlls/msi/cond.y b/dlls/msi/cond.y index 7a94b8545f4..c5464026f6d 100644 --- a/dlls/msi/cond.y +++ b/dlls/msi/cond.y @@ -57,8 +57,6 @@ struct cond_str { static LPWSTR COND_GetString( struct cond_str *str ); static int COND_lex( void *COND_lval, COND_input *info); -UINT get_property(MSIHANDLE hPackage, const WCHAR* prop, WCHAR* value, - DWORD* size); typedef INT (*comp_int)(INT a, INT b); typedef INT (*comp_str)(LPWSTR a, LPWSTR b, BOOL caseless); diff --git a/dlls/msi/msi.c b/dlls/msi/msi.c index f9943667016..7f49276ffc4 100644 --- a/dlls/msi/msi.c +++ b/dlls/msi/msi.c @@ -1180,14 +1180,38 @@ UINT WINAPI MsiGetProductPropertyW( MSIHANDLE hProduct, LPCWSTR szProperty, UINT WINAPI MsiVerifyPackageA( LPCSTR szPackage ) { - FIXME("%s\n", debugstr_a(szPackage) ); - return ERROR_CALL_NOT_IMPLEMENTED; + UINT r, len; + LPWSTR szPack = NULL; + + TRACE("%s\n", debugstr_a(szPackage) ); + + if( szPackage ) + { + len = MultiByteToWideChar( CP_ACP, 0, szPackage, -1, NULL, 0 ); + szPack = HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) ); + if( !szPack ) + return ERROR_OUTOFMEMORY; + MultiByteToWideChar( CP_ACP, 0, szPackage, -1, szPack, len ); + } + + r = MsiVerifyPackageW( szPack ); + + HeapFree( GetProcessHeap(), 0, szPack ); + + return r; } UINT WINAPI MsiVerifyPackageW( LPCWSTR szPackage ) { - FIXME("%s\n", debugstr_w(szPackage) ); - return ERROR_CALL_NOT_IMPLEMENTED; + MSIHANDLE handle; + UINT r; + + TRACE("%s\n", debugstr_w(szPackage) ); + + r = MsiOpenDatabaseW( szPackage, MSIDBOPEN_READONLY, &handle ); + MsiCloseHandle( handle ); + + return r; } INSTALLSTATE WINAPI MsiGetComponentPathA(LPCSTR szProduct, LPCSTR szComponent, diff --git a/dlls/msi/package.c b/dlls/msi/package.c index 7bab59e001b..287209008ed 100644 --- a/dlls/msi/package.c +++ b/dlls/msi/package.c @@ -254,7 +254,7 @@ static VOID set_installer_properties(MSIPACKAGE *package) 'D','e','s','k','t','o','p','\\',0}; /* - * Other things i notice set + * Other things I notice set * ScreenY ScreenX