diff --git a/reactos/dll/win32/msi/action.c b/reactos/dll/win32/msi/action.c index e7edabe9fce..6867e93a5bf 100644 --- a/reactos/dll/win32/msi/action.c +++ b/reactos/dll/win32/msi/action.c @@ -33,6 +33,10 @@ #include "msipriv.h" #include "winuser.h" #include "shlobj.h" +#include "objbase.h" +#include "mscoree.h" +#include "fusion.h" +#include "shlwapi.h" #include "wine/unicode.h" #include "winver.h" @@ -1246,6 +1250,9 @@ static MSIFEATURE *find_feature_by_name( MSIPACKAGE *package, LPCWSTR name ) { MSIFEATURE *feature; + if ( !name ) + return NULL; + LIST_FOR_EACH_ENTRY( feature, &package->features, MSIFEATURE, entry ) { if ( !lstrcmpW( feature->Feature, name ) ) @@ -1985,7 +1992,7 @@ static UINT ITERATE_CostFinalizeConditions(MSIRECORD *row, LPVOID param) if (MSI_EvaluateConditionW(package,Condition) == MSICONDITION_TRUE) { int level = MSI_RecordGetInteger(row,2); - TRACE("Reseting feature %s to level %i\n", debugstr_w(name), level); + TRACE("Resetting feature %s to level %i\n", debugstr_w(name), level); feature->Level = level; } } @@ -2118,7 +2125,10 @@ static UINT ACTION_CostFinalize(MSIPACKAGE *package) {'C','o','s','t','i','n','g','C','o','m','p','l','e','t','e',0 }; static const WCHAR szlevel[] = {'I','N','S','T','A','L','L','L','E','V','E','L',0}; + static const WCHAR szOutOfDiskSpace[] = + {'O','u','t','O','f','D','i','s','k','S','p','a','c','e',0}; static const WCHAR szOne[] = { '1', 0 }; + static const WCHAR szZero[] = { '0', 0 }; MSICOMPONENT *comp; UINT rc; MSIQUERY * view; @@ -2170,6 +2180,9 @@ static UINT ACTION_CostFinalize(MSIPACKAGE *package) MSI_SetPropertyW(package,szlevel, szOne); msi_free(level); + /* FIXME: check volume disk space */ + MSI_SetPropertyW(package, szOutOfDiskSpace, szZero); + ACTION_UpdateFeatureInstallStates(package); return MSI_SetFeatureStates(package); @@ -2426,7 +2439,7 @@ static UINT ITERATE_WriteRegistryValues(MSIRECORD *row, LPVOID param) { static const WCHAR szEmpty[] = {0}; value_data = (LPSTR)strdupW(szEmpty); - size = 0; + size = sizeof(szEmpty); type = REG_SZ; } @@ -2767,7 +2780,7 @@ static void ACTION_RefCountComponent( MSIPACKAGE* package, MSICOMPONENT *comp ) } } - /* add a count for permenent */ + /* add a count for permanent */ if (comp->Attributes & msidbComponentAttributesPermanent) count ++; @@ -2826,7 +2839,7 @@ static UINT ACTION_ProcessComponents(MSIPACKAGE *package) comp->RefCount); /* * Write the keypath out if the component is to be registered - * and delete the key if the component is to be deregistered + * and delete the key if the component is to be unregistered */ if (ACTION_VerifyComponentForAction( comp, INSTALLSTATE_LOCAL)) { @@ -3101,7 +3114,7 @@ static UINT ITERATE_CreateShortcuts(MSIRECORD *row, LPVOID param) buffer = MSI_RecordGetString(row,2); target_folder = resolve_folder(package, buffer,FALSE,FALSE,TRUE,NULL); - /* may be needed because of a bug somehwere else */ + /* may be needed because of a bug somewhere else */ create_full_pathW(target_folder); filename = msi_dup_record_field( row, 3 ); @@ -3345,13 +3358,30 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package) /* ok there is a lot more done here but i need to figure out what */ - rc = MSIREG_OpenProductsKey(package->ProductCode,&hkey,TRUE); - if (rc != ERROR_SUCCESS) - goto end; + if (package->Context == MSIINSTALLCONTEXT_MACHINE) + { + rc = MSIREG_OpenLocalClassesProductKey(package->ProductCode, &hukey, TRUE); + if (rc != ERROR_SUCCESS) + goto end; - rc = MSIREG_OpenUserProductsKey(package->ProductCode,&hukey,TRUE); - if (rc != ERROR_SUCCESS) - goto end; + rc = MSIREG_OpenLocalSystemInstallProps(package->ProductCode, &props, TRUE); + if (rc != ERROR_SUCCESS) + goto end; + } + else + { + rc = MSIREG_OpenProductsKey(package->ProductCode,&hkey,TRUE); + if (rc != ERROR_SUCCESS) + goto end; + + rc = MSIREG_OpenUserProductsKey(package->ProductCode,&hukey,TRUE); + if (rc != ERROR_SUCCESS) + goto end; + + rc = MSIREG_OpenCurrentUserInstallProps(package->ProductCode, &props, TRUE); + if (rc != ERROR_SUCCESS) + goto end; + } rc = RegCreateKeyW(hukey, szSourceList, &source); if (rc != ERROR_SUCCESS) @@ -3363,10 +3393,6 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package) if (rc != ERROR_SUCCESS) goto end; - rc = MSIREG_OpenInstallPropertiesKey(package->ProductCode,&props,TRUE); - if (rc != ERROR_SUCCESS) - goto end; - buffer = msi_dup_property( package, INSTALLPROPERTY_PRODUCTNAMEW ); msi_reg_set_val_str( hukey, INSTALLPROPERTY_PRODUCTNAMEW, buffer ); msi_free(buffer); @@ -3400,19 +3426,19 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package) buffer = strrchrW( package->PackagePath, '\\') + 1; rc = MsiSourceListSetInfoW( package->ProductCode, NULL, - MSIINSTALLCONTEXT_USERUNMANAGED, MSICODE_PRODUCT, + package->Context, MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEW, buffer ); if (rc != ERROR_SUCCESS) goto end; rc = MsiSourceListSetInfoW( package->ProductCode, NULL, - MSIINSTALLCONTEXT_USERUNMANAGED, MSICODE_PRODUCT, + package->Context, MSICODE_PRODUCT, INSTALLPROPERTY_MEDIAPACKAGEPATHW, szEmpty ); if (rc != ERROR_SUCCESS) goto end; rc = MsiSourceListSetInfoW( package->ProductCode, NULL, - MSIINSTALLCONTEXT_USERUNMANAGED, MSICODE_PRODUCT, + package->Context, MSICODE_PRODUCT, INSTALLPROPERTY_DISKPROMPTW, szEmpty ); if (rc != ERROR_SUCCESS) goto end; @@ -3759,8 +3785,10 @@ static UINT ACTION_PublishFeatures(MSIPACKAGE *package) size = strlenW(feature->Feature_Parent)*sizeof(WCHAR); if (!absent) { + static const WCHAR emptyW[] = {0}; + size += sizeof(WCHAR); RegSetValueExW(hukey,feature->Feature,0,REG_SZ, - (LPBYTE)feature->Feature_Parent,size); + (LPBYTE)(feature->Feature_Parent ? feature->Feature_Parent : emptyW),size); } else { @@ -3896,7 +3924,7 @@ static UINT msi_make_package_local( MSIPACKAGE *package, HKEY hkey ) msi_reg_set_val_str( hkey, INSTALLPROPERTY_LOCALPACKAGEW, packagefile ); - r = MSIREG_OpenInstallPropertiesKey(package->ProductCode, &props, TRUE); + r = MSIREG_OpenCurrentUserInstallProps(package->ProductCode, &props, TRUE); if (r != ERROR_SUCCESS) return r; @@ -3986,9 +4014,18 @@ static UINT ACTION_RegisterProduct(MSIPACKAGE *package) if (rc != ERROR_SUCCESS) return rc; - rc = MSIREG_OpenInstallPropertiesKey(package->ProductCode, &props, TRUE); - if (rc != ERROR_SUCCESS) - return rc; + if (package->Context == MSIINSTALLCONTEXT_MACHINE) + { + rc = MSIREG_OpenLocalSystemInstallProps(package->ProductCode, &props, TRUE); + if (rc != ERROR_SUCCESS) + return rc; + } + else + { + rc = MSIREG_OpenCurrentUserInstallProps(package->ProductCode, &props, TRUE); + if (rc != ERROR_SUCCESS) + return rc; + } /* dump all the info i can grab */ /* FIXME: Flesh out more information */ @@ -4060,7 +4097,7 @@ static UINT ACTION_RegisterProduct(MSIPACKAGE *package) msi_free(upgrade_code); } - + RegCloseKey(hkey); rc = MSIREG_OpenUserDataProductKey(package->ProductCode, &hudkey, TRUE); @@ -4221,13 +4258,13 @@ static UINT ACTION_ResolveSource(MSIPACKAGE* package) DWORD size = 0; rc = MsiSourceListGetInfoW(package->ProductCode, NULL, - MSIINSTALLCONTEXT_USERUNMANAGED, MSICODE_PRODUCT, + package->Context, MSICODE_PRODUCT, INSTALLPROPERTY_DISKPROMPTW,NULL,&size); if (rc == ERROR_MORE_DATA) { prompt = msi_alloc(size * sizeof(WCHAR)); MsiSourceListGetInfoW(package->ProductCode, NULL, - MSIINSTALLCONTEXT_USERUNMANAGED, MSICODE_PRODUCT, + package->Context, MSICODE_PRODUCT, INSTALLPROPERTY_DISKPROMPTW,prompt,&size); } else @@ -4286,7 +4323,7 @@ static UINT ACTION_RegisterUser(MSIPACKAGE *package) if (!productid) return ERROR_SUCCESS; - rc = MSIREG_OpenInstallPropertiesKey(package->ProductCode, &hkey, TRUE); + rc = MSIREG_OpenCurrentUserInstallProps(package->ProductCode, &hkey, TRUE); if (rc != ERROR_SUCCESS) goto end; @@ -5046,7 +5083,7 @@ static LONG env_set_flags( LPCWSTR *name, LPCWSTR *value, DWORD *flags ) static UINT ITERATE_WriteEnvironmentString( MSIRECORD *rec, LPVOID param ) { MSIPACKAGE *package = param; - LPCWSTR name, value, comp; + LPCWSTR name, value; LPWSTR data = NULL, newval = NULL; LPWSTR deformatted = NULL, ptr; DWORD flags, type, size; @@ -5066,7 +5103,6 @@ static UINT ITERATE_WriteEnvironmentString( MSIRECORD *rec, LPVOID param ) name = MSI_RecordGetString(rec, 2); value = MSI_RecordGetString(rec, 3); - comp = MSI_RecordGetString(rec, 4); res = env_set_flags(&name, &value, &flags); if (res != ERROR_SUCCESS) @@ -5519,6 +5555,169 @@ static UINT ACTION_MoveFiles( MSIPACKAGE *package ) return rc; } +static HRESULT (WINAPI *pCreateAssemblyCache)(IAssemblyCache **ppAsmCache, + DWORD dwReserved); +static HRESULT (WINAPI *pLoadLibraryShim)(LPCWSTR szDllName, LPCWSTR szVersion, + LPVOID pvReserved, HMODULE *phModDll); + +static BOOL init_functionpointers(void) +{ + HRESULT hr; + HMODULE hfusion; + HMODULE hmscoree; + + static const WCHAR szFusion[] = {'f','u','s','i','o','n','.','d','l','l',0}; + + hmscoree = LoadLibraryA("mscoree.dll"); + if (!hmscoree) + { + WARN("mscoree.dll not available\n"); + return FALSE; + } + + pLoadLibraryShim = (void *)GetProcAddress(hmscoree, "LoadLibraryShim"); + if (!pLoadLibraryShim) + { + WARN("LoadLibraryShim not available\n"); + FreeLibrary(hmscoree); + return FALSE; + } + + hr = pLoadLibraryShim(szFusion, NULL, NULL, &hfusion); + if (FAILED(hr)) + { + WARN("fusion.dll not available\n"); + FreeLibrary(hmscoree); + return FALSE; + } + + pCreateAssemblyCache = (void *)GetProcAddress(hfusion, "CreateAssemblyCache"); + + FreeLibrary(hmscoree); + return TRUE; +} + +static UINT install_assembly(LPWSTR path) +{ + IAssemblyCache *cache; + HRESULT hr; + UINT r = ERROR_FUNCTION_FAILED; + + if (!init_functionpointers() || !pCreateAssemblyCache) + return ERROR_FUNCTION_FAILED; + + hr = pCreateAssemblyCache(&cache, 0); + if (FAILED(hr)) + goto done; + + hr = IAssemblyCache_InstallAssembly(cache, 0, path, NULL); + if (FAILED(hr)) + ERR("Failed to install assembly: %s %08x\n", debugstr_w(path), hr); + + r = ERROR_SUCCESS; + +done: + IAssemblyCache_Release(cache); + return r; +} + +static UINT ITERATE_PublishAssembly( MSIRECORD *rec, LPVOID param ) +{ + MSIPACKAGE *package = param; + MSICOMPONENT *comp; + MSIFEATURE *feature; + MSIFILE *file; + WCHAR path[MAX_PATH]; + LPCWSTR app; + DWORD attr; + UINT r; + + comp = get_loaded_component(package, MSI_RecordGetString(rec, 1)); + if (!comp || !comp->Enabled || + !(comp->Action & (INSTALLSTATE_LOCAL | INSTALLSTATE_SOURCE))) + { + ERR("Component not set for install, not publishing assembly\n"); + return ERROR_SUCCESS; + } + + feature = find_feature_by_name(package, MSI_RecordGetString(rec, 2)); + if (feature) + msi_feature_set_state(feature, INSTALLSTATE_LOCAL); + + if (MSI_RecordGetString(rec, 3)) + FIXME("Manifest unhandled\n"); + + app = MSI_RecordGetString(rec, 4); + if (app) + { + FIXME("Assembly should be privately installed\n"); + return ERROR_SUCCESS; + } + + attr = MSI_RecordGetInteger(rec, 5); + if (attr == msidbAssemblyAttributesWin32) + { + FIXME("Win32 assemblies not handled\n"); + return ERROR_SUCCESS; + } + + /* FIXME: extract all files belonging to this component */ + file = msi_find_file(package, comp->KeyPath); + + GetTempPathW(MAX_PATH, path); + + if (file->IsCompressed) + { + r = msi_extract_file(package, file, path); + if (r != ERROR_SUCCESS) + { + ERR("Failed to extract temporary assembly\n"); + return r; + } + + PathAddBackslashW(path); + lstrcatW(path, file->FileName); + } + else + { + PathAddBackslashW(path); + lstrcatW(path, file->FileName); + + if (!CopyFileW(file->SourcePath, path, FALSE)) + { + ERR("Failed to copy temporary assembly: %d\n", GetLastError()); + return ERROR_FUNCTION_FAILED; + } + } + + r = install_assembly(path); + if (r != ERROR_SUCCESS) + ERR("Failed to install assembly\n"); + + /* FIXME: write Installer assembly reg values */ + + return r; +} + +static UINT ACTION_MsiPublishAssemblies( MSIPACKAGE *package ) +{ + UINT rc; + MSIQUERY *view; + + static const WCHAR ExecSeqQuery[] = + {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', + '`','M','s','i','A','s','s','e','m','b','l','y','`',0}; + + rc = MSI_DatabaseOpenViewW(package->db, ExecSeqQuery, &view); + if (rc != ERROR_SUCCESS) + return ERROR_SUCCESS; + + rc = MSI_IterateRecords(view, NULL, ITERATE_PublishAssembly, package); + msiobj_release(&view->hdr); + + return rc; +} + static UINT msi_unimplemented_action_stub( MSIPACKAGE *package, LPCSTR action, LPCWSTR table ) { @@ -5607,13 +5806,6 @@ static UINT ACTION_RemoveEnvironmentStrings( MSIPACKAGE *package ) return msi_unimplemented_action_stub( package, "RemoveEnvironmentStrings", table ); } -static UINT ACTION_MsiPublishAssemblies( MSIPACKAGE *package ) -{ - static const WCHAR table[] = { - 'M','s','i','A','s','s','e','m','b','l','y',0 }; - return msi_unimplemented_action_stub( package, "MsiPublishAssemblies", table ); -} - static UINT ACTION_MsiUnpublishAssemblies( MSIPACKAGE *package ) { static const WCHAR table[] = { diff --git a/reactos/dll/win32/msi/classes.c b/reactos/dll/win32/msi/classes.c index aca7c93204f..45254ef999a 100644 --- a/reactos/dll/win32/msi/classes.c +++ b/reactos/dll/win32/msi/classes.c @@ -971,6 +971,8 @@ static LPCWSTR get_clsid_of_progid( const MSIPROGID *progid ) { if (progid->Class) return progid->Class->clsid; + if (progid->Parent == progid) + break; progid = progid->Parent; } return NULL; diff --git a/reactos/dll/win32/msi/cond.tab.c b/reactos/dll/win32/msi/cond.tab.c index c9fe4923b24..e475ab6bdb6 100644 --- a/reactos/dll/win32/msi/cond.tab.c +++ b/reactos/dll/win32/msi/cond.tab.c @@ -218,13 +218,13 @@ static int cond_lex( void *COND_lval, COND_input *info); static const WCHAR szEmpty[] = { 0 }; static INT compare_int( INT a, INT operator, INT b ); -static INT compare_string( LPCWSTR a, INT operator, LPCWSTR b ); +static INT compare_string( LPCWSTR a, INT operator, LPCWSTR b, BOOL convert ); -static INT compare_and_free_strings( LPWSTR a, INT op, LPWSTR b ) +static INT compare_and_free_strings( LPWSTR a, INT op, LPWSTR b, BOOL convert ) { INT r; - r = compare_string( a, op, b ); + r = compare_string( a, op, b, convert ); msi_free( a ); msi_free( b ); return r; @@ -538,8 +538,8 @@ static const unsigned short int yyrline[] = 175, 182, 186, 190, 195, 199, 208, 217, 221, 225, 229, 233, 238, 243, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, - 267, 268, 272, 276, 283, 292, 296, 305, 314, 323, - 335, 342, 356, 365 + 267, 268, 272, 276, 283, 292, 296, 305, 314, 327, + 339, 346, 360, 369 }; #endif @@ -1467,28 +1467,28 @@ yyreduce: case 17: #line 218 "cond.y" { - (yyval.value) = compare_and_free_strings( (yyvsp[-2].string), (yyvsp[-1].value), (yyvsp[0].string) ); + (yyval.value) = compare_and_free_strings( (yyvsp[-2].string), (yyvsp[-1].value), (yyvsp[0].string), TRUE ); ;} break; case 18: #line 222 "cond.y" { - (yyval.value) = compare_and_free_strings( (yyvsp[-2].string), (yyvsp[-1].value), (yyvsp[0].string) ); + (yyval.value) = compare_and_free_strings( (yyvsp[-2].string), (yyvsp[-1].value), (yyvsp[0].string), TRUE ); ;} break; case 19: #line 226 "cond.y" { - (yyval.value) = compare_and_free_strings( (yyvsp[-2].string), (yyvsp[-1].value), (yyvsp[0].string) ); + (yyval.value) = compare_and_free_strings( (yyvsp[-2].string), (yyvsp[-1].value), (yyvsp[0].string), TRUE ); ;} break; case 20: #line 230 "cond.y" { - (yyval.value) = compare_and_free_strings( (yyvsp[-2].string), (yyvsp[-1].value), (yyvsp[0].string) ); + (yyval.value) = compare_and_free_strings( (yyvsp[-2].string), (yyvsp[-1].value), (yyvsp[0].string), FALSE ); ;} break; @@ -1666,13 +1666,17 @@ yyreduce: INSTALLSTATE install = INSTALLSTATE_UNKNOWN, action = INSTALLSTATE_UNKNOWN; MSI_GetFeatureStateW(cond->package, (yyvsp[0].string), &install, &action ); - (yyval.value) = action; + if (action == INSTALLSTATE_UNKNOWN) + (yyval.value) = MSICONDITION_FALSE; + else + (yyval.value) = action; + msi_free( (yyvsp[0].string) ); ;} break; case 49: -#line 324 "cond.y" +#line 328 "cond.y" { COND_input* cond = (COND_input*) info; INSTALLSTATE install = INSTALLSTATE_UNKNOWN, action = INSTALLSTATE_UNKNOWN; @@ -1684,7 +1688,7 @@ yyreduce: break; case 50: -#line 336 "cond.y" +#line 340 "cond.y" { COND_input* cond = (COND_input*) info; @@ -1694,7 +1698,7 @@ yyreduce: break; case 51: -#line 343 "cond.y" +#line 347 "cond.y" { UINT len = GetEnvironmentVariableW( (yyvsp[0].string), NULL, 0 ); (yyval.string) = NULL; @@ -1708,7 +1712,7 @@ yyreduce: break; case 52: -#line 357 "cond.y" +#line 361 "cond.y" { (yyval.string) = COND_GetString(&(yyvsp[0].str)); if( !(yyval.string) ) @@ -1717,7 +1721,7 @@ yyreduce: break; case 53: -#line 366 "cond.y" +#line 370 "cond.y" { LPWSTR szNum = COND_GetString(&(yyvsp[0].str)); if( !szNum ) @@ -1732,7 +1736,7 @@ yyreduce: } /* Line 1126 of yacc.c. */ -#line 1736 "cond.tab.c" +#line 1740 "cond.tab.c" yyvsp -= yylen; yyssp -= yylen; @@ -2000,7 +2004,7 @@ yyreturn: } -#line 375 "cond.y" +#line 379 "cond.y" @@ -2033,6 +2037,9 @@ static BOOL str_is_number( LPCWSTR str ) { int i; + if (!*str) + return FALSE; + for (i = 0; i < lstrlenW( str ); i++) if (!isdigitW(str[i])) return FALSE; @@ -2079,7 +2086,7 @@ static INT compare_substring( LPCWSTR a, INT operator, LPCWSTR b ) return 0; } -static INT compare_string( LPCWSTR a, INT operator, LPCWSTR b ) +static INT compare_string( LPCWSTR a, INT operator, LPCWSTR b, BOOL convert ) { if (operator >= COND_SS && operator <= COND_RHS) return compare_substring( a, operator, b ); @@ -2088,6 +2095,9 @@ static INT compare_string( LPCWSTR a, INT operator, LPCWSTR b ) if (!a) a = szEmpty; if (!b) b = szEmpty; + if (convert && str_is_number(a) && str_is_number(b)) + return compare_int( atoiW(a), operator, atoiW(b) ); + /* a or b may be NULL */ switch (operator) { diff --git a/reactos/dll/win32/msi/cond.y b/reactos/dll/win32/msi/cond.y index 062af07b4b5..7eb48c53b58 100644 --- a/reactos/dll/win32/msi/cond.y +++ b/reactos/dll/win32/msi/cond.y @@ -67,13 +67,13 @@ static int cond_lex( void *COND_lval, COND_input *info); static const WCHAR szEmpty[] = { 0 }; static INT compare_int( INT a, INT operator, INT b ); -static INT compare_string( LPCWSTR a, INT operator, LPCWSTR b ); +static INT compare_string( LPCWSTR a, INT operator, LPCWSTR b, BOOL convert ); -static INT compare_and_free_strings( LPWSTR a, INT op, LPWSTR b ) +static INT compare_and_free_strings( LPWSTR a, INT op, LPWSTR b, BOOL convert ) { INT r; - r = compare_string( a, op, b ); + r = compare_string( a, op, b, convert ); msi_free( a ); msi_free( b ); return r; @@ -216,19 +216,19 @@ boolean_factor: } | symbol_s operator symbol_s { - $$ = compare_and_free_strings( $1, $2, $3 ); + $$ = compare_and_free_strings( $1, $2, $3, TRUE ); } | symbol_s operator literal { - $$ = compare_and_free_strings( $1, $2, $3 ); + $$ = compare_and_free_strings( $1, $2, $3, TRUE ); } | literal operator symbol_s { - $$ = compare_and_free_strings( $1, $2, $3 ); + $$ = compare_and_free_strings( $1, $2, $3, TRUE ); } | literal operator literal { - $$ = compare_and_free_strings( $1, $2, $3 ); + $$ = compare_and_free_strings( $1, $2, $3, FALSE ); } | literal operator value_i { @@ -408,6 +408,9 @@ static BOOL str_is_number( LPCWSTR str ) { int i; + if (!*str) + return FALSE; + for (i = 0; i < lstrlenW( str ); i++) if (!isdigitW(str[i])) return FALSE; @@ -454,7 +457,7 @@ static INT compare_substring( LPCWSTR a, INT operator, LPCWSTR b ) return 0; } -static INT compare_string( LPCWSTR a, INT operator, LPCWSTR b ) +static INT compare_string( LPCWSTR a, INT operator, LPCWSTR b, BOOL convert ) { if (operator >= COND_SS && operator <= COND_RHS) return compare_substring( a, operator, b ); @@ -463,6 +466,9 @@ static INT compare_string( LPCWSTR a, INT operator, LPCWSTR b ) if (!a) a = szEmpty; if (!b) b = szEmpty; + if (convert && str_is_number(a) && str_is_number(b)) + return compare_int( atoiW(a), operator, atoiW(b) ); + /* a or b may be NULL */ switch (operator) { diff --git a/reactos/dll/win32/msi/custom.c b/reactos/dll/win32/msi/custom.c index 316fe5a851f..71864d519db 100644 --- a/reactos/dll/win32/msi/custom.c +++ b/reactos/dll/win32/msi/custom.c @@ -18,6 +18,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "config.h" +#include "wine/port.h" + #define COBJMACROS #include diff --git a/reactos/dll/win32/msi/dialog.c b/reactos/dll/win32/msi/dialog.c index 035d7f54cf3..0e5799f882c 100644 --- a/reactos/dll/win32/msi/dialog.c +++ b/reactos/dll/win32/msi/dialog.c @@ -2055,7 +2055,8 @@ static UINT msi_dialog_seltree_handler( msi_dialog *dialog, LPNMTREEVIEWW tv = (LPNMTREEVIEWW)param; MSIRECORD *row, *rec; MSIFOLDER *folder; - LPCWSTR dir; + MSIFEATURE *feature; + LPCWSTR dir, title = NULL; UINT r = ERROR_SUCCESS; static const WCHAR select[] = { @@ -2069,7 +2070,16 @@ static UINT msi_dialog_seltree_handler( msi_dialog *dialog, info->selected = tv->itemNew.hItem; - row = MSI_QueryGetRecord( dialog->package->db, select, tv->itemNew.pszText ); + if (!(tv->itemNew.mask & TVIF_TEXT)) + { + feature = msi_seltree_feature_from_item( control->hwnd, tv->itemNew.hItem ); + if (feature) + title = feature->Title; + } + else + title = tv->itemNew.pszText; + + row = MSI_QueryGetRecord( dialog->package->db, select, title ); if (!row) return ERROR_FUNCTION_FAILED; @@ -3472,6 +3482,9 @@ msi_dialog *msi_dialog_create( MSIPACKAGE* package, TRACE("%p %s\n", package, debugstr_w(szDialogName)); + if (!hMsiHiddenWindow) + msi_dialog_register_class(); + /* allocate the structure for the dialog to use */ dialog = msi_alloc_zero( sizeof *dialog + sizeof(WCHAR)*strlenW(szDialogName) ); if( !dialog ) diff --git a/reactos/dll/win32/msi/files.c b/reactos/dll/win32/msi/files.c index e0f78892738..d2bef7c8190 100644 --- a/reactos/dll/win32/msi/files.c +++ b/reactos/dll/win32/msi/files.c @@ -57,20 +57,7 @@ extern const WCHAR szRemoveFiles[]; static const WCHAR cszTempFolder[]= {'T','e','m','p','F','o','l','d','e','r',0}; -struct media_info { - UINT disk_id; - UINT type; - UINT last_sequence; - LPWSTR disk_prompt; - LPWSTR cabinet; - LPWSTR first_volume; - LPWSTR volume_label; - BOOL is_continuous; - BOOL is_extracted; - WCHAR source[MAX_PATH]; -}; - -static BOOL source_matches_volume(struct media_info *mi, LPWSTR source_root) +static BOOL source_matches_volume(MSIMEDIAINFO *mi, LPWSTR source_root) { WCHAR volume_name[MAX_PATH + 1]; @@ -84,7 +71,7 @@ static BOOL source_matches_volume(struct media_info *mi, LPWSTR source_root) return !lstrcmpW(mi->volume_label, volume_name); } -static UINT msi_change_media( MSIPACKAGE *package, struct media_info *mi ) +static UINT msi_change_media( MSIPACKAGE *package, MSIMEDIAINFO *mi ) { LPSTR msg; LPWSTR error, error_dialog; @@ -169,7 +156,7 @@ end: typedef struct { MSIPACKAGE* package; - struct media_info *mi; + MSIMEDIAINFO *mi; } CabData; static void * cabinet_alloc(ULONG cb) @@ -265,7 +252,7 @@ static void msi_file_update_ui( MSIPACKAGE *package, MSIFILE *f, const WCHAR *ac ui_progress( package, 2, f->FileSize, 0, 0); } -static UINT msi_media_get_disk_info( MSIPACKAGE *package, struct media_info *mi ) +static UINT msi_media_get_disk_info( MSIPACKAGE *package, MSIMEDIAINFO *mi ) { MSIRECORD *row; LPWSTR ptr; @@ -311,7 +298,7 @@ static INT_PTR cabinet_notify(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pfdin) case fdintNEXT_CABINET: { CabData *data = (CabData *)pfdin->pv; - struct media_info *mi = data->mi; + MSIMEDIAINFO *mi = data->mi; LPWSTR cab = strdupAtoW(pfdin->psz1); UINT rc; @@ -423,18 +410,18 @@ static INT_PTR cabinet_notify(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pfdin) } /*********************************************************************** - * extract_cabinet_file + * msi_cabextract * * Extract files from a cab file. */ -static BOOL extract_cabinet_file(MSIPACKAGE* package, struct media_info *mi) +BOOL msi_cabextract(MSIPACKAGE* package, MSIMEDIAINFO *mi, + PFNFDINOTIFY notify, LPVOID data) { LPSTR cabinet, cab_path = NULL; LPWSTR ptr; HFDI hfdi; ERF erf; BOOL ret = FALSE; - CabData data; TRACE("Extracting %s\n", debugstr_w(mi->source)); @@ -457,10 +444,7 @@ static BOOL extract_cabinet_file(MSIPACKAGE* package, struct media_info *mi) cab_path[ptr - mi->source] = '\0'; - data.package = package; - data.mi = mi; - - ret = FDICopy(hfdi, cabinet, cab_path, 0, cabinet_notify, NULL, &data); + ret = FDICopy(hfdi, cabinet, cab_path, 0, notify, NULL, data); if (!ret) ERR("FDICopy failed\n"); @@ -495,7 +479,7 @@ static VOID set_file_source(MSIPACKAGE* package, MSIFILE* file, LPCWSTR path) file->SourcePath = build_directory_name(2, path, file->File); } -static void free_media_info( struct media_info *mi ) +void msi_free_media_info( MSIMEDIAINFO *mi ) { msi_free( mi->disk_prompt ); msi_free( mi->cabinet ); @@ -504,7 +488,7 @@ static void free_media_info( struct media_info *mi ) msi_free( mi ); } -static UINT load_media_info(MSIPACKAGE *package, MSIFILE *file, struct media_info *mi) +UINT msi_load_media_info(MSIPACKAGE *package, MSIFILE *file, MSIMEDIAINFO *mi) { MSIRECORD *row; LPWSTR source_dir; @@ -581,11 +565,11 @@ static UINT load_media_info(MSIPACKAGE *package, MSIFILE *file, struct media_inf } if (mi->type == DRIVE_CDROM || mi->type == DRIVE_REMOVABLE) - msi_package_add_media_disk(package, MSIINSTALLCONTEXT_USERUNMANAGED, + msi_package_add_media_disk(package, package->Context, MSICODE_PRODUCT, mi->disk_id, mi->volume_label, mi->disk_prompt); - msi_package_add_info(package, MSIINSTALLCONTEXT_USERUNMANAGED, + msi_package_add_info(package, package->Context, options, INSTALLPROPERTY_LASTUSEDSOURCEW, source); msi_free(source_dir); @@ -593,7 +577,7 @@ static UINT load_media_info(MSIPACKAGE *package, MSIFILE *file, struct media_inf } /* FIXME: search NETWORK and URL sources as well */ -static UINT find_published_source(MSIPACKAGE *package, struct media_info *mi) +static UINT find_published_source(MSIPACKAGE *package, MSIMEDIAINFO *mi) { WCHAR source[MAX_PATH]; WCHAR volume[MAX_PATH]; @@ -603,7 +587,7 @@ static UINT find_published_source(MSIPACKAGE *package, struct media_info *mi) UINT r; r = MsiSourceListGetInfoW(package->ProductCode, NULL, - MSIINSTALLCONTEXT_USERUNMANAGED, MSICODE_PRODUCT, + package->Context, MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCEW, source, &size); if (r != ERROR_SUCCESS) return r; @@ -612,7 +596,7 @@ static UINT find_published_source(MSIPACKAGE *package, struct media_info *mi) volumesz = MAX_PATH; promptsz = MAX_PATH; while (MsiSourceListEnumMediaDisksW(package->ProductCode, NULL, - MSIINSTALLCONTEXT_USERUNMANAGED, + package->Context, MSICODE_PRODUCT, index++, &id, volume, &volumesz, prompt, &promptsz) == ERROR_SUCCESS) { @@ -634,7 +618,7 @@ static UINT find_published_source(MSIPACKAGE *package, struct media_info *mi) return ERROR_FUNCTION_FAILED; } -static UINT ready_media(MSIPACKAGE *package, MSIFILE *file, struct media_info *mi) +static UINT ready_media(MSIPACKAGE *package, MSIFILE *file, MSIMEDIAINFO *mi) { UINT rc = ERROR_SUCCESS; @@ -642,7 +626,7 @@ static UINT ready_media(MSIPACKAGE *package, MSIFILE *file, struct media_info *m if (mi->is_continuous) return ERROR_SUCCESS; - rc = load_media_info(package, file, mi); + rc = msi_load_media_info(package, file, mi); if (rc != ERROR_SUCCESS) { ERR("Unable to load media info\n"); @@ -808,7 +792,7 @@ static BOOL check_dest_hash_matches(MSIFILE *file) */ UINT ACTION_InstallFiles(MSIPACKAGE *package) { - struct media_info *mi; + MSIMEDIAINFO *mi; UINT rc = ERROR_SUCCESS; MSIFILE *file; @@ -825,7 +809,7 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package) */ msi_create_component_directories( package ); - mi = msi_alloc_zero( sizeof(struct media_info) ); + mi = msi_alloc_zero( sizeof(MSIMEDIAINFO) ); LIST_FOR_EACH_ENTRY( file, &package->files, MSIFILE, entry ) { @@ -841,6 +825,8 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package) if (file->Sequence > mi->last_sequence || mi->is_continuous || (file->IsCompressed && !mi->is_extracted)) { + CabData data; + rc = ready_media(package, file, mi); if (rc != ERROR_SUCCESS) { @@ -848,7 +834,11 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package) break; } - if (file->IsCompressed && !extract_cabinet_file(package, mi)) + data.mi = mi; + data.package = package; + + if (file->IsCompressed && + !msi_cabextract(package, mi, cabinet_notify, &data)) { ERR("Failed to extract cabinet: %s\n", debugstr_w(mi->cabinet)); rc = ERROR_FUNCTION_FAILED; @@ -881,7 +871,7 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package) } } - free_media_info( mi ); + msi_free_media_info( mi ); return rc; } diff --git a/reactos/dll/win32/msi/format.c b/reactos/dll/win32/msi/format.c index f58f51745b0..454142ad7ce 100644 --- a/reactos/dll/win32/msi/format.c +++ b/reactos/dll/win32/msi/format.c @@ -921,28 +921,13 @@ UINT WINAPI MsiFormatRecordW( MSIHANDLE hInstall, MSIHANDLE hRecord, HRESULT hr; IWineMsiRemotePackage *remote_package; BSTR value = NULL; - DWORD len; awstring wstr; remote_package = (IWineMsiRemotePackage *)msi_get_remote( hInstall ); if (remote_package) { - len = 0; hr = IWineMsiRemotePackage_FormatRecord( remote_package, hRecord, - NULL, &len ); - if (FAILED(hr)) - goto done; - - len++; - value = SysAllocStringLen( NULL, len ); - if (!value) - { - r = ERROR_OUTOFMEMORY; - goto done; - } - - hr = IWineMsiRemotePackage_FormatRecord( remote_package, hRecord, - value, &len ); + &value ); if (FAILED(hr)) goto done; diff --git a/reactos/dll/win32/msi/helpers.c b/reactos/dll/win32/msi/helpers.c index 90055a1109d..223cacd5ad2 100644 --- a/reactos/dll/win32/msi/helpers.c +++ b/reactos/dll/win32/msi/helpers.c @@ -19,7 +19,7 @@ */ /* - * Here are helper functions formally in action.c that are used by a variaty of + * Here are helper functions formally in action.c that are used by a variety of * actions and functions. */ @@ -31,6 +31,8 @@ #include "wine/debug.h" #include "msipriv.h" #include "winuser.h" +#include "winreg.h" +#include "shlwapi.h" #include "wine/unicode.h" #include "msidefs.h" @@ -885,7 +887,7 @@ LPWSTR create_component_advertise_string(MSIPACKAGE* package, return output; } -/* update compoennt state based on a feature change */ +/* update component state based on a feature change */ void ACTION_UpdateComponentStates(MSIPACKAGE *package, LPCWSTR szFeature) { INSTALLSTATE newstate; @@ -1054,3 +1056,122 @@ void msi_ui_error( DWORD msg_id, DWORD type ) MessageBoxW( NULL, text, title, type ); } + +typedef struct +{ + MSIPACKAGE *package; + MSIMEDIAINFO *mi; + MSIFILE *file; + LPWSTR destination; +} CabData; + +static INT_PTR cabinet_notify(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pfdin) +{ + TRACE("(%d)\n", fdint); + + switch (fdint) + { + case fdintNEXT_CABINET: + { + ERR("continuous cabinets not handled\n"); + return 0; + } + + case fdintCOPY_FILE: + { + CabData *data = (CabData*) pfdin->pv; + LPWSTR file, path; + DWORD attrs, size; + HANDLE handle; + MSIFILE *f; + + file = strdupAtoW(pfdin->psz1); + f = get_loaded_file(data->package, file); + msi_free(file); + + if (!f) + { + WARN("unknown file in cabinet (%s)\n",debugstr_a(pfdin->psz1)); + return 0; + } + + if (lstrcmpW(f->File, data->file->File)) + return 0; + + size = lstrlenW(data->destination) + lstrlenW(data->file->FileName) + 2; + path = msi_alloc(size * sizeof(WCHAR)); + lstrcpyW(path, data->destination); + PathAddBackslashW(path); + lstrcatW(path, data->file->FileName); + + TRACE("extracting %s\n", debugstr_w(path)); + + attrs = f->Attributes & (FILE_ATTRIBUTE_READONLY|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_SYSTEM); + if (!attrs) attrs = FILE_ATTRIBUTE_NORMAL; + + handle = CreateFileW(path, GENERIC_READ | GENERIC_WRITE, 0, + NULL, CREATE_ALWAYS, attrs, NULL); + if (handle == INVALID_HANDLE_VALUE) + { + if (GetFileAttributesW(path) == INVALID_FILE_ATTRIBUTES) + ERR("failed to create %s (error %d)\n", + debugstr_w(path), GetLastError()); + + msi_free(path); + return 0; + } + + msi_free(path); + return (INT_PTR)handle; + } + + case fdintCLOSE_FILE_INFO: + { + FILETIME ft; + FILETIME ftLocal; + HANDLE handle = (HANDLE)pfdin->hf; + + if (!DosDateTimeToFileTime(pfdin->date, pfdin->time, &ft)) + return -1; + if (!LocalFileTimeToFileTime(&ft, &ftLocal)) + return -1; + if (!SetFileTime(handle, &ftLocal, 0, &ftLocal)) + return -1; + CloseHandle(handle); + return 1; + } + + default: + return 0; + } +} + +UINT msi_extract_file(MSIPACKAGE *package, MSIFILE *file, LPWSTR destdir) +{ + MSIMEDIAINFO *mi; + CabData data; + UINT r; + + mi = msi_alloc_zero(sizeof(MSIMEDIAINFO)); + if (!mi) + return ERROR_OUTOFMEMORY; + + r = msi_load_media_info(package, file, mi); + if (r != ERROR_SUCCESS) + goto done; + + data.package = package; + data.mi = mi; + data.file = file; + data.destination = destdir; + + if (!msi_cabextract(package, mi, cabinet_notify, &data)) + { + ERR("Failed to extract cabinet file\n"); + r = ERROR_FUNCTION_FAILED; + } + +done: + msi_free_media_info(mi); + return r; +} diff --git a/reactos/dll/win32/msi/install.c b/reactos/dll/win32/msi/install.c index 999840dae05..64154592ef1 100644 --- a/reactos/dll/win32/msi/install.c +++ b/reactos/dll/win32/msi/install.c @@ -1169,15 +1169,16 @@ UINT MSI_SetInstallLevel( MSIPACKAGE *package, int iInstallLevel ) TRACE("%p %i\n", package, iInstallLevel); - if (iInstallLevel<1 || iInstallLevel>32767) + if (iInstallLevel > 32767) return ERROR_INVALID_PARAMETER; + if (iInstallLevel < 1) + return MSI_SetFeatureStates( package ); + sprintfW( level, fmt, iInstallLevel ); r = MSI_SetPropertyW( package, szInstallLevel, level ); if ( r == ERROR_SUCCESS ) - { r = MSI_SetFeatureStates( package ); - } return r; } diff --git a/reactos/dll/win32/msi/msi.c b/reactos/dll/win32/msi/msi.c index 32a41732eb7..1aaf4d93121 100644 --- a/reactos/dll/win32/msi/msi.c +++ b/reactos/dll/win32/msi/msi.c @@ -630,7 +630,7 @@ static UINT WINAPI MSI_GetProductInfo(LPCWSTR szProduct, LPCWSTR szAttribute, if (classes) MSIREG_OpenLocalSystemProductKey(szProduct, &userdata, FALSE); else - MSIREG_OpenInstallPropertiesKey(szProduct, &userdata, FALSE); + MSIREG_OpenCurrentUserInstallProps(szProduct, &userdata, FALSE); if (!lstrcmpW(szAttribute, INSTALLPROPERTY_HELPLINKW) || !lstrcmpW(szAttribute, INSTALLPROPERTY_HELPTELEPHONEW) || @@ -939,7 +939,7 @@ UINT WINAPI MsiGetProductInfoExW(LPCWSTR szProductCode, LPCWSTR szUserSid, if (dwContext == MSIINSTALLCONTEXT_USERUNMANAGED) { package = INSTALLPROPERTY_LOCALPACKAGEW; - MSIREG_OpenInstallPropertiesKey(szProductCode, &props, FALSE); + MSIREG_OpenCurrentUserInstallProps(szProductCode, &props, FALSE); if (!props && !prod) goto done; @@ -947,7 +947,7 @@ UINT WINAPI MsiGetProductInfoExW(LPCWSTR szProductCode, LPCWSTR szUserSid, else if (dwContext == MSIINSTALLCONTEXT_USERMANAGED) { package = managed_local_package; - MSIREG_OpenInstallPropertiesKey(szProductCode, &props, FALSE); + MSIREG_OpenCurrentUserInstallProps(szProductCode, &props, FALSE); if (!props && !managed) goto done; @@ -1066,7 +1066,7 @@ UINT WINAPI MsiGetProductInfoExW(LPCWSTR szProductCode, LPCWSTR szUserSid, if (!prod && !classes) goto done; - /* FIME */ + /* FIXME */ val = strdupW(empty); r = msi_copy_outval(val, szValue, pcchValue); } @@ -1197,7 +1197,7 @@ static BOOL msi_comp_find_package(LPCWSTR prodcode, MSIINSTALLCONTEXT context) if (context == MSIINSTALLCONTEXT_MACHINE) r = MSIREG_OpenLocalSystemProductKey(prodcode, &hkey, FALSE); else - r = MSIREG_OpenInstallPropertiesKey(prodcode, &hkey, FALSE); + r = MSIREG_OpenCurrentUserInstallProps(prodcode, &hkey, FALSE); if (r != ERROR_SUCCESS) return FALSE; @@ -1303,57 +1303,67 @@ INSTALLSTATE WINAPI MsiQueryProductStateA(LPCSTR szProduct) INSTALLSTATE WINAPI MsiQueryProductStateW(LPCWSTR szProduct) { - UINT rc; - INSTALLSTATE state = INSTALLSTATE_UNKNOWN; - HKEY hkey = 0, props = 0; - DWORD sz; - BOOL userkey_exists = FALSE; + INSTALLSTATE state = INSTALLSTATE_ADVERTISED; + HKEY prodkey = 0, userdata = 0; + BOOL user = TRUE; + DWORD val; + UINT r; - static const int GUID_LEN = 38; - static const WCHAR szInstallProperties[] = { - 'I','n','s','t','a','l','l','P','r','o','p','e','r','t','i','e','s',0 - }; static const WCHAR szWindowsInstaller[] = { - 'W','i','n','d','o','w','s','I','n','s','t','a','l','l','e','r',0 - }; + 'W','i','n','d','o','w','s','I','n','s','t','a','l','l','e','r',0}; TRACE("%s\n", debugstr_w(szProduct)); - if (!szProduct || !*szProduct || lstrlenW(szProduct) != GUID_LEN) + if (!szProduct || !*szProduct) return INSTALLSTATE_INVALIDARG; - rc = MSIREG_OpenUserProductsKey(szProduct,&hkey,FALSE); - if (rc == ERROR_SUCCESS) + if (lstrlenW(szProduct) != GUID_SIZE - 1) + return INSTALLSTATE_INVALIDARG; + + r = MSIREG_OpenLocalManagedProductKey(szProduct, &prodkey, FALSE); + if (r != ERROR_SUCCESS) { - userkey_exists = TRUE; - state = INSTALLSTATE_ADVERTISED; - RegCloseKey(hkey); + r = MSIREG_OpenUserProductsKey(szProduct, &prodkey, FALSE); + if (r != ERROR_SUCCESS) + { + r = MSIREG_OpenLocalClassesProductKey(szProduct, &prodkey, FALSE); + if (r == ERROR_SUCCESS) + user = FALSE; + } } - rc = MSIREG_OpenUserDataProductKey(szProduct,&hkey,FALSE); - if (rc != ERROR_SUCCESS) - goto end; + if (user) + { + r = MSIREG_OpenCurrentUserInstallProps(szProduct, &userdata, FALSE); + if (r != ERROR_SUCCESS) + goto done; + } + else + { + r = MSIREG_OpenLocalSystemInstallProps(szProduct, &userdata, FALSE); + if (r != ERROR_SUCCESS) + goto done; + } - rc = RegOpenKeyW(hkey, szInstallProperties, &props); - if (rc != ERROR_SUCCESS) - goto end; + if (!msi_reg_get_val_dword(userdata, szWindowsInstaller, &val)) + goto done; - sz = sizeof(state); - rc = RegQueryValueExW(props,szWindowsInstaller,NULL,NULL,(LPVOID)&state, &sz); - if (rc != ERROR_SUCCESS) - goto end; - - if (state) + if (val) state = INSTALLSTATE_DEFAULT; else state = INSTALLSTATE_UNKNOWN; - if (state == INSTALLSTATE_DEFAULT && !userkey_exists) - state = INSTALLSTATE_ABSENT; +done: + if (!prodkey) + { + state = INSTALLSTATE_UNKNOWN; -end: - RegCloseKey(props); - RegCloseKey(hkey); + if (userdata) + state = INSTALLSTATE_ABSENT; + } + + RegCloseKey(prodkey); + RegCloseKey(userdata); return state; } @@ -1786,7 +1796,7 @@ end: * szFeature [I] Feature's GUID string * * RETURNS - * INSTALLSTATE_LOCAL Feature is installed and useable + * INSTALLSTATE_LOCAL Feature is installed and usable * INSTALLSTATE_ABSENT Feature is absent * INSTALLSTATE_ADVERTISED Feature should be installed on demand * INSTALLSTATE_UNKNOWN An error occurred diff --git a/reactos/dll/win32/msi/msi.rbuild b/reactos/dll/win32/msi/msi.rbuild index db4ca99f133..49cc291666b 100644 --- a/reactos/dll/win32/msi/msi.rbuild +++ b/reactos/dll/win32/msi/msi.rbuild @@ -54,6 +54,7 @@ . msi.spec wine + uuid urlmon wininet comctl32 @@ -68,15 +69,14 @@ advapi32 kernel32 odbccp32 - uuid ntdll - msiserver - msiheader + msi_msiserver_typelib + msi_msiserver_header - + msiserver.idl - + msiserver.idl diff --git a/reactos/dll/win32/msi/msi.rc b/reactos/dll/win32/msi/msi.rc index d9ac96db8e6..b5aef603aef 100644 --- a/reactos/dll/win32/msi/msi.rc +++ b/reactos/dll/win32/msi/msi.rc @@ -28,6 +28,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL #include "version.rc" #include "msi_Bg.rc" +#include "msi_Da.rc" #include "msi_De.rc" #include "msi_En.rc" #include "msi_Eo.rc" @@ -42,11 +43,13 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL #include "msi_Pl.rc" #include "msi_Pt.rc" #include "msi_Ru.rc" +#include "msi_Si.rc" #include "msi_Sv.rc" #include "msi_Tr.rc" LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL +/* @makedep: msiserver.tlb */ 1 TYPELIB LOADONCALL DISCARDABLE msiserver.tlb /* @makedep: instadvert.bmp */ diff --git a/reactos/dll/win32/msi/msi_Da.rc b/reactos/dll/win32/msi/msi_Da.rc new file mode 100644 index 00000000000..0fd1af07ee0 --- /dev/null +++ b/reactos/dll/win32/msi/msi_Da.rc @@ -0,0 +1,34 @@ +/* + * Danish language support + * + * Copyright (C) 2008 Jens Albretsen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +LANGUAGE LANG_DANISH, SUBLANG_DEFAULT + +STRINGTABLE DISCARDABLE +{ + 4 "Kunne ikke åbne den specificerede installationspakke. Kontroller stien og prøv igen." + 5 "kunne ikke finden stien '%s'." + 9 "indsæt disk '%s'" + 10 "forkerte parametere." + 11 "angiv kataloget som indeholder '%s'." + 12 "featurens installationskilde mangler." + 13 "featurens netværksdrev mangler." + 14 "feature fra:" + 15 "Vælg kataloget som indeholder '%s'." +} diff --git a/reactos/dll/win32/msi/msi_Si.rc b/reactos/dll/win32/msi/msi_Si.rc new file mode 100644 index 00000000000..bf92697d2ef --- /dev/null +++ b/reactos/dll/win32/msi/msi_Si.rc @@ -0,0 +1,38 @@ +/* + * Slovenian resources for MSI + * + * Copyright 2008 Rok Mandeljc + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#pragma code_page(65001) + +LANGUAGE LANG_SLOVENIAN, SUBLANG_DEFAULT + +STRINGTABLE DISCARDABLE +{ + 4 "Navedenega namestitvenega paketa ni mogoÄe odpreti. Preverite ime datoteke in poskusite znova." + 5 "pot %s ne obstaja" + 9 "vnesite disk %s" + 10 "neveljavni parametri" + 11 "vnesite ime mape, ki vsebuje %s" + 12 "manjkajoÄ namestitveni vir za namestitev funkcije" + 13 "manjkajoÄ omrežni pogon za namestitev funkcijo" + 14 "funkcija z:" + 15 "izberite mapo, ki vsebuje %s" +} + +#pragma code_page(default) diff --git a/reactos/dll/win32/msi/msi_main.c b/reactos/dll/win32/msi/msi_main.c index 2c32b3bc3f9..25fb18b0fc6 100644 --- a/reactos/dll/win32/msi/msi_main.c +++ b/reactos/dll/win32/msi/msi_main.c @@ -72,7 +72,6 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) case DLL_PROCESS_ATTACH: msi_hInstance = hinstDLL; DisableThreadLibraryCalls(hinstDLL); - msi_dialog_register_class(); break; case DLL_PROCESS_DETACH: if (msi_typelib) ITypeLib_Release( msi_typelib ); diff --git a/reactos/dll/win32/msi/msi_ros.diff b/reactos/dll/win32/msi/msi_ros.diff index e85c5b2a75e..1e88f29fb3f 100644 --- a/reactos/dll/win32/msi/msi_ros.diff +++ b/reactos/dll/win32/msi/msi_ros.diff @@ -2,7 +2,7 @@ Index: cond.tab.c =================================================================== --- cond.tab.c (revision 31639) +++ cond.tab.c (working copy) -@@ -0,0 +1,2429 @@ +@@ -0,0 +1,2439 @@ +/* A Bison parser, made by GNU Bison 2.1. */ + +/* Skeleton parser for Yacc-like parsing with Bison, @@ -223,13 +223,13 @@ Index: cond.tab.c +static const WCHAR szEmpty[] = { 0 }; + +static INT compare_int( INT a, INT operator, INT b ); -+static INT compare_string( LPCWSTR a, INT operator, LPCWSTR b ); ++static INT compare_string( LPCWSTR a, INT operator, LPCWSTR b, BOOL convert ); + -+static INT compare_and_free_strings( LPWSTR a, INT op, LPWSTR b ) ++static INT compare_and_free_strings( LPWSTR a, INT op, LPWSTR b, BOOL convert ) +{ + INT r; + -+ r = compare_string( a, op, b ); ++ r = compare_string( a, op, b, convert ); + msi_free( a ); + msi_free( b ); + return r; @@ -543,8 +543,8 @@ Index: cond.tab.c + 175, 182, 186, 190, 195, 199, 208, 217, 221, 225, + 229, 233, 238, 243, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, -+ 267, 268, 272, 276, 283, 292, 296, 305, 314, 323, -+ 335, 342, 356, 365 ++ 267, 268, 272, 276, 283, 292, 296, 305, 314, 327, ++ 339, 346, 360, 369 +}; +#endif + @@ -1472,28 +1472,28 @@ Index: cond.tab.c + case 17: +#line 218 "cond.y" + { -+ (yyval.value) = compare_and_free_strings( (yyvsp[-2].string), (yyvsp[-1].value), (yyvsp[0].string) ); ++ (yyval.value) = compare_and_free_strings( (yyvsp[-2].string), (yyvsp[-1].value), (yyvsp[0].string), TRUE ); + ;} + break; + + case 18: +#line 222 "cond.y" + { -+ (yyval.value) = compare_and_free_strings( (yyvsp[-2].string), (yyvsp[-1].value), (yyvsp[0].string) ); ++ (yyval.value) = compare_and_free_strings( (yyvsp[-2].string), (yyvsp[-1].value), (yyvsp[0].string), TRUE ); + ;} + break; + + case 19: +#line 226 "cond.y" + { -+ (yyval.value) = compare_and_free_strings( (yyvsp[-2].string), (yyvsp[-1].value), (yyvsp[0].string) ); ++ (yyval.value) = compare_and_free_strings( (yyvsp[-2].string), (yyvsp[-1].value), (yyvsp[0].string), TRUE ); + ;} + break; + + case 20: +#line 230 "cond.y" + { -+ (yyval.value) = compare_and_free_strings( (yyvsp[-2].string), (yyvsp[-1].value), (yyvsp[0].string) ); ++ (yyval.value) = compare_and_free_strings( (yyvsp[-2].string), (yyvsp[-1].value), (yyvsp[0].string), FALSE ); + ;} + break; + @@ -1671,13 +1671,17 @@ Index: cond.tab.c + INSTALLSTATE install = INSTALLSTATE_UNKNOWN, action = INSTALLSTATE_UNKNOWN; + + MSI_GetFeatureStateW(cond->package, (yyvsp[0].string), &install, &action ); -+ (yyval.value) = action; ++ if (action == INSTALLSTATE_UNKNOWN) ++ (yyval.value) = MSICONDITION_FALSE; ++ else ++ (yyval.value) = action; ++ + msi_free( (yyvsp[0].string) ); + ;} + break; + + case 49: -+#line 324 "cond.y" ++#line 328 "cond.y" + { + COND_input* cond = (COND_input*) info; + INSTALLSTATE install = INSTALLSTATE_UNKNOWN, action = INSTALLSTATE_UNKNOWN; @@ -1689,7 +1693,7 @@ Index: cond.tab.c + break; + + case 50: -+#line 336 "cond.y" ++#line 340 "cond.y" + { + COND_input* cond = (COND_input*) info; + @@ -1699,7 +1703,7 @@ Index: cond.tab.c + break; + + case 51: -+#line 343 "cond.y" ++#line 347 "cond.y" + { + UINT len = GetEnvironmentVariableW( (yyvsp[0].string), NULL, 0 ); + (yyval.string) = NULL; @@ -1713,7 +1717,7 @@ Index: cond.tab.c + break; + + case 52: -+#line 357 "cond.y" ++#line 361 "cond.y" + { + (yyval.string) = COND_GetString(&(yyvsp[0].str)); + if( !(yyval.string) ) @@ -1722,7 +1726,7 @@ Index: cond.tab.c + break; + + case 53: -+#line 366 "cond.y" ++#line 370 "cond.y" + { + LPWSTR szNum = COND_GetString(&(yyvsp[0].str)); + if( !szNum ) @@ -1737,7 +1741,7 @@ Index: cond.tab.c + } + +/* Line 1126 of yacc.c. */ -+#line 1736 "cond.tab.c" ++#line 1740 "cond.tab.c" + + yyvsp -= yylen; + yyssp -= yylen; @@ -2005,7 +2009,7 @@ Index: cond.tab.c +} + + -+#line 375 "cond.y" ++#line 379 "cond.y" + + + @@ -2038,6 +2042,9 @@ Index: cond.tab.c +{ + int i; + ++ if (!*str) ++ return FALSE; ++ + for (i = 0; i < lstrlenW( str ); i++) + if (!isdigitW(str[i])) + return FALSE; @@ -2084,7 +2091,7 @@ Index: cond.tab.c + return 0; +} + -+static INT compare_string( LPCWSTR a, INT operator, LPCWSTR b ) ++static INT compare_string( LPCWSTR a, INT operator, LPCWSTR b, BOOL convert ) +{ + if (operator >= COND_SS && operator <= COND_RHS) + return compare_substring( a, operator, b ); @@ -2093,6 +2100,9 @@ Index: cond.tab.c + if (!a) a = szEmpty; + if (!b) b = szEmpty; + ++ if (convert && str_is_number(a) && str_is_number(b)) ++ return compare_int( atoiW(a), operator, atoiW(b) ); ++ + /* a or b may be NULL */ + switch (operator) + { @@ -2623,7 +2633,7 @@ Index: sql.tab.c =================================================================== --- sql.tab.c (revision 31639) +++ sql.tab.c (working copy) -@@ -0,0 +1,2580 @@ +@@ -0,0 +1,2579 @@ +/* A Bison parser, made by GNU Bison 2.1. */ + +/* Skeleton parser for Yacc-like parsing with Bison, @@ -3188,13 +3198,13 @@ Index: sql.tab.c +static const unsigned short int yyrline[] = +{ + 0, 124, 124, 132, 133, 134, 135, 136, 137, 141, -+ 152, 165, 177, 192, 202, 215, 228, 238, 248, 261, -+ 265, 272, 282, 292, 299, 308, 312, 316, 323, 327, -+ 334, 338, 342, 346, 350, 354, 358, 365, 374, 387, -+ 391, 395, 411, 432, 433, 437, 444, 445, 461, 471, -+ 484, 489, 498, 504, 510, 516, 522, 528, 534, 540, -+ 546, 552, 558, 567, 568, 572, 579, 590, 591, 599, -+ 607, 613, 619, 625, 634, 643, 649, 658, 665, 674 ++ 151, 164, 176, 191, 201, 214, 227, 237, 247, 260, ++ 264, 271, 281, 291, 298, 307, 311, 315, 322, 326, ++ 333, 337, 341, 345, 349, 353, 357, 364, 373, 386, ++ 390, 394, 410, 431, 432, 436, 443, 444, 460, 470, ++ 483, 488, 497, 503, 509, 515, 521, 527, 533, 539, ++ 545, 551, 557, 566, 567, 571, 578, 589, 590, 598, ++ 606, 612, 618, 624, 633, 642, 648, 657, 664, 673 +}; +#endif + @@ -4068,9 +4078,8 @@ Index: sql.tab.c + { + SQL_input *sql = (SQL_input*) info; + MSIVIEW *insert = NULL; -+ UINT r; + -+ r = INSERT_CreateView( sql->db, &insert, (yyvsp[-7].string), (yyvsp[-5].column_list), (yyvsp[-1].column_list), FALSE ); ++ INSERT_CreateView( sql->db, &insert, (yyvsp[-7].string), (yyvsp[-5].column_list), (yyvsp[-1].column_list), FALSE ); + if( !insert ) + YYABORT; + (yyval.query) = insert; @@ -4078,7 +4087,7 @@ Index: sql.tab.c + break; + + case 10: -+#line 153 "sql.y" ++#line 152 "sql.y" + { + SQL_input *sql = (SQL_input*) info; + MSIVIEW *insert = NULL; @@ -4091,7 +4100,7 @@ Index: sql.tab.c + break; + + case 11: -+#line 166 "sql.y" ++#line 165 "sql.y" + { + SQL_input* sql = (SQL_input*) info; + MSIVIEW *create = NULL; @@ -4106,7 +4115,7 @@ Index: sql.tab.c + break; + + case 12: -+#line 178 "sql.y" ++#line 177 "sql.y" + { + SQL_input* sql = (SQL_input*) info; + MSIVIEW *create = NULL; @@ -4121,7 +4130,7 @@ Index: sql.tab.c + break; + + case 13: -+#line 193 "sql.y" ++#line 192 "sql.y" + { + SQL_input* sql = (SQL_input*) info; + MSIVIEW *update = NULL; @@ -4134,7 +4143,7 @@ Index: sql.tab.c + break; + + case 14: -+#line 203 "sql.y" ++#line 202 "sql.y" + { + SQL_input* sql = (SQL_input*) info; + MSIVIEW *update = NULL; @@ -4147,7 +4156,7 @@ Index: sql.tab.c + break; + + case 15: -+#line 216 "sql.y" ++#line 215 "sql.y" + { + SQL_input* sql = (SQL_input*) info; + MSIVIEW *delete = NULL; @@ -4160,7 +4169,7 @@ Index: sql.tab.c + break; + + case 16: -+#line 229 "sql.y" ++#line 228 "sql.y" + { + SQL_input* sql = (SQL_input*) info; + MSIVIEW *alter = NULL; @@ -4173,7 +4182,7 @@ Index: sql.tab.c + break; + + case 17: -+#line 239 "sql.y" ++#line 238 "sql.y" + { + SQL_input *sql = (SQL_input *)info; + MSIVIEW *alter = NULL; @@ -4186,7 +4195,7 @@ Index: sql.tab.c + break; + + case 18: -+#line 249 "sql.y" ++#line 248 "sql.y" + { + SQL_input *sql = (SQL_input *)info; + MSIVIEW *alter = NULL; @@ -4199,21 +4208,21 @@ Index: sql.tab.c + break; + + case 19: -+#line 262 "sql.y" ++#line 261 "sql.y" + { + (yyval.integer) = 1; + ;} + break; + + case 20: -+#line 266 "sql.y" ++#line 265 "sql.y" + { + (yyval.integer) = -1; + ;} + break; + + case 21: -+#line 273 "sql.y" ++#line 272 "sql.y" + { + if( SQL_MarkPrimaryKeys( (yyvsp[-3].column_list), (yyvsp[0].column_list) ) ) + (yyval.column_list) = (yyvsp[-3].column_list); @@ -4223,7 +4232,7 @@ Index: sql.tab.c + break; + + case 22: -+#line 283 "sql.y" ++#line 282 "sql.y" + { + column_info *ci; + @@ -4236,14 +4245,14 @@ Index: sql.tab.c + break; + + case 23: -+#line 293 "sql.y" ++#line 292 "sql.y" + { + (yyval.column_list) = (yyvsp[0].column_list); + ;} + break; + + case 24: -+#line 300 "sql.y" ++#line 299 "sql.y" + { + (yyval.column_list) = (yyvsp[-1].column_list); + (yyval.column_list)->type = ((yyvsp[0].column_type) | MSITYPE_VALID); @@ -4252,91 +4261,91 @@ Index: sql.tab.c + break; + + case 25: -+#line 309 "sql.y" ++#line 308 "sql.y" + { + (yyval.column_type) = (yyvsp[0].column_type); + ;} + break; + + case 26: -+#line 313 "sql.y" ++#line 312 "sql.y" + { + (yyval.column_type) = (yyvsp[-1].column_type) | MSITYPE_LOCALIZABLE; + ;} + break; + + case 27: -+#line 317 "sql.y" ++#line 316 "sql.y" + { + (yyval.column_type) = (yyvsp[-1].column_type) | MSITYPE_TEMPORARY; + ;} + break; + + case 28: -+#line 324 "sql.y" ++#line 323 "sql.y" + { + (yyval.column_type) |= MSITYPE_NULLABLE; + ;} + break; + + case 29: -+#line 328 "sql.y" ++#line 327 "sql.y" + { + (yyval.column_type) = (yyvsp[-2].column_type); + ;} + break; + + case 30: -+#line 335 "sql.y" ++#line 334 "sql.y" + { + (yyval.column_type) = MSITYPE_STRING | 1; + ;} + break; + + case 31: -+#line 339 "sql.y" ++#line 338 "sql.y" + { + (yyval.column_type) = MSITYPE_STRING | 0x400 | (yyvsp[-1].column_type); + ;} + break; + + case 32: -+#line 343 "sql.y" ++#line 342 "sql.y" + { + (yyval.column_type) = 2; + ;} + break; + + case 33: -+#line 347 "sql.y" ++#line 346 "sql.y" + { + (yyval.column_type) = 2; + ;} + break; + + case 34: -+#line 351 "sql.y" ++#line 350 "sql.y" + { + (yyval.column_type) = 2; + ;} + break; + + case 35: -+#line 355 "sql.y" ++#line 354 "sql.y" + { + (yyval.column_type) = 4; + ;} + break; + + case 36: -+#line 359 "sql.y" ++#line 358 "sql.y" + { + (yyval.column_type) = MSITYPE_STRING | MSITYPE_VALID; + ;} + break; + + case 37: -+#line 366 "sql.y" ++#line 365 "sql.y" + { + if( ( (yyvsp[0].integer) > 255 ) || ( (yyvsp[0].integer) < 0 ) ) + YYABORT; @@ -4345,7 +4354,7 @@ Index: sql.tab.c + break; + + case 38: -+#line 375 "sql.y" ++#line 374 "sql.y" + { + UINT r; + @@ -4361,14 +4370,14 @@ Index: sql.tab.c + break; + + case 40: -+#line 392 "sql.y" ++#line 391 "sql.y" + { + (yyval.query) = (yyvsp[0].query); + ;} + break; + + case 41: -+#line 396 "sql.y" ++#line 395 "sql.y" + { + SQL_input* sql = (SQL_input*) info; + UINT r; @@ -4384,7 +4393,7 @@ Index: sql.tab.c + break; + + case 42: -+#line 412 "sql.y" ++#line 411 "sql.y" + { + SQL_input* sql = (SQL_input*) info; + UINT r; @@ -4405,21 +4414,21 @@ Index: sql.tab.c + break; + + case 44: -+#line 434 "sql.y" ++#line 433 "sql.y" + { + (yyvsp[-2].column_list)->next = (yyvsp[0].column_list); + ;} + break; + + case 45: -+#line 438 "sql.y" ++#line 437 "sql.y" + { + (yyval.column_list) = NULL; + ;} + break; + + case 47: -+#line 446 "sql.y" ++#line 445 "sql.y" + { + SQL_input* sql = (SQL_input*) info; + UINT r; @@ -4435,7 +4444,7 @@ Index: sql.tab.c + break; + + case 48: -+#line 462 "sql.y" ++#line 461 "sql.y" + { + SQL_input* sql = (SQL_input*) info; + UINT r; @@ -4448,7 +4457,7 @@ Index: sql.tab.c + break; + + case 49: -+#line 472 "sql.y" ++#line 471 "sql.y" + { + SQL_input* sql = (SQL_input*) info; + UINT r; @@ -4461,14 +4470,14 @@ Index: sql.tab.c + break; + + case 50: -+#line 485 "sql.y" ++#line 484 "sql.y" + { + (yyval.string) = strdupW((yyvsp[0].string)); + ;} + break; + + case 51: -+#line 490 "sql.y" ++#line 489 "sql.y" + { + (yyval.string) = parser_add_table((yyvsp[0].string), (yyvsp[-2].string)); + if (!(yyval.string)) @@ -4477,7 +4486,7 @@ Index: sql.tab.c + break; + + case 52: -+#line 499 "sql.y" ++#line 498 "sql.y" + { + (yyval.expr) = (yyvsp[-1].expr); + if( !(yyval.expr) ) @@ -4486,7 +4495,7 @@ Index: sql.tab.c + break; + + case 53: -+#line 505 "sql.y" ++#line 504 "sql.y" + { + (yyval.expr) = EXPR_complex( info, (yyvsp[-2].expr), OP_AND, (yyvsp[0].expr) ); + if( !(yyval.expr) ) @@ -4495,7 +4504,7 @@ Index: sql.tab.c + break; + + case 54: -+#line 511 "sql.y" ++#line 510 "sql.y" + { + (yyval.expr) = EXPR_complex( info, (yyvsp[-2].expr), OP_OR, (yyvsp[0].expr) ); + if( !(yyval.expr) ) @@ -4504,7 +4513,7 @@ Index: sql.tab.c + break; + + case 55: -+#line 517 "sql.y" ++#line 516 "sql.y" + { + (yyval.expr) = EXPR_complex( info, (yyvsp[-2].expr), OP_EQ, (yyvsp[0].expr) ); + if( !(yyval.expr) ) @@ -4513,7 +4522,7 @@ Index: sql.tab.c + break; + + case 56: -+#line 523 "sql.y" ++#line 522 "sql.y" + { + (yyval.expr) = EXPR_complex( info, (yyvsp[-2].expr), OP_GT, (yyvsp[0].expr) ); + if( !(yyval.expr) ) @@ -4522,7 +4531,7 @@ Index: sql.tab.c + break; + + case 57: -+#line 529 "sql.y" ++#line 528 "sql.y" + { + (yyval.expr) = EXPR_complex( info, (yyvsp[-2].expr), OP_LT, (yyvsp[0].expr) ); + if( !(yyval.expr) ) @@ -4531,7 +4540,7 @@ Index: sql.tab.c + break; + + case 58: -+#line 535 "sql.y" ++#line 534 "sql.y" + { + (yyval.expr) = EXPR_complex( info, (yyvsp[-2].expr), OP_LE, (yyvsp[0].expr) ); + if( !(yyval.expr) ) @@ -4540,7 +4549,7 @@ Index: sql.tab.c + break; + + case 59: -+#line 541 "sql.y" ++#line 540 "sql.y" + { + (yyval.expr) = EXPR_complex( info, (yyvsp[-2].expr), OP_GE, (yyvsp[0].expr) ); + if( !(yyval.expr) ) @@ -4549,7 +4558,7 @@ Index: sql.tab.c + break; + + case 60: -+#line 547 "sql.y" ++#line 546 "sql.y" + { + (yyval.expr) = EXPR_complex( info, (yyvsp[-2].expr), OP_NE, (yyvsp[0].expr) ); + if( !(yyval.expr) ) @@ -4558,7 +4567,7 @@ Index: sql.tab.c + break; + + case 61: -+#line 553 "sql.y" ++#line 552 "sql.y" + { + (yyval.expr) = EXPR_unary( info, (yyvsp[-2].expr), OP_ISNULL ); + if( !(yyval.expr) ) @@ -4567,7 +4576,7 @@ Index: sql.tab.c + break; + + case 62: -+#line 559 "sql.y" ++#line 558 "sql.y" + { + (yyval.expr) = EXPR_unary( info, (yyvsp[-3].expr), OP_NOTNULL ); + if( !(yyval.expr) ) @@ -4576,7 +4585,7 @@ Index: sql.tab.c + break; + + case 65: -+#line 573 "sql.y" ++#line 572 "sql.y" + { + (yyval.column_list) = parser_alloc_column( info, NULL, NULL ); + if( !(yyval.column_list) ) @@ -4586,7 +4595,7 @@ Index: sql.tab.c + break; + + case 66: -+#line 580 "sql.y" ++#line 579 "sql.y" + { + (yyval.column_list) = parser_alloc_column( info, NULL, NULL ); + if( !(yyval.column_list) ) @@ -4597,7 +4606,7 @@ Index: sql.tab.c + break; + + case 68: -+#line 592 "sql.y" ++#line 591 "sql.y" + { + (yyval.column_list) = (yyvsp[-2].column_list); + (yyval.column_list)->next = (yyvsp[0].column_list); @@ -4605,7 +4614,7 @@ Index: sql.tab.c + break; + + case 69: -+#line 600 "sql.y" ++#line 599 "sql.y" + { + (yyval.column_list) = (yyvsp[-2].column_list); + (yyval.column_list)->val = (yyvsp[0].expr); @@ -4613,7 +4622,7 @@ Index: sql.tab.c + break; + + case 70: -+#line 608 "sql.y" ++#line 607 "sql.y" + { + (yyval.expr) = EXPR_ival( info, (yyvsp[0].integer) ); + if( !(yyval.expr) ) @@ -4622,7 +4631,7 @@ Index: sql.tab.c + break; + + case 71: -+#line 614 "sql.y" ++#line 613 "sql.y" + { + (yyval.expr) = EXPR_ival( info, -(yyvsp[0].integer) ); + if( !(yyval.expr) ) @@ -4631,7 +4640,7 @@ Index: sql.tab.c + break; + + case 72: -+#line 620 "sql.y" ++#line 619 "sql.y" + { + (yyval.expr) = EXPR_sval( info, &(yyvsp[0].str) ); + if( !(yyval.expr) ) @@ -4640,7 +4649,7 @@ Index: sql.tab.c + break; + + case 73: -+#line 626 "sql.y" ++#line 625 "sql.y" + { + (yyval.expr) = EXPR_wildcard( info ); + if( !(yyval.expr) ) @@ -4649,7 +4658,7 @@ Index: sql.tab.c + break; + + case 74: -+#line 635 "sql.y" ++#line 634 "sql.y" + { + (yyval.expr) = EXPR_column( info, (yyvsp[0].column_list) ); + if( !(yyval.expr) ) @@ -4658,7 +4667,7 @@ Index: sql.tab.c + break; + + case 75: -+#line 644 "sql.y" ++#line 643 "sql.y" + { + (yyval.column_list) = parser_alloc_column( info, (yyvsp[-2].string), (yyvsp[0].string) ); + if( !(yyval.column_list) ) @@ -4667,7 +4676,7 @@ Index: sql.tab.c + break; + + case 76: -+#line 650 "sql.y" ++#line 649 "sql.y" + { + (yyval.column_list) = parser_alloc_column( info, NULL, (yyvsp[0].string) ); + if( !(yyval.column_list) ) @@ -4676,14 +4685,14 @@ Index: sql.tab.c + break; + + case 77: -+#line 659 "sql.y" ++#line 658 "sql.y" + { + (yyval.string) = (yyvsp[0].string); + ;} + break; + + case 78: -+#line 666 "sql.y" ++#line 665 "sql.y" + { + (yyval.string) = SQL_getstring( info, &(yyvsp[0].str) ); + if( !(yyval.string) ) @@ -4692,7 +4701,7 @@ Index: sql.tab.c + break; + + case 79: -+#line 675 "sql.y" ++#line 674 "sql.y" + { + (yyval.integer) = SQL_getint( info ); + ;} @@ -4703,7 +4712,7 @@ Index: sql.tab.c + } + +/* Line 1126 of yacc.c. */ -+#line 2081 "sql.tab.c" ++#line 2080 "sql.tab.c" + + yyvsp -= yylen; + yyssp -= yylen; @@ -4971,7 +4980,7 @@ Index: sql.tab.c +} + + -+#line 680 "sql.y" ++#line 679 "sql.y" + + +static LPWSTR parser_add_table(LPWSTR list, LPWSTR table) diff --git a/reactos/dll/win32/msi/msipriv.h b/reactos/dll/win32/msi/msipriv.h index 975ebb62add..90eaa198c46 100644 --- a/reactos/dll/win32/msi/msipriv.h +++ b/reactos/dll/win32/msi/msipriv.h @@ -26,6 +26,7 @@ #include "windef.h" #include "winbase.h" +#include "fdi.h" #include "msi.h" #include "msiquery.h" #include "objbase.h" @@ -133,6 +134,20 @@ typedef struct tagMSIMEDIADISK LPWSTR disk_prompt; } MSIMEDIADISK; +typedef struct tagMSIMEDIAINFO +{ + UINT disk_id; + UINT type; + UINT last_sequence; + LPWSTR disk_prompt; + LPWSTR cabinet; + LPWSTR first_volume; + LPWSTR volume_label; + BOOL is_continuous; + BOOL is_extracted; + WCHAR source[MAX_PATH]; +} MSIMEDIAINFO; + typedef struct _column_info { LPCWSTR table; @@ -307,6 +322,7 @@ typedef struct tagMSIPACKAGE float center_y; UINT WordCount; + UINT Context; struct list subscriptions; @@ -757,7 +773,8 @@ extern UINT MSIREG_OpenUserDataComponentKey(LPCWSTR szComponent, HKEY *key, BOOL extern UINT MSIREG_OpenProductsKey(LPCWSTR szProduct, HKEY* key, BOOL create); extern UINT MSIREG_OpenPatchesKey(LPCWSTR szPatch, HKEY* key, BOOL create); extern UINT MSIREG_OpenUserDataProductKey(LPCWSTR szProduct, HKEY* key, BOOL create); -extern UINT MSIREG_OpenInstallPropertiesKey(LPCWSTR szProduct, HKEY* key, BOOL create); +extern UINT MSIREG_OpenCurrentUserInstallProps(LPCWSTR szProduct, HKEY* key, BOOL create); +extern UINT MSIREG_OpenLocalSystemInstallProps(LPCWSTR szProduct, HKEY* key, BOOL create); extern UINT MSIREG_OpenUserFeaturesKey(LPCWSTR szProduct, HKEY* key, BOOL create); extern UINT MSIREG_OpenUserComponentsKey(LPCWSTR szComponent, HKEY* key, BOOL create); extern UINT MSIREG_OpenUpgradeCodesKey(LPCWSTR szProduct, HKEY* key, BOOL create); @@ -887,6 +904,10 @@ extern UINT msi_create_component_directories( MSIPACKAGE *package ); extern void msi_ui_error( DWORD msg_id, DWORD type ); extern UINT msi_set_last_used_source(LPCWSTR product, LPCWSTR usersid, MSIINSTALLCONTEXT context, DWORD options, LPCWSTR value); +extern UINT msi_load_media_info(MSIPACKAGE *package, MSIFILE *file, MSIMEDIAINFO *mi); +extern void msi_free_media_info(MSIMEDIAINFO *mi); +extern BOOL msi_cabextract(MSIPACKAGE* package, MSIMEDIAINFO *mi, PFNFDINOTIFY notify, LPVOID data); +extern UINT msi_extract_file(MSIPACKAGE *package, MSIFILE *file, LPWSTR destdir); /* control event stuff */ extern VOID ControlEvent_FireSubscribedEvent(MSIPACKAGE *package, LPCWSTR event, diff --git a/reactos/dll/win32/msi/msiquery.c b/reactos/dll/win32/msi/msiquery.c index 662b4fbb8ce..912a29974bb 100644 --- a/reactos/dll/win32/msi/msiquery.c +++ b/reactos/dll/win32/msi/msiquery.c @@ -869,15 +869,12 @@ UINT MSI_DatabaseGetPrimaryKeys( MSIDATABASE *db, '`','T','a','b','l','e','`',' ','=',' ','\'','%','s','\'',0 }; struct msi_primary_key_record_info info; MSIQUERY *query = NULL; - MSIVIEW *view; UINT r; - + r = MSI_OpenQuery( db, &query, sql, table ); if( r != ERROR_SUCCESS ) return r; - view = query->view; - /* count the number of primary key records */ info.n = 0; info.rec = 0; diff --git a/reactos/dll/win32/msi/msiserver.idl b/reactos/dll/win32/msi/msiserver.idl index d5b47acbf4a..37aa91efb75 100644 --- a/reactos/dll/win32/msi/msiserver.idl +++ b/reactos/dll/win32/msi/msiserver.idl @@ -70,7 +70,7 @@ interface IWineMsiRemotePackage : IUnknown HRESULT SetComponentState( [in] BSTR component, [in] INSTALLSTATE state ); HRESULT GetLanguage( [out] LANGID *language ); HRESULT SetInstallLevel( [in] int level ); - HRESULT FormatRecord( [in] MSIHANDLE record, [out] BSTR value, [out] DWORD *size ); + HRESULT FormatRecord( [in] MSIHANDLE record, [out] BSTR *value ); HRESULT EvaluateCondition( [in] BSTR condition ); } diff --git a/reactos/dll/win32/msi/package.c b/reactos/dll/win32/msi/package.c index fad05200f5d..f11b0688424 100644 --- a/reactos/dll/win32/msi/package.c +++ b/reactos/dll/win32/msi/package.c @@ -416,7 +416,6 @@ static VOID set_installer_properties(MSIPACKAGE *package) static const WCHAR szColorBits[] = {'C','o','l','o','r','B','i','t','s',0}; static const WCHAR szIntFormat[] = {'%','d',0}; static const WCHAR szIntel[] = { 'I','n','t','e','l',0 }; - static const WCHAR szAllUsers[] = { 'A','L','L','U','S','E','R','S',0 }; static const WCHAR szUserInfo[] = { 'S','O','F','T','W','A','R','E','\\', 'M','i','c','r','o','s','o','f','t','\\', @@ -542,7 +541,6 @@ static VOID set_installer_properties(MSIPACKAGE *package) /* in a wine environment the user is always admin and privileged */ MSI_SetPropertyW(package,szAdminUser,szOne); MSI_SetPropertyW(package,szPriv,szOne); - MSI_SetPropertyW(package, szAllUsers, szOne); /* set the os things */ OSVersion.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXW); @@ -762,6 +760,30 @@ static UINT msi_load_admin_properties(MSIPACKAGE *package) return r; } +static UINT msi_set_context(MSIPACKAGE *package) +{ + WCHAR val[10]; + DWORD sz = 10; + DWORD num; + UINT r; + + static const WCHAR szOne[] = {'1',0}; + static const WCHAR szAllUsers[] = {'A','L','L','U','S','E','R','S',0}; + + package->Context = MSIINSTALLCONTEXT_USERUNMANAGED; + + r = MSI_GetPropertyW(package, szAllUsers, val, &sz); + if (r == ERROR_SUCCESS) + { + num = atolW(val); + if (num == 1 || num == 2) + package->Context = MSIINSTALLCONTEXT_MACHINE; + } + + MSI_SetPropertyW(package, szAllUsers, szOne); + return ERROR_SUCCESS; +} + MSIPACKAGE *MSI_CreatePackage( MSIDATABASE *db, LPCWSTR base_url ) { static const WCHAR szLevel[] = { 'U','I','L','e','v','e','l',0 }; @@ -801,6 +823,8 @@ MSIPACKAGE *MSI_CreatePackage( MSIDATABASE *db, LPCWSTR base_url ) if (package->WordCount & MSIWORDCOUNT_ADMINISTRATIVE) msi_load_admin_properties( package ); + + msi_set_context( package ); } return package; @@ -1788,10 +1812,19 @@ static HRESULT WINAPI mrp_SetInstallLevel( IWineMsiRemotePackage *iface, int lev } static HRESULT WINAPI mrp_FormatRecord( IWineMsiRemotePackage *iface, MSIHANDLE record, - BSTR value, DWORD *size ) + BSTR *value) { + DWORD size = 0; msi_remote_package_impl* This = mrp_from_IWineMsiRemotePackage( iface ); - UINT r = MsiFormatRecordW(This->package, record, (LPWSTR)value, size); + UINT r = MsiFormatRecordW(This->package, record, NULL, &size); + if (r == ERROR_SUCCESS) + { + *value = SysAllocStringLen(NULL, size); + if (!*value) + return E_OUTOFMEMORY; + size++; + r = MsiFormatRecordW(This->package, record, *value, &size); + } return HRESULT_FROM_WIN32(r); } diff --git a/reactos/dll/win32/msi/registry.c b/reactos/dll/win32/msi/registry.c index 1d41e6505cf..b95d5bb48cc 100644 --- a/reactos/dll/win32/msi/registry.c +++ b/reactos/dll/win32/msi/registry.c @@ -381,7 +381,7 @@ DWORD msi_version_str_to_dword(LPCWSTR p) LPWSTR msi_version_dword_to_str(DWORD version) { - const WCHAR fmt[] = { '%','u','.','%','u','.','%','u',0 }; + static const WCHAR fmt[] = { '%','u','.','%','u','.','%','u',0 }; LPWSTR str = msi_alloc(20); sprintfW(str, fmt, (version&0xff000000)>>24, @@ -392,7 +392,10 @@ LPWSTR msi_version_dword_to_str(DWORD version) LONG msi_reg_set_val_str( HKEY hkey, LPCWSTR name, LPCWSTR value ) { - DWORD len = value ? (lstrlenW(value) + 1) * sizeof (WCHAR) : 0; + static const WCHAR emptyW[] = {0}; + DWORD len; + if (!value) value = emptyW; + len = (lstrlenW(value) + 1) * sizeof (WCHAR); return RegSetValueExW( hkey, name, 0, REG_SZ, (const BYTE *)value, len ); } @@ -753,18 +756,34 @@ UINT MSIREG_OpenUserDataProductKey(LPCWSTR szProduct, HKEY *key, BOOL create) return rc; } -UINT MSIREG_OpenInstallPropertiesKey(LPCWSTR szProduct, HKEY *key, BOOL create) +static UINT MSIREG_OpenInstallProps(LPCWSTR szProduct, LPCWSTR szUserSID, + HKEY *key, BOOL create) { UINT rc; WCHAR squished_pc[GUID_SIZE]; WCHAR keypath[0x200]; - LPWSTR usersid; TRACE("%s\n", debugstr_w(szProduct)); if (!squash_guid(szProduct, squished_pc)) return ERROR_FUNCTION_FAILED; TRACE("squished (%s)\n", debugstr_w(squished_pc)); + sprintfW(keypath, szInstallProperties_fmt, szUserSID, squished_pc); + + if (create) + rc = RegCreateKeyW(HKEY_LOCAL_MACHINE, keypath, key); + else + rc = RegOpenKeyW(HKEY_LOCAL_MACHINE, keypath, key); + + return rc; +} + +UINT MSIREG_OpenCurrentUserInstallProps(LPCWSTR szProduct, HKEY *key, + BOOL create) +{ + UINT rc; + LPWSTR usersid; + rc = get_user_sid(&usersid); if (rc != ERROR_SUCCESS || !usersid) { @@ -772,17 +791,20 @@ UINT MSIREG_OpenInstallPropertiesKey(LPCWSTR szProduct, HKEY *key, BOOL create) return rc; } - sprintfW(keypath, szInstallProperties_fmt, usersid, squished_pc); - - if (create) - rc = RegCreateKeyW(HKEY_LOCAL_MACHINE, keypath, key); - else - rc = RegOpenKeyW(HKEY_LOCAL_MACHINE, keypath, key); + rc = MSIREG_OpenInstallProps(szProduct, usersid, key, create); LocalFree(usersid); return rc; } +UINT MSIREG_OpenLocalSystemInstallProps(LPCWSTR szProduct, HKEY *key, + BOOL create) +{ + static const WCHAR localsid[] = {'S','-','1','-','5','-','1','8',0}; + + return MSIREG_OpenInstallProps(szProduct, localsid, key, create); +} + UINT MSIREG_DeleteUserDataProductKey(LPCWSTR szProduct) { UINT rc; diff --git a/reactos/dll/win32/msi/source.c b/reactos/dll/win32/msi/source.c index f50d545ce95..4c3811661fd 100644 --- a/reactos/dll/win32/msi/source.c +++ b/reactos/dll/win32/msi/source.c @@ -153,7 +153,6 @@ UINT WINAPI MsiSourceListEnumMediaDisksA(LPCSTR szProductCodeOrPatchCode, LPWSTR usersid = NULL; LPWSTR volume = NULL; LPWSTR prompt = NULL; - DWORD volumesz, promptsz; UINT r = ERROR_INVALID_PARAMETER; TRACE("(%s, %s, %d, %d, %d, %p, %p, %p, %p, %p)\n", debugstr_a(szProductCodeOrPatchCode), @@ -183,11 +182,11 @@ UINT WINAPI MsiSourceListEnumMediaDisksA(LPCSTR szProductCodeOrPatchCode, goto done; if (szVolumeLabel && pcchVolumeLabel) - volumesz = WideCharToMultiByte(CP_ACP, 0, volume, -1, szVolumeLabel, + WideCharToMultiByte(CP_ACP, 0, volume, -1, szVolumeLabel, *pcchVolumeLabel + 1, NULL, NULL); if (szDiskPrompt) - promptsz = WideCharToMultiByte(CP_ACP, 0, prompt, -1, szDiskPrompt, + WideCharToMultiByte(CP_ACP, 0, prompt, -1, szDiskPrompt, *pcchDiskPrompt + 1, NULL, NULL); done: @@ -823,7 +822,7 @@ UINT WINAPI MsiSourceListSetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid, } else if (strcmpW(INSTALLPROPERTY_PACKAGENAMEW, szProperty)==0) { - DWORD size = lstrlenW(szValue)*sizeof(WCHAR); + DWORD size = (lstrlenW(szValue) + 1) * sizeof(WCHAR); rc = RegSetValueExW(sourcekey, INSTALLPROPERTY_PACKAGENAMEW, 0, REG_SZ, (const BYTE *)szValue, size); if (rc != ERROR_SUCCESS) diff --git a/reactos/dll/win32/msi/sql.tab.c b/reactos/dll/win32/msi/sql.tab.c index 4704eac243c..c96d579f5d1 100644 --- a/reactos/dll/win32/msi/sql.tab.c +++ b/reactos/dll/win32/msi/sql.tab.c @@ -562,13 +562,13 @@ static const yysigned_char yyrhs[] = static const unsigned short int yyrline[] = { 0, 124, 124, 132, 133, 134, 135, 136, 137, 141, - 152, 165, 177, 192, 202, 215, 228, 238, 248, 261, - 265, 272, 282, 292, 299, 308, 312, 316, 323, 327, - 334, 338, 342, 346, 350, 354, 358, 365, 374, 387, - 391, 395, 411, 432, 433, 437, 444, 445, 461, 471, - 484, 489, 498, 504, 510, 516, 522, 528, 534, 540, - 546, 552, 558, 567, 568, 572, 579, 590, 591, 599, - 607, 613, 619, 625, 634, 643, 649, 658, 665, 674 + 151, 164, 176, 191, 201, 214, 227, 237, 247, 260, + 264, 271, 281, 291, 298, 307, 311, 315, 322, 326, + 333, 337, 341, 345, 349, 353, 357, 364, 373, 386, + 390, 394, 410, 431, 432, 436, 443, 444, 460, 470, + 483, 488, 497, 503, 509, 515, 521, 527, 533, 539, + 545, 551, 557, 566, 567, 571, 578, 589, 590, 598, + 606, 612, 618, 624, 633, 642, 648, 657, 664, 673 }; #endif @@ -1442,9 +1442,8 @@ yyreduce: { SQL_input *sql = (SQL_input*) info; MSIVIEW *insert = NULL; - UINT r; - r = INSERT_CreateView( sql->db, &insert, (yyvsp[-7].string), (yyvsp[-5].column_list), (yyvsp[-1].column_list), FALSE ); + INSERT_CreateView( sql->db, &insert, (yyvsp[-7].string), (yyvsp[-5].column_list), (yyvsp[-1].column_list), FALSE ); if( !insert ) YYABORT; (yyval.query) = insert; @@ -1452,7 +1451,7 @@ yyreduce: break; case 10: -#line 153 "sql.y" +#line 152 "sql.y" { SQL_input *sql = (SQL_input*) info; MSIVIEW *insert = NULL; @@ -1465,7 +1464,7 @@ yyreduce: break; case 11: -#line 166 "sql.y" +#line 165 "sql.y" { SQL_input* sql = (SQL_input*) info; MSIVIEW *create = NULL; @@ -1480,7 +1479,7 @@ yyreduce: break; case 12: -#line 178 "sql.y" +#line 177 "sql.y" { SQL_input* sql = (SQL_input*) info; MSIVIEW *create = NULL; @@ -1495,7 +1494,7 @@ yyreduce: break; case 13: -#line 193 "sql.y" +#line 192 "sql.y" { SQL_input* sql = (SQL_input*) info; MSIVIEW *update = NULL; @@ -1508,7 +1507,7 @@ yyreduce: break; case 14: -#line 203 "sql.y" +#line 202 "sql.y" { SQL_input* sql = (SQL_input*) info; MSIVIEW *update = NULL; @@ -1521,7 +1520,7 @@ yyreduce: break; case 15: -#line 216 "sql.y" +#line 215 "sql.y" { SQL_input* sql = (SQL_input*) info; MSIVIEW *delete = NULL; @@ -1534,7 +1533,7 @@ yyreduce: break; case 16: -#line 229 "sql.y" +#line 228 "sql.y" { SQL_input* sql = (SQL_input*) info; MSIVIEW *alter = NULL; @@ -1547,7 +1546,7 @@ yyreduce: break; case 17: -#line 239 "sql.y" +#line 238 "sql.y" { SQL_input *sql = (SQL_input *)info; MSIVIEW *alter = NULL; @@ -1560,7 +1559,7 @@ yyreduce: break; case 18: -#line 249 "sql.y" +#line 248 "sql.y" { SQL_input *sql = (SQL_input *)info; MSIVIEW *alter = NULL; @@ -1573,21 +1572,21 @@ yyreduce: break; case 19: -#line 262 "sql.y" +#line 261 "sql.y" { (yyval.integer) = 1; ;} break; case 20: -#line 266 "sql.y" +#line 265 "sql.y" { (yyval.integer) = -1; ;} break; case 21: -#line 273 "sql.y" +#line 272 "sql.y" { if( SQL_MarkPrimaryKeys( (yyvsp[-3].column_list), (yyvsp[0].column_list) ) ) (yyval.column_list) = (yyvsp[-3].column_list); @@ -1597,7 +1596,7 @@ yyreduce: break; case 22: -#line 283 "sql.y" +#line 282 "sql.y" { column_info *ci; @@ -1610,14 +1609,14 @@ yyreduce: break; case 23: -#line 293 "sql.y" +#line 292 "sql.y" { (yyval.column_list) = (yyvsp[0].column_list); ;} break; case 24: -#line 300 "sql.y" +#line 299 "sql.y" { (yyval.column_list) = (yyvsp[-1].column_list); (yyval.column_list)->type = ((yyvsp[0].column_type) | MSITYPE_VALID); @@ -1626,91 +1625,91 @@ yyreduce: break; case 25: -#line 309 "sql.y" +#line 308 "sql.y" { (yyval.column_type) = (yyvsp[0].column_type); ;} break; case 26: -#line 313 "sql.y" +#line 312 "sql.y" { (yyval.column_type) = (yyvsp[-1].column_type) | MSITYPE_LOCALIZABLE; ;} break; case 27: -#line 317 "sql.y" +#line 316 "sql.y" { (yyval.column_type) = (yyvsp[-1].column_type) | MSITYPE_TEMPORARY; ;} break; case 28: -#line 324 "sql.y" +#line 323 "sql.y" { (yyval.column_type) |= MSITYPE_NULLABLE; ;} break; case 29: -#line 328 "sql.y" +#line 327 "sql.y" { (yyval.column_type) = (yyvsp[-2].column_type); ;} break; case 30: -#line 335 "sql.y" +#line 334 "sql.y" { (yyval.column_type) = MSITYPE_STRING | 1; ;} break; case 31: -#line 339 "sql.y" +#line 338 "sql.y" { (yyval.column_type) = MSITYPE_STRING | 0x400 | (yyvsp[-1].column_type); ;} break; case 32: -#line 343 "sql.y" +#line 342 "sql.y" { (yyval.column_type) = 2; ;} break; case 33: -#line 347 "sql.y" +#line 346 "sql.y" { (yyval.column_type) = 2; ;} break; case 34: -#line 351 "sql.y" +#line 350 "sql.y" { (yyval.column_type) = 2; ;} break; case 35: -#line 355 "sql.y" +#line 354 "sql.y" { (yyval.column_type) = 4; ;} break; case 36: -#line 359 "sql.y" +#line 358 "sql.y" { (yyval.column_type) = MSITYPE_STRING | MSITYPE_VALID; ;} break; case 37: -#line 366 "sql.y" +#line 365 "sql.y" { if( ( (yyvsp[0].integer) > 255 ) || ( (yyvsp[0].integer) < 0 ) ) YYABORT; @@ -1719,7 +1718,7 @@ yyreduce: break; case 38: -#line 375 "sql.y" +#line 374 "sql.y" { UINT r; @@ -1735,14 +1734,14 @@ yyreduce: break; case 40: -#line 392 "sql.y" +#line 391 "sql.y" { (yyval.query) = (yyvsp[0].query); ;} break; case 41: -#line 396 "sql.y" +#line 395 "sql.y" { SQL_input* sql = (SQL_input*) info; UINT r; @@ -1758,7 +1757,7 @@ yyreduce: break; case 42: -#line 412 "sql.y" +#line 411 "sql.y" { SQL_input* sql = (SQL_input*) info; UINT r; @@ -1779,21 +1778,21 @@ yyreduce: break; case 44: -#line 434 "sql.y" +#line 433 "sql.y" { (yyvsp[-2].column_list)->next = (yyvsp[0].column_list); ;} break; case 45: -#line 438 "sql.y" +#line 437 "sql.y" { (yyval.column_list) = NULL; ;} break; case 47: -#line 446 "sql.y" +#line 445 "sql.y" { SQL_input* sql = (SQL_input*) info; UINT r; @@ -1809,7 +1808,7 @@ yyreduce: break; case 48: -#line 462 "sql.y" +#line 461 "sql.y" { SQL_input* sql = (SQL_input*) info; UINT r; @@ -1822,7 +1821,7 @@ yyreduce: break; case 49: -#line 472 "sql.y" +#line 471 "sql.y" { SQL_input* sql = (SQL_input*) info; UINT r; @@ -1835,14 +1834,14 @@ yyreduce: break; case 50: -#line 485 "sql.y" +#line 484 "sql.y" { (yyval.string) = strdupW((yyvsp[0].string)); ;} break; case 51: -#line 490 "sql.y" +#line 489 "sql.y" { (yyval.string) = parser_add_table((yyvsp[0].string), (yyvsp[-2].string)); if (!(yyval.string)) @@ -1851,7 +1850,7 @@ yyreduce: break; case 52: -#line 499 "sql.y" +#line 498 "sql.y" { (yyval.expr) = (yyvsp[-1].expr); if( !(yyval.expr) ) @@ -1860,7 +1859,7 @@ yyreduce: break; case 53: -#line 505 "sql.y" +#line 504 "sql.y" { (yyval.expr) = EXPR_complex( info, (yyvsp[-2].expr), OP_AND, (yyvsp[0].expr) ); if( !(yyval.expr) ) @@ -1869,7 +1868,7 @@ yyreduce: break; case 54: -#line 511 "sql.y" +#line 510 "sql.y" { (yyval.expr) = EXPR_complex( info, (yyvsp[-2].expr), OP_OR, (yyvsp[0].expr) ); if( !(yyval.expr) ) @@ -1878,7 +1877,7 @@ yyreduce: break; case 55: -#line 517 "sql.y" +#line 516 "sql.y" { (yyval.expr) = EXPR_complex( info, (yyvsp[-2].expr), OP_EQ, (yyvsp[0].expr) ); if( !(yyval.expr) ) @@ -1887,7 +1886,7 @@ yyreduce: break; case 56: -#line 523 "sql.y" +#line 522 "sql.y" { (yyval.expr) = EXPR_complex( info, (yyvsp[-2].expr), OP_GT, (yyvsp[0].expr) ); if( !(yyval.expr) ) @@ -1896,7 +1895,7 @@ yyreduce: break; case 57: -#line 529 "sql.y" +#line 528 "sql.y" { (yyval.expr) = EXPR_complex( info, (yyvsp[-2].expr), OP_LT, (yyvsp[0].expr) ); if( !(yyval.expr) ) @@ -1905,7 +1904,7 @@ yyreduce: break; case 58: -#line 535 "sql.y" +#line 534 "sql.y" { (yyval.expr) = EXPR_complex( info, (yyvsp[-2].expr), OP_LE, (yyvsp[0].expr) ); if( !(yyval.expr) ) @@ -1914,7 +1913,7 @@ yyreduce: break; case 59: -#line 541 "sql.y" +#line 540 "sql.y" { (yyval.expr) = EXPR_complex( info, (yyvsp[-2].expr), OP_GE, (yyvsp[0].expr) ); if( !(yyval.expr) ) @@ -1923,7 +1922,7 @@ yyreduce: break; case 60: -#line 547 "sql.y" +#line 546 "sql.y" { (yyval.expr) = EXPR_complex( info, (yyvsp[-2].expr), OP_NE, (yyvsp[0].expr) ); if( !(yyval.expr) ) @@ -1932,7 +1931,7 @@ yyreduce: break; case 61: -#line 553 "sql.y" +#line 552 "sql.y" { (yyval.expr) = EXPR_unary( info, (yyvsp[-2].expr), OP_ISNULL ); if( !(yyval.expr) ) @@ -1941,7 +1940,7 @@ yyreduce: break; case 62: -#line 559 "sql.y" +#line 558 "sql.y" { (yyval.expr) = EXPR_unary( info, (yyvsp[-3].expr), OP_NOTNULL ); if( !(yyval.expr) ) @@ -1950,7 +1949,7 @@ yyreduce: break; case 65: -#line 573 "sql.y" +#line 572 "sql.y" { (yyval.column_list) = parser_alloc_column( info, NULL, NULL ); if( !(yyval.column_list) ) @@ -1960,7 +1959,7 @@ yyreduce: break; case 66: -#line 580 "sql.y" +#line 579 "sql.y" { (yyval.column_list) = parser_alloc_column( info, NULL, NULL ); if( !(yyval.column_list) ) @@ -1971,7 +1970,7 @@ yyreduce: break; case 68: -#line 592 "sql.y" +#line 591 "sql.y" { (yyval.column_list) = (yyvsp[-2].column_list); (yyval.column_list)->next = (yyvsp[0].column_list); @@ -1979,7 +1978,7 @@ yyreduce: break; case 69: -#line 600 "sql.y" +#line 599 "sql.y" { (yyval.column_list) = (yyvsp[-2].column_list); (yyval.column_list)->val = (yyvsp[0].expr); @@ -1987,7 +1986,7 @@ yyreduce: break; case 70: -#line 608 "sql.y" +#line 607 "sql.y" { (yyval.expr) = EXPR_ival( info, (yyvsp[0].integer) ); if( !(yyval.expr) ) @@ -1996,7 +1995,7 @@ yyreduce: break; case 71: -#line 614 "sql.y" +#line 613 "sql.y" { (yyval.expr) = EXPR_ival( info, -(yyvsp[0].integer) ); if( !(yyval.expr) ) @@ -2005,7 +2004,7 @@ yyreduce: break; case 72: -#line 620 "sql.y" +#line 619 "sql.y" { (yyval.expr) = EXPR_sval( info, &(yyvsp[0].str) ); if( !(yyval.expr) ) @@ -2014,7 +2013,7 @@ yyreduce: break; case 73: -#line 626 "sql.y" +#line 625 "sql.y" { (yyval.expr) = EXPR_wildcard( info ); if( !(yyval.expr) ) @@ -2023,7 +2022,7 @@ yyreduce: break; case 74: -#line 635 "sql.y" +#line 634 "sql.y" { (yyval.expr) = EXPR_column( info, (yyvsp[0].column_list) ); if( !(yyval.expr) ) @@ -2032,7 +2031,7 @@ yyreduce: break; case 75: -#line 644 "sql.y" +#line 643 "sql.y" { (yyval.column_list) = parser_alloc_column( info, (yyvsp[-2].string), (yyvsp[0].string) ); if( !(yyval.column_list) ) @@ -2041,7 +2040,7 @@ yyreduce: break; case 76: -#line 650 "sql.y" +#line 649 "sql.y" { (yyval.column_list) = parser_alloc_column( info, NULL, (yyvsp[0].string) ); if( !(yyval.column_list) ) @@ -2050,14 +2049,14 @@ yyreduce: break; case 77: -#line 659 "sql.y" +#line 658 "sql.y" { (yyval.string) = (yyvsp[0].string); ;} break; case 78: -#line 666 "sql.y" +#line 665 "sql.y" { (yyval.string) = SQL_getstring( info, &(yyvsp[0].str) ); if( !(yyval.string) ) @@ -2066,7 +2065,7 @@ yyreduce: break; case 79: -#line 675 "sql.y" +#line 674 "sql.y" { (yyval.integer) = SQL_getint( info ); ;} @@ -2077,7 +2076,7 @@ yyreduce: } /* Line 1126 of yacc.c. */ -#line 2081 "sql.tab.c" +#line 2080 "sql.tab.c" yyvsp -= yylen; yyssp -= yylen; @@ -2345,7 +2344,7 @@ yyreturn: } -#line 680 "sql.y" +#line 679 "sql.y" static LPWSTR parser_add_table(LPWSTR list, LPWSTR table) diff --git a/reactos/dll/win32/msi/sql.y b/reactos/dll/win32/msi/sql.y index 94c36cdb8a5..e61038333d7 100644 --- a/reactos/dll/win32/msi/sql.y +++ b/reactos/dll/win32/msi/sql.y @@ -142,9 +142,8 @@ oneinsert: { SQL_input *sql = (SQL_input*) info; MSIVIEW *insert = NULL; - UINT r; - r = INSERT_CreateView( sql->db, &insert, $3, $5, $9, FALSE ); + INSERT_CreateView( sql->db, &insert, $3, $5, $9, FALSE ); if( !insert ) YYABORT; $$ = insert; diff --git a/reactos/dll/win32/msi/suminfo.c b/reactos/dll/win32/msi/suminfo.c index d78e8ad04d1..35dc6527919 100644 --- a/reactos/dll/win32/msi/suminfo.c +++ b/reactos/dll/win32/msi/suminfo.c @@ -371,7 +371,7 @@ static UINT save_summary_info( const MSISUMMARYINFO * si, IStream *stm ) LPBYTE data = NULL; ULONG count, sz; HRESULT r; - int i, n; + int i; /* write the header */ sz = sizeof set_hdr; @@ -397,7 +397,6 @@ static UINT save_summary_info( const MSISUMMARYINFO * si, IStream *stm ) section_hdr.cbSection = sizeof section_hdr; section_hdr.cbSection += (get_property_count( si->property ) * sizeof idofs[0]); section_hdr.cProperties = 0; - n = 0; for( i = 0; i < MSI_MAX_PROPS; i++ ) { sz = write_property_to_data( &si->property[i], NULL ); diff --git a/reactos/dll/win32/msi/table.c b/reactos/dll/win32/msi/table.c index 572cad67fcf..c3739e5a9a9 100644 --- a/reactos/dll/win32/msi/table.c +++ b/reactos/dll/win32/msi/table.c @@ -1796,9 +1796,6 @@ static UINT TABLE_find_matching_rows( struct tagMSIVIEW *view, UINT col, *row = entry->row; - if (tv->order) - *row = tv->order->reorder[*row]; - return ERROR_SUCCESS; } diff --git a/reactos/dll/win32/msi/tokenize.c b/reactos/dll/win32/msi/tokenize.c index d05d244731a..92a10679f3e 100644 --- a/reactos/dll/win32/msi/tokenize.c +++ b/reactos/dll/win32/msi/tokenize.c @@ -77,6 +77,7 @@ static const WCHAR WHERE_W[] = { 'W','H','E','R','E',0 }; /* ** These are the keywords +** They MUST be in alphabetical order */ static const Keyword aKeywordTable[] = { { ADD_W, TK_ADD }, diff --git a/reactos/dll/win32/msi/where.c b/reactos/dll/win32/msi/where.c index aa5d5f323be..8883496a608 100644 --- a/reactos/dll/win32/msi/where.c +++ b/reactos/dll/win32/msi/where.c @@ -86,6 +86,9 @@ static UINT find_entry_in_hash(MSIHASHENTRY **table, UINT row, UINT *val) { MSIHASHENTRY *entry; + if (!table) + return ERROR_SUCCESS; + if (!(entry = table[row % MSI_HASH_TABLE_SIZE])) { WARN("Row not found in hash table!\n"); @@ -503,15 +506,12 @@ static UINT WHERE_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode, MSIRECORD *rec, UINT row ) { MSIWHEREVIEW *wv = (MSIWHEREVIEW*)view; - UINT r; TRACE("%p %d %p\n", wv, eModifyMode, rec); - r = WHERE_execute(view, NULL); - if (r != ERROR_SUCCESS) - return r; - find_entry_in_hash(wv->reorder, row - 1, &row); + row++; + return wv->table->ops->modify( wv->table, eModifyMode, rec, row ); }