Commit c4fc91f4 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

msi: Use wide character string literals in the remaining files.

parent 402281b6
...@@ -32,17 +32,11 @@ WINE_DEFAULT_DEBUG_CHANNEL(msi); ...@@ -32,17 +32,11 @@ WINE_DEFAULT_DEBUG_CHANNEL(msi);
static BOOL load_fusion_dlls( MSIPACKAGE *package ) static BOOL load_fusion_dlls( MSIPACKAGE *package )
{ {
static const WCHAR szFusion[] = {'f','u','s','i','o','n','.','d','l','l',0};
static const WCHAR szMscoree[] = {'\\','m','s','c','o','r','e','e','.','d','l','l',0};
static const WCHAR szVersion10[] = {'v','1','.','0','.','3','7','0','5',0};
static const WCHAR szVersion11[] = {'v','1','.','1','.','4','3','2','2',0};
static const WCHAR szVersion20[] = {'v','2','.','0','.','5','0','7','2','7',0};
static const WCHAR szVersion40[] = {'v','4','.','0','.','3','0','3','1','9',0};
HRESULT (WINAPI *pLoadLibraryShim)( const WCHAR *, const WCHAR *, void *, HMODULE * ); HRESULT (WINAPI *pLoadLibraryShim)( const WCHAR *, const WCHAR *, void *, HMODULE * );
WCHAR path[MAX_PATH]; WCHAR path[MAX_PATH];
DWORD len = GetSystemDirectoryW( path, MAX_PATH ); DWORD len = GetSystemDirectoryW( path, MAX_PATH );
lstrcpyW( path + len, szMscoree ); lstrcpyW( path + len, L"\\mscoree.dll" );
if (package->hmscoree || !(package->hmscoree = LoadLibraryW( path ))) return TRUE; if (package->hmscoree || !(package->hmscoree = LoadLibraryW( path ))) return TRUE;
if (!(pLoadLibraryShim = (void *)GetProcAddress( package->hmscoree, "LoadLibraryShim" ))) if (!(pLoadLibraryShim = (void *)GetProcAddress( package->hmscoree, "LoadLibraryShim" )))
{ {
...@@ -51,10 +45,10 @@ static BOOL load_fusion_dlls( MSIPACKAGE *package ) ...@@ -51,10 +45,10 @@ static BOOL load_fusion_dlls( MSIPACKAGE *package )
return TRUE; return TRUE;
} }
pLoadLibraryShim( szFusion, szVersion10, NULL, &package->hfusion10 ); pLoadLibraryShim( L"fusion.dll", L"v1.0.3705", NULL, &package->hfusion10 );
pLoadLibraryShim( szFusion, szVersion11, NULL, &package->hfusion11 ); pLoadLibraryShim( L"fusion.dll", L"v1.1.4322", NULL, &package->hfusion11 );
pLoadLibraryShim( szFusion, szVersion20, NULL, &package->hfusion20 ); pLoadLibraryShim( L"fusion.dll", L"v2.0.50727", NULL, &package->hfusion20 );
pLoadLibraryShim( szFusion, szVersion40, NULL, &package->hfusion40 ); pLoadLibraryShim( L"fusion.dll", L"v4.0.30319", NULL, &package->hfusion40 );
return TRUE; return TRUE;
} }
...@@ -129,16 +123,11 @@ void msi_destroy_assembly_caches( MSIPACKAGE *package ) ...@@ -129,16 +123,11 @@ void msi_destroy_assembly_caches( MSIPACKAGE *package )
static MSIRECORD *get_assembly_record( MSIPACKAGE *package, const WCHAR *comp ) static MSIRECORD *get_assembly_record( MSIPACKAGE *package, const WCHAR *comp )
{ {
static const WCHAR query[] = {
'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
'`','M','s','i','A','s','s','e','m','b','l','y','`',' ',
'W','H','E','R','E',' ','`','C','o','m','p','o','n','e','n','t','_','`',
' ','=',' ','\'','%','s','\'',0};
MSIQUERY *view; MSIQUERY *view;
MSIRECORD *rec; MSIRECORD *rec;
UINT r; UINT r;
r = MSI_OpenQuery( package->db, &view, query, comp ); r = MSI_OpenQuery( package->db, &view, L"SELECT * FROM `MsiAssembly` WHERE `Component_` = '%s'", comp );
if (r != ERROR_SUCCESS) if (r != ERROR_SUCCESS)
return NULL; return NULL;
...@@ -170,36 +159,28 @@ struct assembly_name ...@@ -170,36 +159,28 @@ struct assembly_name
static UINT get_assembly_name_attribute( MSIRECORD *rec, LPVOID param ) static UINT get_assembly_name_attribute( MSIRECORD *rec, LPVOID param )
{ {
static const WCHAR fmtW[] = {'%','s','=','"','%','s','"',0};
static const WCHAR nameW[] = {'n','a','m','e',0};
struct assembly_name *name = param; struct assembly_name *name = param;
const WCHAR *attr = MSI_RecordGetString( rec, 2 ); const WCHAR *attr = MSI_RecordGetString( rec, 2 );
const WCHAR *value = MSI_RecordGetString( rec, 3 ); const WCHAR *value = MSI_RecordGetString( rec, 3 );
int len = lstrlenW( fmtW ) + lstrlenW( attr ) + lstrlenW( value ); int len = lstrlenW( L"%s=\"%s\"" ) + lstrlenW( attr ) + lstrlenW( value );
if (!(name->attrs[name->index] = msi_alloc( len * sizeof(WCHAR) ))) if (!(name->attrs[name->index] = msi_alloc( len * sizeof(WCHAR) )))
return ERROR_OUTOFMEMORY; return ERROR_OUTOFMEMORY;
if (!wcsicmp( attr, nameW )) lstrcpyW( name->attrs[name->index++], value ); if (!wcsicmp( attr, L"name" )) lstrcpyW( name->attrs[name->index++], value );
else swprintf( name->attrs[name->index++], len, fmtW, attr, value ); else swprintf( name->attrs[name->index++], len, L"%s=\"%s\"", attr, value );
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
static WCHAR *get_assembly_display_name( MSIDATABASE *db, const WCHAR *comp, MSIASSEMBLY *assembly ) static WCHAR *get_assembly_display_name( MSIDATABASE *db, const WCHAR *comp, MSIASSEMBLY *assembly )
{ {
static const WCHAR commaW[] = {',',0};
static const WCHAR queryW[] = {
'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
'`','M','s','i','A','s','s','e','m','b','l','y','N','a','m','e','`',' ',
'W','H','E','R','E',' ','`','C','o','m','p','o','n','e','n','t','_','`',
' ','=',' ','\'','%','s','\'',0};
struct assembly_name name; struct assembly_name name;
WCHAR *display_name = NULL; WCHAR *display_name = NULL;
MSIQUERY *view; MSIQUERY *view;
UINT i, r; UINT i, r;
int len; int len;
r = MSI_OpenQuery( db, &view, queryW, comp ); r = MSI_OpenQuery( db, &view, L"SELECT * FROM `MsiAssemblyName` WHERE `Component_` = '%s'", comp );
if (r != ERROR_SUCCESS) if (r != ERROR_SUCCESS)
return NULL; return NULL;
...@@ -224,7 +205,7 @@ static WCHAR *get_assembly_display_name( MSIDATABASE *db, const WCHAR *comp, MSI ...@@ -224,7 +205,7 @@ static WCHAR *get_assembly_display_name( MSIDATABASE *db, const WCHAR *comp, MSI
for (i = 0; i < name.count; i++) for (i = 0; i < name.count; i++)
{ {
lstrcatW( display_name, name.attrs[i] ); lstrcatW( display_name, name.attrs[i] );
if (i < name.count - 1) lstrcatW( display_name, commaW ); if (i < name.count - 1) lstrcatW( display_name, L"," );
} }
} }
...@@ -320,23 +301,17 @@ IAssemblyEnum *msi_create_assembly_enum( MSIPACKAGE *package, const WCHAR *displ ...@@ -320,23 +301,17 @@ IAssemblyEnum *msi_create_assembly_enum( MSIPACKAGE *package, const WCHAR *displ
return ret; return ret;
} }
static const WCHAR clr_version_v10[] = {'v','1','.','0','.','3','7','0','5',0};
static const WCHAR clr_version_v11[] = {'v','1','.','1','.','4','3','2','2',0};
static const WCHAR clr_version_v20[] = {'v','2','.','0','.','5','0','7','2','7',0};
static const WCHAR clr_version_v40[] = {'v','4','.','0','.','3','0','3','1','9',0};
static const WCHAR clr_version_unknown[] = {'u','n','k','n','o','w','n',0};
static const WCHAR *clr_version[] = static const WCHAR *clr_version[] =
{ {
clr_version_v10, L"v1.0.3705",
clr_version_v11, L"v1.2.4322",
clr_version_v20, L"v2.0.50727",
clr_version_v40 L"v4.0.30319"
}; };
static const WCHAR *get_clr_version_str( enum clr_version version ) static const WCHAR *get_clr_version_str( enum clr_version version )
{ {
if (version >= ARRAY_SIZE( clr_version )) return clr_version_unknown; if (version >= ARRAY_SIZE( clr_version )) return L"unknown";
return clr_version[version]; return clr_version[version];
} }
...@@ -539,30 +514,20 @@ static WCHAR *build_local_assembly_path( const WCHAR *filename ) ...@@ -539,30 +514,20 @@ static WCHAR *build_local_assembly_path( const WCHAR *filename )
static LONG open_assemblies_key( UINT context, BOOL win32, HKEY *hkey ) static LONG open_assemblies_key( UINT context, BOOL win32, HKEY *hkey )
{ {
static const WCHAR path_win32[] =
{'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
'I','n','s','t','a','l','l','e','r','\\','W','i','n','3','2','A','s','s','e','m','b','l','i','e','s','\\',0};
static const WCHAR path_dotnet[] =
{'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
'I','n','s','t','a','l','l','e','r','\\','A','s','s','e','m','b','l','i','e','s','\\',0};
static const WCHAR classes_path_win32[] =
{'I','n','s','t','a','l','l','e','r','\\','W','i','n','3','2','A','s','s','e','m','b','l','i','e','s','\\',0};
static const WCHAR classes_path_dotnet[] =
{'I','n','s','t','a','l','l','e','r','\\','A','s','s','e','m','b','l','i','e','s','\\',0};
HKEY root; HKEY root;
const WCHAR *path; const WCHAR *path;
if (context == MSIINSTALLCONTEXT_MACHINE) if (context == MSIINSTALLCONTEXT_MACHINE)
{ {
root = HKEY_CLASSES_ROOT; root = HKEY_CLASSES_ROOT;
if (win32) path = classes_path_win32; if (win32) path = L"Installer\\Win32Assemblies\\";
else path = classes_path_dotnet; else path = L"Installer\\Assemblies\\";
} }
else else
{ {
root = HKEY_CURRENT_USER; root = HKEY_CURRENT_USER;
if (win32) path = path_win32; if (win32) path = L"Software\\Microsoft\\Installer\\Win32Assemblies\\";
else path = path_dotnet; else path = L"Software\\Microsoft\\Installer\\Assemblies\\";
} }
return RegCreateKeyW( root, path, hkey ); return RegCreateKeyW( root, path, hkey );
} }
...@@ -609,33 +574,20 @@ static LONG delete_local_assembly_key( UINT context, BOOL win32, const WCHAR *fi ...@@ -609,33 +574,20 @@ static LONG delete_local_assembly_key( UINT context, BOOL win32, const WCHAR *fi
static LONG open_global_assembly_key( UINT context, BOOL win32, HKEY *hkey ) static LONG open_global_assembly_key( UINT context, BOOL win32, HKEY *hkey )
{ {
static const WCHAR path_win32[] =
{'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
'I','n','s','t','a','l','l','e','r','\\','W','i','n','3','2','A','s','s','e','m','b','l','i','e','s','\\',
'G','l','o','b','a','l',0};
static const WCHAR path_dotnet[] =
{'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
'I','n','s','t','a','l','l','e','r','\\','A','s','s','e','m','b','l','i','e','s','\\',
'G','l','o','b','a','l',0};
static const WCHAR classes_path_win32[] =
{'I','n','s','t','a','l','l','e','r','\\','W','i','n','3','2','A','s','s','e','m','b','l','i','e','s','\\',
'G','l','o','b','a','l',0};
static const WCHAR classes_path_dotnet[] =
{'I','n','s','t','a','l','l','e','r','\\','A','s','s','e','m','b','l','i','e','s','\\','G','l','o','b','a','l',0};
HKEY root; HKEY root;
const WCHAR *path; const WCHAR *path;
if (context == MSIINSTALLCONTEXT_MACHINE) if (context == MSIINSTALLCONTEXT_MACHINE)
{ {
root = HKEY_CLASSES_ROOT; root = HKEY_CLASSES_ROOT;
if (win32) path = classes_path_win32; if (win32) path = L"Installer\\Win32Assemblies\\Global";
else path = classes_path_dotnet; else path = L"Installer\\Assemblies\\Global";
} }
else else
{ {
root = HKEY_CURRENT_USER; root = HKEY_CURRENT_USER;
if (win32) path = path_win32; if (win32) path = L"Software\\Microsoft\\Installer\\Win32Assemblies\\Global";
else path = path_dotnet; else path = L"Software\\Microsoft\\Installer\\Assemblies\\Global";
} }
return RegCreateKeyW( root, path, hkey ); return RegCreateKeyW( root, path, hkey );
} }
...@@ -645,7 +597,7 @@ UINT ACTION_MsiPublishAssemblies( MSIPACKAGE *package ) ...@@ -645,7 +597,7 @@ UINT ACTION_MsiPublishAssemblies( MSIPACKAGE *package )
MSICOMPONENT *comp; MSICOMPONENT *comp;
if (package->script == SCRIPT_NONE) if (package->script == SCRIPT_NONE)
return msi_schedule_action(package, SCRIPT_INSTALL, szMsiPublishAssemblies); return msi_schedule_action(package, SCRIPT_INSTALL, L"MsiPublishAssemblies");
LIST_FOR_EACH_ENTRY(comp, &package->components, MSICOMPONENT, entry) LIST_FOR_EACH_ENTRY(comp, &package->components, MSICOMPONENT, entry)
{ {
...@@ -718,7 +670,7 @@ UINT ACTION_MsiUnpublishAssemblies( MSIPACKAGE *package ) ...@@ -718,7 +670,7 @@ UINT ACTION_MsiUnpublishAssemblies( MSIPACKAGE *package )
MSICOMPONENT *comp; MSICOMPONENT *comp;
if (package->script == SCRIPT_NONE) if (package->script == SCRIPT_NONE)
return msi_schedule_action(package, SCRIPT_INSTALL, szMsiUnpublishAssemblies); return msi_schedule_action(package, SCRIPT_INSTALL, L"MsiUnpublishAssemblies");
LIST_FOR_EACH_ENTRY(comp, &package->components, MSICOMPONENT, entry) LIST_FOR_EACH_ENTRY(comp, &package->components, MSICOMPONENT, entry)
{ {
......
...@@ -95,8 +95,7 @@ HRESULT get_typeinfo(tid_t tid, ITypeInfo **typeinfo) ...@@ -95,8 +95,7 @@ HRESULT get_typeinfo(tid_t tid, ITypeInfo **typeinfo)
hr = LoadRegTypeLib(&LIBID_WindowsInstaller, 1, 0, LOCALE_NEUTRAL, &lib); hr = LoadRegTypeLib(&LIBID_WindowsInstaller, 1, 0, LOCALE_NEUTRAL, &lib);
if (FAILED(hr)) { if (FAILED(hr)) {
static const WCHAR msiserverW[] = {'m','s','i','s','e','r','v','e','r','.','t','l','b',0}; hr = LoadTypeLib(L"msiserver.tlb", &lib);
hr = LoadTypeLib(msiserverW, &lib);
if (FAILED(hr)) { if (FAILED(hr)) {
ERR("Could not load msiserver.tlb\n"); ERR("Could not load msiserver.tlb\n");
return hr; return hr;
...@@ -376,8 +375,6 @@ static HRESULT WINAPI AutomationObject_Invoke( ...@@ -376,8 +375,6 @@ static HRESULT WINAPI AutomationObject_Invoke(
else if (pExcepInfo && else if (pExcepInfo &&
(hr == DISP_E_PARAMNOTFOUND || (hr == DISP_E_PARAMNOTFOUND ||
hr == DISP_E_EXCEPTION)) { hr == DISP_E_EXCEPTION)) {
static const WCHAR szComma[] = { ',',0 };
static const WCHAR szExceptionSource[] = {'M','s','i',' ','A','P','I',' ','E','r','r','o','r',0};
WCHAR szExceptionDescription[MAX_PATH]; WCHAR szExceptionDescription[MAX_PATH];
BSTR bstrParamNames[MAX_FUNC_PARAMS]; BSTR bstrParamNames[MAX_FUNC_PARAMS];
unsigned namesNo, i; unsigned namesNo, i;
...@@ -395,7 +392,7 @@ static HRESULT WINAPI AutomationObject_Invoke( ...@@ -395,7 +392,7 @@ static HRESULT WINAPI AutomationObject_Invoke(
{ {
if (bFirst) bFirst = FALSE; if (bFirst) bFirst = FALSE;
else { else {
lstrcpyW(&szExceptionDescription[lstrlenW(szExceptionDescription)], szComma); lstrcpyW(&szExceptionDescription[lstrlenW(szExceptionDescription)], L",");
} }
lstrcpyW(&szExceptionDescription[lstrlenW(szExceptionDescription)], bstrParamNames[i]); lstrcpyW(&szExceptionDescription[lstrlenW(szExceptionDescription)], bstrParamNames[i]);
SysFreeString(bstrParamNames[i]); SysFreeString(bstrParamNames[i]);
...@@ -403,7 +400,7 @@ static HRESULT WINAPI AutomationObject_Invoke( ...@@ -403,7 +400,7 @@ static HRESULT WINAPI AutomationObject_Invoke(
memset(pExcepInfo, 0, sizeof(EXCEPINFO)); memset(pExcepInfo, 0, sizeof(EXCEPINFO));
pExcepInfo->wCode = 1000; pExcepInfo->wCode = 1000;
pExcepInfo->bstrSource = SysAllocString(szExceptionSource); pExcepInfo->bstrSource = SysAllocString(L"Msi API Error");
pExcepInfo->bstrDescription = SysAllocString(szExceptionDescription); pExcepInfo->bstrDescription = SysAllocString(szExceptionDescription);
hr = DISP_E_EXCEPTION; hr = DISP_E_EXCEPTION;
} }
...@@ -1599,8 +1596,6 @@ static HRESULT session_invoke( ...@@ -1599,8 +1596,6 @@ static HRESULT session_invoke(
* registry value type. Used by Installer::RegistryValue. */ * registry value type. Used by Installer::RegistryValue. */
static void variant_from_registry_value(VARIANT *pVarResult, DWORD dwType, LPBYTE lpData, DWORD dwSize) static void variant_from_registry_value(VARIANT *pVarResult, DWORD dwType, LPBYTE lpData, DWORD dwSize)
{ {
static const WCHAR szREG_BINARY[] = { '(','R','E','G','_','B','I','N','A','R','Y',')',0 };
static const WCHAR szREG_[] = { '(','R','E','G','_','?','?',')',0 };
WCHAR *szString = (WCHAR *)lpData; WCHAR *szString = (WCHAR *)lpData;
LPWSTR szNewString = NULL; LPWSTR szNewString = NULL;
DWORD dwNewSize = 0; DWORD dwNewSize = 0;
...@@ -1642,12 +1637,12 @@ static void variant_from_registry_value(VARIANT *pVarResult, DWORD dwType, LPBYT ...@@ -1642,12 +1637,12 @@ static void variant_from_registry_value(VARIANT *pVarResult, DWORD dwType, LPBYT
case REG_QWORD: case REG_QWORD:
V_VT(pVarResult) = VT_BSTR; V_VT(pVarResult) = VT_BSTR;
V_BSTR(pVarResult) = SysAllocString(szREG_); /* Weird string, don't know why native returns it */ V_BSTR(pVarResult) = SysAllocString(L"(REG_\?\?)"); /* Weird string, don't know why native returns it */
break; break;
case REG_BINARY: case REG_BINARY:
V_VT(pVarResult) = VT_BSTR; V_VT(pVarResult) = VT_BSTR;
V_BSTR(pVarResult) = SysAllocString(szREG_BINARY); V_BSTR(pVarResult) = SysAllocString(L"(REG_BINARY)");
break; break;
case REG_NONE: case REG_NONE:
...@@ -1950,9 +1945,6 @@ static HRESULT InstallerImpl_Version(WORD wFlags, ...@@ -1950,9 +1945,6 @@ static HRESULT InstallerImpl_Version(WORD wFlags,
DLLVERSIONINFO verinfo; DLLVERSIONINFO verinfo;
WCHAR version[MAX_PATH]; WCHAR version[MAX_PATH];
static const WCHAR format[] = {
'%','d','.','%','d','.','%','d','.','%','d',0};
if (!(wFlags & DISPATCH_PROPERTYGET)) if (!(wFlags & DISPATCH_PROPERTYGET))
return DISP_E_MEMBERNOTFOUND; return DISP_E_MEMBERNOTFOUND;
...@@ -1961,7 +1953,7 @@ static HRESULT InstallerImpl_Version(WORD wFlags, ...@@ -1961,7 +1953,7 @@ static HRESULT InstallerImpl_Version(WORD wFlags,
if (FAILED(hr)) if (FAILED(hr))
return hr; return hr;
swprintf(version, ARRAY_SIZE(version), format, verinfo.dwMajorVersion, verinfo.dwMinorVersion, swprintf(version, ARRAY_SIZE(version), L"%d.%d.%d.%d", verinfo.dwMajorVersion, verinfo.dwMinorVersion,
verinfo.dwBuildNumber, verinfo.dwPlatformID); verinfo.dwBuildNumber, verinfo.dwPlatformID);
V_VT(pVarResult) = VT_BSTR; V_VT(pVarResult) = VT_BSTR;
......
...@@ -144,7 +144,7 @@ static void value_free( struct value val ) ...@@ -144,7 +144,7 @@ static void value_free( struct value val )
%% %%
condition: condition:
expression expression
{ {
COND_input* cond = (COND_input*) info; COND_input* cond = (COND_input*) info;
cond->result = $1; cond->result = $1;
...@@ -157,7 +157,7 @@ condition: ...@@ -157,7 +157,7 @@ condition:
; ;
expression: expression:
boolean_term boolean_term
{ {
$$ = $1; $$ = $1;
} }
...@@ -318,7 +318,7 @@ value: ...@@ -318,7 +318,7 @@ value:
{ {
COND_input* cond = (COND_input*) info; COND_input* cond = (COND_input*) info;
INSTALLSTATE install = INSTALLSTATE_UNKNOWN, action = INSTALLSTATE_UNKNOWN; INSTALLSTATE install = INSTALLSTATE_UNKNOWN, action = INSTALLSTATE_UNKNOWN;
if(MSI_GetComponentStateW(cond->package, $2, &install, &action ) != ERROR_SUCCESS) if(MSI_GetComponentStateW(cond->package, $2, &install, &action ) != ERROR_SUCCESS)
{ {
$$.type = VALUE_LITERAL; $$.type = VALUE_LITERAL;
...@@ -335,7 +335,7 @@ value: ...@@ -335,7 +335,7 @@ value:
{ {
COND_input* cond = (COND_input*) info; COND_input* cond = (COND_input*) info;
INSTALLSTATE install = INSTALLSTATE_UNKNOWN, action = INSTALLSTATE_UNKNOWN; INSTALLSTATE install = INSTALLSTATE_UNKNOWN, action = INSTALLSTATE_UNKNOWN;
if(MSI_GetComponentStateW(cond->package, $2, &install, &action ) != ERROR_SUCCESS) if(MSI_GetComponentStateW(cond->package, $2, &install, &action ) != ERROR_SUCCESS)
{ {
$$.type = VALUE_LITERAL; $$.type = VALUE_LITERAL;
...@@ -352,7 +352,7 @@ value: ...@@ -352,7 +352,7 @@ value:
{ {
COND_input* cond = (COND_input*) info; COND_input* cond = (COND_input*) info;
INSTALLSTATE install, action; INSTALLSTATE install, action;
if (MSI_GetFeatureStateW(cond->package, $2, &install, &action ) != ERROR_SUCCESS) if (MSI_GetFeatureStateW(cond->package, $2, &install, &action ) != ERROR_SUCCESS)
{ {
$$.type = VALUE_LITERAL; $$.type = VALUE_LITERAL;
...@@ -369,7 +369,7 @@ value: ...@@ -369,7 +369,7 @@ value:
{ {
COND_input* cond = (COND_input*) info; COND_input* cond = (COND_input*) info;
INSTALLSTATE install = INSTALLSTATE_UNKNOWN, action = INSTALLSTATE_UNKNOWN; INSTALLSTATE install = INSTALLSTATE_UNKNOWN, action = INSTALLSTATE_UNKNOWN;
if(MSI_GetFeatureStateW(cond->package, $2, &install, &action ) != ERROR_SUCCESS) if(MSI_GetFeatureStateW(cond->package, $2, &install, &action ) != ERROR_SUCCESS)
{ {
$$.type = VALUE_LITERAL; $$.type = VALUE_LITERAL;
...@@ -501,8 +501,8 @@ static INT compare_string( LPCWSTR a, INT operator, LPCWSTR b, BOOL convert ) ...@@ -501,8 +501,8 @@ static INT compare_string( LPCWSTR a, INT operator, LPCWSTR b, BOOL convert )
return compare_substring( a, operator, b ); return compare_substring( a, operator, b );
/* null and empty string are equivalent */ /* null and empty string are equivalent */
if (!a) a = szEmpty; if (!a) a = L"";
if (!b) b = szEmpty; if (!b) b = L"";
if (convert && str_is_number(a) && str_is_number(b)) if (convert && str_is_number(a) && str_is_number(b))
return compare_int( wcstol(a, NULL, 10), operator, wcstol(b, NULL, 10) ); return compare_int( wcstol(a, NULL, 10), operator, wcstol(b, NULL, 10) );
...@@ -581,7 +581,7 @@ static INT compare_int( INT a, INT operator, INT b ) ...@@ -581,7 +581,7 @@ static INT compare_int( INT a, INT operator, INT b )
static int COND_IsIdent( WCHAR x ) static int COND_IsIdent( WCHAR x )
{ {
return( COND_IsAlpha( x ) || COND_IsNumber( x ) || ( x == '_' ) return( COND_IsAlpha( x ) || COND_IsNumber( x ) || ( x == '_' )
|| ( x == '#' ) || (x == '.') ); || ( x == '#' ) || (x == '.') );
} }
...@@ -591,24 +591,24 @@ static int COND_GetOperator( COND_input *cond ) ...@@ -591,24 +591,24 @@ static int COND_GetOperator( COND_input *cond )
const WCHAR str[4]; const WCHAR str[4];
int id; int id;
} table[] = { } table[] = {
{ {'~','<','=',0}, COND_ILE }, { L"~<=", COND_ILE },
{ {'~','>','<',0}, COND_ISS }, { L"~><", COND_ISS },
{ {'~','>','>',0}, COND_IRHS }, { L"~>>", COND_IRHS },
{ {'~','<','>',0}, COND_INE }, { L"~<>", COND_INE },
{ {'~','>','=',0}, COND_IGE }, { L"~>=", COND_IGE },
{ {'~','<','<',0}, COND_ILHS }, { L"~<<", COND_ILHS },
{ {'~','=',0}, COND_IEQ }, { L"~=", COND_IEQ },
{ {'~','<',0}, COND_ILT }, { L"~<", COND_ILT },
{ {'~','>',0}, COND_IGT }, { L"~>", COND_IGT },
{ {'>','=',0}, COND_GE }, { L">=", COND_GE },
{ {'>','<',0}, COND_SS }, { L"><", COND_SS },
{ {'<','<',0}, COND_LHS }, { L"<<", COND_LHS },
{ {'<','>',0}, COND_NE }, { L"<>", COND_NE },
{ {'<','=',0}, COND_LE }, { L"<=", COND_LE },
{ {'>','>',0}, COND_RHS }, { L">>", COND_RHS },
{ {'>',0}, COND_GT }, { L">", COND_GT },
{ {'<',0}, COND_LT }, { L"<", COND_LT },
{ {0}, 0 } { L"", 0 }
}; };
LPCWSTR p = &cond->str[cond->n]; LPCWSTR p = &cond->str[cond->n];
int i = 0, len; int i = 0, len;
...@@ -672,31 +672,24 @@ static int COND_GetOne( struct cond_str *str, COND_input *cond ) ...@@ -672,31 +672,24 @@ static int COND_GetOne( struct cond_str *str, COND_input *cond )
} }
else if( COND_IsAlpha( ch ) ) else if( COND_IsAlpha( ch ) )
{ {
static const WCHAR szNot[] = {'N','O','T',0};
static const WCHAR szAnd[] = {'A','N','D',0};
static const WCHAR szXor[] = {'X','O','R',0};
static const WCHAR szEqv[] = {'E','Q','V',0};
static const WCHAR szImp[] = {'I','M','P',0};
static const WCHAR szOr[] = {'O','R',0};
while( COND_IsIdent( str->data[len] ) ) while( COND_IsIdent( str->data[len] ) )
len++; len++;
rc = COND_IDENT; rc = COND_IDENT;
if ( len == 3 ) if ( len == 3 )
{ {
if ( !wcsnicmp( str->data, szNot, len ) ) if ( !wcsnicmp( str->data, L"NOT", len ) )
rc = COND_NOT; rc = COND_NOT;
else if( !wcsnicmp( str->data, szAnd, len ) ) else if( !wcsnicmp( str->data, L"AND", len ) )
rc = COND_AND; rc = COND_AND;
else if( !wcsnicmp( str->data, szXor, len ) ) else if( !wcsnicmp( str->data, L"XOR", len ) )
rc = COND_XOR; rc = COND_XOR;
else if( !wcsnicmp( str->data, szEqv, len ) ) else if( !wcsnicmp( str->data, L"EQV", len ) )
rc = COND_EQV; rc = COND_EQV;
else if( !wcsnicmp( str->data, szImp, len ) ) else if( !wcsnicmp( str->data, L"IMP", len ) )
rc = COND_IMP; rc = COND_IMP;
} }
else if( (len == 2) && !wcsnicmp( str->data, szOr, len ) ) else if( (len == 2) && !wcsnicmp( str->data, L"OR", len ) )
rc = COND_OR; rc = COND_OR;
} }
else if( COND_IsNumber( ch ) ) else if( COND_IsNumber( ch ) )
...@@ -725,7 +718,7 @@ static int cond_lex( void *COND_lval, COND_input *cond ) ...@@ -725,7 +718,7 @@ static int cond_lex( void *COND_lval, COND_input *cond )
do { do {
rc = COND_GetOne( str, cond ); rc = COND_GetOne( str, cond );
} while (rc == COND_SPACE); } while (rc == COND_SPACE);
return rc; return rc;
} }
......
...@@ -196,7 +196,7 @@ UINT DELETE_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table ) ...@@ -196,7 +196,7 @@ UINT DELETE_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table )
dv = msi_alloc_zero( sizeof *dv ); dv = msi_alloc_zero( sizeof *dv );
if( !dv ) if( !dv )
return ERROR_FUNCTION_FAILED; return ERROR_FUNCTION_FAILED;
/* fill the structure */ /* fill the structure */
dv->view.ops = &delete_ops; dv->view.ops = &delete_ops;
dv->db = db; dv->db = db;
......
...@@ -287,7 +287,7 @@ UINT DISTINCT_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table ) ...@@ -287,7 +287,7 @@ UINT DISTINCT_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table )
dv = msi_alloc_zero( sizeof *dv ); dv = msi_alloc_zero( sizeof *dv );
if( !dv ) if( !dv )
return ERROR_FUNCTION_FAILED; return ERROR_FUNCTION_FAILED;
/* fill the structure */ /* fill the structure */
dv->view.ops = &distinct_ops; dv->view.ops = &distinct_ops;
msiobj_addref( &db->hdr ); msiobj_addref( &db->hdr );
......
...@@ -160,7 +160,6 @@ DWORD msi_get_file_version_info( MSIPACKAGE *package, const WCHAR *path, DWORD b ...@@ -160,7 +160,6 @@ DWORD msi_get_file_version_info( MSIPACKAGE *package, const WCHAR *path, DWORD b
VS_FIXEDFILEINFO *msi_get_disk_file_version( MSIPACKAGE *package, const WCHAR *filename ) VS_FIXEDFILEINFO *msi_get_disk_file_version( MSIPACKAGE *package, const WCHAR *filename )
{ {
static const WCHAR name[] = {'\\',0};
VS_FIXEDFILEINFO *ptr, *ret; VS_FIXEDFILEINFO *ptr, *ret;
DWORD version_size, size; DWORD version_size, size;
void *version; void *version;
...@@ -170,7 +169,7 @@ VS_FIXEDFILEINFO *msi_get_disk_file_version( MSIPACKAGE *package, const WCHAR *f ...@@ -170,7 +169,7 @@ VS_FIXEDFILEINFO *msi_get_disk_file_version( MSIPACKAGE *package, const WCHAR *f
msi_get_file_version_info( package, filename, version_size, version ); msi_get_file_version_info( package, filename, version_size, version );
if (!VerQueryValueW( version, name, (void **)&ptr, &size )) if (!VerQueryValueW( version, L"\\", (void **)&ptr, &size ))
{ {
msi_free( version ); msi_free( version );
return NULL; return NULL;
...@@ -267,7 +266,7 @@ static BOOL is_obsoleted_by_patch( MSIPACKAGE *package, MSIFILE *file ) ...@@ -267,7 +266,7 @@ static BOOL is_obsoleted_by_patch( MSIPACKAGE *package, MSIFILE *file )
{ {
if (!list_empty( &package->patches ) && file->disk_id < MSI_INITIAL_MEDIA_TRANSFORM_DISKID) if (!list_empty( &package->patches ) && file->disk_id < MSI_INITIAL_MEDIA_TRANSFORM_DISKID)
{ {
if (!msi_get_property_int( package->db, szInstalled, 0 )) return FALSE; if (!msi_get_property_int( package->db, L"Installed", 0 )) return FALSE;
return TRUE; return TRUE;
} }
if (is_registered_patch_media( package, file->disk_id )) return TRUE; if (is_registered_patch_media( package, file->disk_id )) return TRUE;
...@@ -442,7 +441,7 @@ static UINT copy_install_file(MSIPACKAGE *package, MSIFILE *file, LPWSTR source) ...@@ -442,7 +441,7 @@ static UINT copy_install_file(MSIPACKAGE *package, MSIFILE *file, LPWSTR source)
msi_free( pathW ); msi_free( pathW );
return ERROR_OUTOFMEMORY; return ERROR_OUTOFMEMORY;
} }
if (!GetTempFileNameW( pathW, szMsi, 0, tmpfileW )) tmpfileW[0] = 0; if (!GetTempFileNameW( pathW, L"msi", 0, tmpfileW )) tmpfileW[0] = 0;
msi_free( pathW ); msi_free( pathW );
if (msi_copy_file( package, source, tmpfileW, FALSE ) && if (msi_copy_file( package, source, tmpfileW, FALSE ) &&
...@@ -548,7 +547,7 @@ WCHAR *msi_resolve_file_source( MSIPACKAGE *package, MSIFILE *file ) ...@@ -548,7 +547,7 @@ WCHAR *msi_resolve_file_source( MSIPACKAGE *package, MSIFILE *file )
/* /*
* ACTION_InstallFiles() * ACTION_InstallFiles()
* *
* For efficiency, this is done in two passes: * For efficiency, this is done in two passes:
* 1) Correct all the TargetPaths and determine what files are to be installed. * 1) Correct all the TargetPaths and determine what files are to be installed.
* 2) Extract Cabinets and copy files. * 2) Extract Cabinets and copy files.
...@@ -562,7 +561,7 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package) ...@@ -562,7 +561,7 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package)
msi_set_sourcedir_props(package, FALSE); msi_set_sourcedir_props(package, FALSE);
if (package->script == SCRIPT_NONE) if (package->script == SCRIPT_NONE)
return msi_schedule_action(package, SCRIPT_INSTALL, szInstallFiles); return msi_schedule_action(package, SCRIPT_INSTALL, L"InstallFiles");
schedule_install_files(package); schedule_install_files(package);
mi = msi_alloc_zero( sizeof(MSIMEDIAINFO) ); mi = msi_alloc_zero( sizeof(MSIMEDIAINFO) );
...@@ -571,7 +570,7 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package) ...@@ -571,7 +570,7 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package)
{ {
BOOL is_global_assembly = msi_is_global_assembly( file->Component ); BOOL is_global_assembly = msi_is_global_assembly( file->Component );
msi_file_update_ui( package, file, szInstallFiles ); msi_file_update_ui( package, file, L"InstallFiles" );
rc = msi_load_media_info( package, file->Sequence, mi ); rc = msi_load_media_info( package, file->Sequence, mi );
if (rc != ERROR_SUCCESS) if (rc != ERROR_SUCCESS)
...@@ -583,7 +582,7 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package) ...@@ -583,7 +582,7 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package)
if (file->state != msifs_hashmatch && if (file->state != msifs_hashmatch &&
file->state != msifs_skipped && file->state != msifs_skipped &&
(file->state != msifs_present || !msi_get_property_int( package->db, szInstalled, 0 )) && (file->state != msifs_present || !msi_get_property_int( package->db, L"Installed", 0 )) &&
(rc = ready_media( package, file->IsCompressed, mi ))) (rc = ready_media( package, file->IsCompressed, mi )))
{ {
ERR("Failed to ready media for %s\n", debugstr_w(file->File)); ERR("Failed to ready media for %s\n", debugstr_w(file->File));
...@@ -790,7 +789,7 @@ UINT ACTION_PatchFiles( MSIPACKAGE *package ) ...@@ -790,7 +789,7 @@ UINT ACTION_PatchFiles( MSIPACKAGE *package )
TRACE("%p\n", package); TRACE("%p\n", package);
if (package->script == SCRIPT_NONE) if (package->script == SCRIPT_NONE)
return msi_schedule_action(package, SCRIPT_INSTALL, szPatchFiles); return msi_schedule_action(package, SCRIPT_INSTALL, L"PatchFiles");
mi = msi_alloc_zero( sizeof(MSIMEDIAINFO) ); mi = msi_alloc_zero( sizeof(MSIMEDIAINFO) );
...@@ -1129,7 +1128,7 @@ static UINT ITERATE_MoveFiles( MSIRECORD *rec, LPVOID param ) ...@@ -1129,7 +1128,7 @@ static UINT ITERATE_MoveFiles( MSIRECORD *rec, LPVOID param )
lstrcpyW(source, sourcedir); lstrcpyW(source, sourcedir);
if (source[lstrlenW(source) - 1] != '\\') if (source[lstrlenW(source) - 1] != '\\')
lstrcatW(source, szBackSlash); lstrcatW(source, L"\\");
lstrcatW(source, sourcename); lstrcatW(source, sourcename);
} }
...@@ -1167,7 +1166,7 @@ static UINT ITERATE_MoveFiles( MSIRECORD *rec, LPVOID param ) ...@@ -1167,7 +1166,7 @@ static UINT ITERATE_MoveFiles( MSIRECORD *rec, LPVOID param )
lstrcpyW(dest, destdir); lstrcpyW(dest, destdir);
if (dest[lstrlenW(dest) - 1] != '\\') if (dest[lstrlenW(dest) - 1] != '\\')
lstrcatW(dest, szBackSlash); lstrcatW(dest, L"\\");
if (destname) if (destname)
lstrcatW(dest, destname); lstrcatW(dest, destname);
...@@ -1205,16 +1204,13 @@ done: ...@@ -1205,16 +1204,13 @@ done:
UINT ACTION_MoveFiles( MSIPACKAGE *package ) UINT ACTION_MoveFiles( MSIPACKAGE *package )
{ {
static const WCHAR query[] = {
'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
'`','M','o','v','e','F','i','l','e','`',0};
MSIQUERY *view; MSIQUERY *view;
UINT rc; UINT rc;
if (package->script == SCRIPT_NONE) if (package->script == SCRIPT_NONE)
return msi_schedule_action(package, SCRIPT_INSTALL, szMoveFiles); return msi_schedule_action(package, SCRIPT_INSTALL, L"MoveFiles");
rc = MSI_DatabaseOpenViewW(package->db, query, &view); rc = MSI_DatabaseOpenViewW(package->db, L"SELECT * FROM `MoveFile`", &view);
if (rc != ERROR_SUCCESS) if (rc != ERROR_SUCCESS)
return ERROR_SUCCESS; return ERROR_SUCCESS;
...@@ -1338,16 +1334,13 @@ static UINT ITERATE_DuplicateFiles(MSIRECORD *row, LPVOID param) ...@@ -1338,16 +1334,13 @@ static UINT ITERATE_DuplicateFiles(MSIRECORD *row, LPVOID param)
UINT ACTION_DuplicateFiles(MSIPACKAGE *package) UINT ACTION_DuplicateFiles(MSIPACKAGE *package)
{ {
static const WCHAR query[] = {
'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
'`','D','u','p','l','i','c','a','t','e','F','i','l','e','`',0};
MSIQUERY *view; MSIQUERY *view;
UINT rc; UINT rc;
if (package->script == SCRIPT_NONE) if (package->script == SCRIPT_NONE)
return msi_schedule_action(package, SCRIPT_INSTALL, szDuplicateFiles); return msi_schedule_action(package, SCRIPT_INSTALL, L"DuplicateFiles");
rc = MSI_DatabaseOpenViewW(package->db, query, &view); rc = MSI_DatabaseOpenViewW(package->db, L"SELECT * FROM `DuplicateFile`", &view);
if (rc != ERROR_SUCCESS) if (rc != ERROR_SUCCESS)
return ERROR_SUCCESS; return ERROR_SUCCESS;
...@@ -1416,16 +1409,13 @@ static UINT ITERATE_RemoveDuplicateFiles( MSIRECORD *row, LPVOID param ) ...@@ -1416,16 +1409,13 @@ static UINT ITERATE_RemoveDuplicateFiles( MSIRECORD *row, LPVOID param )
UINT ACTION_RemoveDuplicateFiles( MSIPACKAGE *package ) UINT ACTION_RemoveDuplicateFiles( MSIPACKAGE *package )
{ {
static const WCHAR query[] = {
'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
'`','D','u','p','l','i','c','a','t','e','F','i','l','e','`',0};
MSIQUERY *view; MSIQUERY *view;
UINT rc; UINT rc;
if (package->script == SCRIPT_NONE) if (package->script == SCRIPT_NONE)
return msi_schedule_action(package, SCRIPT_INSTALL, szRemoveDuplicateFiles); return msi_schedule_action(package, SCRIPT_INSTALL, L"RemoveDuplicateFiles");
rc = MSI_DatabaseOpenViewW( package->db, query, &view ); rc = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `DuplicateFile`", &view );
if (rc != ERROR_SUCCESS) if (rc != ERROR_SUCCESS)
return ERROR_SUCCESS; return ERROR_SUCCESS;
...@@ -1557,18 +1547,15 @@ static void remove_folder( MSIFOLDER *folder ) ...@@ -1557,18 +1547,15 @@ static void remove_folder( MSIFOLDER *folder )
UINT ACTION_RemoveFiles( MSIPACKAGE *package ) UINT ACTION_RemoveFiles( MSIPACKAGE *package )
{ {
static const WCHAR query[] = {
'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
'`','R','e','m','o','v','e','F','i','l','e','`',0};
MSIQUERY *view; MSIQUERY *view;
MSICOMPONENT *comp; MSICOMPONENT *comp;
MSIFILE *file; MSIFILE *file;
UINT r; UINT r;
if (package->script == SCRIPT_NONE) if (package->script == SCRIPT_NONE)
return msi_schedule_action(package, SCRIPT_INSTALL, szRemoveFiles); return msi_schedule_action(package, SCRIPT_INSTALL, L"RemoveFiles");
r = MSI_DatabaseOpenViewW(package->db, query, &view); r = MSI_DatabaseOpenViewW(package->db, L"SELECT * FROM `RemoveFile`", &view);
if (r == ERROR_SUCCESS) if (r == ERROR_SUCCESS)
{ {
r = MSI_IterateRecords(view, NULL, ITERATE_RemoveFiles, package); r = MSI_IterateRecords(view, NULL, ITERATE_RemoveFiles, package);
...@@ -1583,7 +1570,7 @@ UINT ACTION_RemoveFiles( MSIPACKAGE *package ) ...@@ -1583,7 +1570,7 @@ UINT ACTION_RemoveFiles( MSIPACKAGE *package )
VS_FIXEDFILEINFO *ver; VS_FIXEDFILEINFO *ver;
comp = file->Component; comp = file->Component;
msi_file_update_ui( package, file, szRemoveFiles ); msi_file_update_ui( package, file, L"RemoveFiles" );
comp->Action = msi_get_component_action( package, comp ); comp->Action = msi_get_component_action( package, comp );
if (comp->Action != INSTALLSTATE_ABSENT || comp->Installed == INSTALLSTATE_SOURCE) if (comp->Action != INSTALLSTATE_ABSENT || comp->Installed == INSTALLSTATE_SOURCE)
......
...@@ -66,19 +66,6 @@ typedef struct _tagTT_NAME_RECORD { ...@@ -66,19 +66,6 @@ typedef struct _tagTT_NAME_RECORD {
#define SWAPWORD(x) MAKEWORD(HIBYTE(x), LOBYTE(x)) #define SWAPWORD(x) MAKEWORD(HIBYTE(x), LOBYTE(x))
#define SWAPLONG(x) MAKELONG(SWAPWORD(HIWORD(x)), SWAPWORD(LOWORD(x))) #define SWAPLONG(x) MAKELONG(SWAPWORD(HIWORD(x)), SWAPWORD(LOWORD(x)))
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};
/* /*
* Code based off of code located here * Code based off of code located here
* http://www.codeproject.com/gdi/fontnamefromfile.asp * http://www.codeproject.com/gdi/fontnamefromfile.asp
...@@ -178,7 +165,6 @@ end: ...@@ -178,7 +165,6 @@ end:
static WCHAR *font_name_from_file( MSIPACKAGE *package, const WCHAR *filename ) static WCHAR *font_name_from_file( MSIPACKAGE *package, const WCHAR *filename )
{ {
static const WCHAR truetypeW[] = {' ','(','T','r','u','e','T','y','p','e',')',0};
WCHAR *name, *ret = NULL; WCHAR *name, *ret = NULL;
if ((name = load_ttf_name_id( package, filename, NAME_ID_FULL_FONT_NAME ))) if ((name = load_ttf_name_id( package, filename, NAME_ID_FULL_FONT_NAME )))
...@@ -189,9 +175,9 @@ static WCHAR *font_name_from_file( MSIPACKAGE *package, const WCHAR *filename ) ...@@ -189,9 +175,9 @@ static WCHAR *font_name_from_file( MSIPACKAGE *package, const WCHAR *filename )
msi_free( name ); msi_free( name );
return NULL; return NULL;
} }
ret = msi_alloc( (lstrlenW( name ) + lstrlenW( truetypeW ) + 1 ) * sizeof(WCHAR) ); ret = msi_alloc( (lstrlenW( name ) + lstrlenW( L" (TrueType)" ) + 1 ) * sizeof(WCHAR) );
lstrcpyW( ret, name ); lstrcpyW( ret, name );
lstrcatW( ret, truetypeW ); lstrcatW( ret, L" (TrueType)" );
msi_free( name ); msi_free( name );
} }
return ret; return ret;
...@@ -199,7 +185,6 @@ static WCHAR *font_name_from_file( MSIPACKAGE *package, const WCHAR *filename ) ...@@ -199,7 +185,6 @@ static WCHAR *font_name_from_file( MSIPACKAGE *package, const WCHAR *filename )
WCHAR *msi_get_font_file_version( MSIPACKAGE *package, const WCHAR *filename ) WCHAR *msi_get_font_file_version( MSIPACKAGE *package, const WCHAR *filename )
{ {
static const WCHAR fmtW[] = {'%','u','.','%','u','.','0','.','0',0};
WCHAR *version, *p, *q, *ret = NULL; WCHAR *version, *p, *q, *ret = NULL;
if ((version = load_ttf_name_id( package, filename, NAME_ID_VERSION ))) if ((version = load_ttf_name_id( package, filename, NAME_ID_VERSION )))
...@@ -216,9 +201,9 @@ WCHAR *msi_get_font_file_version( MSIPACKAGE *package, const WCHAR *filename ) ...@@ -216,9 +201,9 @@ WCHAR *msi_get_font_file_version( MSIPACKAGE *package, const WCHAR *filename )
if (!*q || *q == ' ') minor = wcstol( p, NULL, 10 ); if (!*q || *q == ' ') minor = wcstol( p, NULL, 10 );
else major = 0; else major = 0;
} }
len = lstrlenW( fmtW ) + 20; len = lstrlenW( L"%u.%u.0.0" ) + 20;
ret = msi_alloc( len * sizeof(WCHAR) ); ret = msi_alloc( len * sizeof(WCHAR) );
swprintf( ret, len, fmtW, major, minor ); swprintf( ret, len, L"%u.%u.0.0", major, minor );
msi_free( version ); msi_free( version );
} }
return ret; return ret;
...@@ -255,8 +240,8 @@ static UINT ITERATE_RegisterFonts(MSIRECORD *row, LPVOID param) ...@@ -255,8 +240,8 @@ static UINT ITERATE_RegisterFonts(MSIRECORD *row, LPVOID param)
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
RegCreateKeyW(HKEY_LOCAL_MACHINE,regfont1,&hkey1); RegCreateKeyW( HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts" ,&hkey1 );
RegCreateKeyW(HKEY_LOCAL_MACHINE,regfont2,&hkey2); RegCreateKeyW( HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\CurrentVersion\\Fonts", &hkey2 );
if (MSI_RecordIsNull(row,2)) if (MSI_RecordIsNull(row,2))
name = font_name_from_file( package, file->TargetPath ); name = font_name_from_file( package, file->TargetPath );
...@@ -290,15 +275,13 @@ static UINT ITERATE_RegisterFonts(MSIRECORD *row, LPVOID param) ...@@ -290,15 +275,13 @@ static UINT ITERATE_RegisterFonts(MSIRECORD *row, LPVOID param)
UINT ACTION_RegisterFonts(MSIPACKAGE *package) UINT ACTION_RegisterFonts(MSIPACKAGE *package)
{ {
static const WCHAR query[] = {
'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','`','F','o','n','t','`',0};
MSIQUERY *view; MSIQUERY *view;
UINT rc; UINT rc;
if (package->script == SCRIPT_NONE) if (package->script == SCRIPT_NONE)
return msi_schedule_action(package, SCRIPT_INSTALL, szRegisterFonts); return msi_schedule_action(package, SCRIPT_INSTALL, L"RegisterFonts");
rc = MSI_DatabaseOpenViewW(package->db, query, &view); rc = MSI_DatabaseOpenViewW(package->db, L"SELECT * FROM `Font`", &view);
if (rc != ERROR_SUCCESS) if (rc != ERROR_SUCCESS)
return ERROR_SUCCESS; return ERROR_SUCCESS;
...@@ -338,8 +321,8 @@ static UINT ITERATE_UnregisterFonts( MSIRECORD *row, LPVOID param ) ...@@ -338,8 +321,8 @@ static UINT ITERATE_UnregisterFonts( MSIRECORD *row, LPVOID param )
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
RegCreateKeyW( HKEY_LOCAL_MACHINE, regfont1, &hkey1 ); RegCreateKeyW( HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts", &hkey1 );
RegCreateKeyW( HKEY_LOCAL_MACHINE, regfont2, &hkey2 ); RegCreateKeyW( HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\CurrentVersion\\Fonts", &hkey2 );
if (MSI_RecordIsNull( row, 2 )) if (MSI_RecordIsNull( row, 2 ))
name = font_name_from_file( package, file->TargetPath ); name = font_name_from_file( package, file->TargetPath );
...@@ -373,15 +356,13 @@ static UINT ITERATE_UnregisterFonts( MSIRECORD *row, LPVOID param ) ...@@ -373,15 +356,13 @@ static UINT ITERATE_UnregisterFonts( MSIRECORD *row, LPVOID param )
UINT ACTION_UnregisterFonts( MSIPACKAGE *package ) UINT ACTION_UnregisterFonts( MSIPACKAGE *package )
{ {
static const WCHAR query[] = {
'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','`','F','o','n','t','`',0};
MSIQUERY *view; MSIQUERY *view;
UINT r; UINT r;
if (package->script == SCRIPT_NONE) if (package->script == SCRIPT_NONE)
return msi_schedule_action(package, SCRIPT_INSTALL, szUnregisterFonts); return msi_schedule_action(package, SCRIPT_INSTALL, L"UnregisterFonts");
r = MSI_DatabaseOpenViewW( package->db, query, &view ); r = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `Font`", &view );
if (r != ERROR_SUCCESS) if (r != ERROR_SUCCESS)
return ERROR_SUCCESS; return ERROR_SUCCESS;
......
...@@ -341,7 +341,6 @@ static WCHAR *deformat_literal( FORMAT *format, FORMSTR *str, BOOL *propfound, ...@@ -341,7 +341,6 @@ static WCHAR *deformat_literal( FORMAT *format, FORMSTR *str, BOOL *propfound,
static WCHAR *build_default_format( const MSIRECORD *record ) static WCHAR *build_default_format( const MSIRECORD *record )
{ {
static const WCHAR fmt[] = {'%','i',':',' ','[','%','i',']',' ',0};
int i, count = MSI_RecordGetFieldCount( record ); int i, count = MSI_RecordGetFieldCount( record );
WCHAR *ret, *tmp, buf[26]; WCHAR *ret, *tmp, buf[26];
DWORD size = 1; DWORD size = 1;
...@@ -351,7 +350,7 @@ static WCHAR *build_default_format( const MSIRECORD *record ) ...@@ -351,7 +350,7 @@ static WCHAR *build_default_format( const MSIRECORD *record )
for (i = 1; i <= count; i++) for (i = 1; i <= count; i++)
{ {
size += swprintf( buf, ARRAY_SIZE(buf), fmt, i, i ); size += swprintf( buf, ARRAY_SIZE(buf), L"%d: [%d] ", i, i );
if (!(tmp = msi_realloc( ret, size * sizeof(*ret) ))) if (!(tmp = msi_realloc( ret, size * sizeof(*ret) )))
{ {
msi_free( ret ); msi_free( ret );
...@@ -754,7 +753,7 @@ static BOOL verify_format(LPWSTR data) ...@@ -754,7 +753,7 @@ static BOOL verify_format(LPWSTR data)
return TRUE; return TRUE;
} }
static DWORD deformat_string_internal(MSIPACKAGE *package, LPCWSTR ptr, static DWORD deformat_string_internal(MSIPACKAGE *package, LPCWSTR ptr,
WCHAR** data, DWORD *len, WCHAR** data, DWORD *len,
MSIRECORD* record) MSIRECORD* record)
{ {
...@@ -898,7 +897,7 @@ end: ...@@ -898,7 +897,7 @@ end:
return rc; return rc;
} }
UINT WINAPI MsiFormatRecordW( MSIHANDLE hInstall, MSIHANDLE hRecord, UINT WINAPI MsiFormatRecordW( MSIHANDLE hInstall, MSIHANDLE hRecord,
LPWSTR szResult, LPDWORD sz ) LPWSTR szResult, LPDWORD sz )
{ {
UINT r = ERROR_INVALID_HANDLE; UINT r = ERROR_INVALID_HANDLE;
......
...@@ -52,7 +52,7 @@ UINT WINAPI MsiDoActionA( MSIHANDLE hInstall, LPCSTR szAction ) ...@@ -52,7 +52,7 @@ UINT WINAPI MsiDoActionA( MSIHANDLE hInstall, LPCSTR szAction )
szwAction = strdupAtoW(szAction); szwAction = strdupAtoW(szAction);
if (szAction && !szwAction) if (szAction && !szwAction)
return ERROR_FUNCTION_FAILED; return ERROR_FUNCTION_FAILED;
ret = MsiDoActionW( hInstall, szwAction ); ret = MsiDoActionW( hInstall, szwAction );
msi_free( szwAction ); msi_free( szwAction );
...@@ -92,7 +92,7 @@ UINT WINAPI MsiDoActionW( MSIHANDLE hInstall, LPCWSTR szAction ) ...@@ -92,7 +92,7 @@ UINT WINAPI MsiDoActionW( MSIHANDLE hInstall, LPCWSTR szAction )
return ret; return ret;
} }
ret = ACTION_PerformAction(package, szAction); ret = ACTION_PerformAction(package, szAction);
msiobj_release( &package->hdr ); msiobj_release( &package->hdr );
...@@ -111,7 +111,7 @@ UINT WINAPI MsiSequenceA( MSIHANDLE hInstall, LPCSTR szTable, INT iSequenceMode ...@@ -111,7 +111,7 @@ UINT WINAPI MsiSequenceA( MSIHANDLE hInstall, LPCSTR szTable, INT iSequenceMode
szwTable = strdupAtoW(szTable); szwTable = strdupAtoW(szTable);
if (szTable && !szwTable) if (szTable && !szwTable)
return ERROR_FUNCTION_FAILED; return ERROR_FUNCTION_FAILED;
ret = MsiSequenceW( hInstall, szwTable, iSequenceMode ); ret = MsiSequenceW( hInstall, szwTable, iSequenceMode );
msi_free( szwTable ); msi_free( szwTable );
...@@ -166,7 +166,7 @@ UINT msi_strcpy_to_awstring( const WCHAR *str, int len, awstring *awbuf, DWORD * ...@@ -166,7 +166,7 @@ UINT msi_strcpy_to_awstring( const WCHAR *str, int len, awstring *awbuf, DWORD *
return ERROR_SUCCESS; return ERROR_SUCCESS;
if (len < 0) len = lstrlenW( str ); if (len < 0) len = lstrlenW( str );
if (awbuf->unicode && awbuf->str.w) if (awbuf->unicode && awbuf->str.w)
{ {
memcpy( awbuf->str.w, str, min(len + 1, *sz) * sizeof(WCHAR) ); memcpy( awbuf->str.w, str, min(len + 1, *sz) * sizeof(WCHAR) );
...@@ -359,7 +359,7 @@ UINT WINAPI MsiGetTargetPathW(MSIHANDLE hinst, const WCHAR *folder, WCHAR *buf, ...@@ -359,7 +359,7 @@ UINT WINAPI MsiGetTargetPathW(MSIHANDLE hinst, const WCHAR *folder, WCHAR *buf,
static WCHAR *get_source_root( MSIPACKAGE *package ) static WCHAR *get_source_root( MSIPACKAGE *package )
{ {
msi_set_sourcedir_props( package, FALSE ); msi_set_sourcedir_props( package, FALSE );
return msi_dup_property( package->db, szSourceDir ); return msi_dup_property( package->db, L"SourceDir" );
} }
WCHAR *msi_resolve_source_folder( MSIPACKAGE *package, const WCHAR *name, MSIFOLDER **folder ) WCHAR *msi_resolve_source_folder( MSIPACKAGE *package, const WCHAR *name, MSIFOLDER **folder )
...@@ -369,11 +369,11 @@ WCHAR *msi_resolve_source_folder( MSIPACKAGE *package, const WCHAR *name, MSIFOL ...@@ -369,11 +369,11 @@ WCHAR *msi_resolve_source_folder( MSIPACKAGE *package, const WCHAR *name, MSIFOL
TRACE("working to resolve %s\n", debugstr_w(name)); TRACE("working to resolve %s\n", debugstr_w(name));
if (!wcscmp( name, szSourceDir )) name = szTargetDir; if (!wcscmp( name, L"SourceDir" )) name = L"TARGETDIR";
if (!(f = msi_get_loaded_folder( package, name ))) return NULL; if (!(f = msi_get_loaded_folder( package, name ))) return NULL;
/* special resolving for root dir */ /* special resolving for root dir */
if (!wcscmp( name, szTargetDir ) && !f->ResolvedSource) if (!wcscmp( name, L"TARGETDIR" ) && !f->ResolvedSource)
{ {
f->ResolvedSource = get_source_root( package ); f->ResolvedSource = get_source_root( package );
} }
...@@ -598,7 +598,7 @@ UINT MSI_SetTargetPathW( MSIPACKAGE *package, LPCWSTR szFolder, LPCWSTR szFolder ...@@ -598,7 +598,7 @@ UINT MSI_SetTargetPathW( MSIPACKAGE *package, LPCWSTR szFolder, LPCWSTR szFolder
/*********************************************************************** /***********************************************************************
* MsiSetTargetPathW (MSI.@) * MsiSetTargetPathW (MSI.@)
*/ */
UINT WINAPI MsiSetTargetPathW(MSIHANDLE hInstall, LPCWSTR szFolder, UINT WINAPI MsiSetTargetPathW(MSIHANDLE hInstall, LPCWSTR szFolder,
LPCWSTR szFolderPath) LPCWSTR szFolderPath)
{ {
MSIPACKAGE *package; MSIPACKAGE *package;
...@@ -730,11 +730,11 @@ BOOL WINAPI MsiGetMode(MSIHANDLE hInstall, MSIRUNMODE iRunMode) ...@@ -730,11 +730,11 @@ BOOL WINAPI MsiGetMode(MSIHANDLE hInstall, MSIRUNMODE iRunMode)
break; break;
case MSIRUNMODE_MAINTENANCE: case MSIRUNMODE_MAINTENANCE:
r = msi_get_property_int( package->db, szInstalled, 0 ) != 0; r = msi_get_property_int( package->db, L"Installed", 0 ) != 0;
break; break;
case MSIRUNMODE_ROLLBACKENABLED: case MSIRUNMODE_ROLLBACKENABLED:
r = msi_get_property_int( package->db, szRollbackDisabled, 0 ) == 0; r = msi_get_property_int( package->db, L"RollbackDisabled", 0 ) == 0;
break; break;
case MSIRUNMODE_REBOOTATEND: case MSIRUNMODE_REBOOTATEND:
...@@ -823,7 +823,7 @@ UINT WINAPI MsiSetFeatureStateA(MSIHANDLE hInstall, LPCSTR szFeature, ...@@ -823,7 +823,7 @@ UINT WINAPI MsiSetFeatureStateA(MSIHANDLE hInstall, LPCSTR szFeature,
szwFeature = strdupAtoW(szFeature); szwFeature = strdupAtoW(szFeature);
rc = MsiSetFeatureStateW(hInstall,szwFeature, iState); rc = MsiSetFeatureStateW(hInstall,szwFeature, iState);
msi_free(szwFeature); msi_free(szwFeature);
...@@ -924,7 +924,7 @@ UINT MSI_SetFeatureStateW( MSIPACKAGE *package, LPCWSTR szFeature, INSTALLSTATE ...@@ -924,7 +924,7 @@ UINT MSI_SetFeatureStateW( MSIPACKAGE *package, LPCWSTR szFeature, INSTALLSTATE
if (!feature) if (!feature)
return ERROR_UNKNOWN_FEATURE; return ERROR_UNKNOWN_FEATURE;
if (iState == INSTALLSTATE_ADVERTISED && if (iState == INSTALLSTATE_ADVERTISED &&
feature->Attributes & msidbFeatureAttributesDisallowAdvertise) feature->Attributes & msidbFeatureAttributesDisallowAdvertise)
return ERROR_FUNCTION_FAILED; return ERROR_FUNCTION_FAILED;
...@@ -938,7 +938,7 @@ UINT MSI_SetFeatureStateW( MSIPACKAGE *package, LPCWSTR szFeature, INSTALLSTATE ...@@ -938,7 +938,7 @@ UINT MSI_SetFeatureStateW( MSIPACKAGE *package, LPCWSTR szFeature, INSTALLSTATE
if (child->Feature_Parent && !wcscmp( szFeature, child->Feature_Parent )) if (child->Feature_Parent && !wcscmp( szFeature, child->Feature_Parent ))
MSI_SetFeatureStateW(package, child->Feature, iState); MSI_SetFeatureStateW(package, child->Feature, iState);
} }
return rc; return rc;
} }
...@@ -1029,8 +1029,8 @@ UINT WINAPI MsiSetFeatureAttributesW( MSIHANDLE handle, LPCWSTR name, DWORD attr ...@@ -1029,8 +1029,8 @@ UINT WINAPI MsiSetFeatureAttributesW( MSIHANDLE handle, LPCWSTR name, DWORD attr
if (!(package = msihandle2msiinfo( handle, MSIHANDLETYPE_PACKAGE ))) if (!(package = msihandle2msiinfo( handle, MSIHANDLETYPE_PACKAGE )))
return ERROR_INVALID_HANDLE; return ERROR_INVALID_HANDLE;
costing = msi_dup_property( package->db, szCostingComplete ); costing = msi_dup_property( package->db, L"CostingComplete" );
if (!costing || !wcscmp( costing, szOne )) if (!costing || !wcscmp( costing, L"1" ))
{ {
msi_free( costing ); msi_free( costing );
msiobj_release( &package->hdr ); msiobj_release( &package->hdr );
...@@ -1055,7 +1055,7 @@ UINT WINAPI MsiGetFeatureStateA(MSIHANDLE hInstall, LPCSTR szFeature, ...@@ -1055,7 +1055,7 @@ UINT WINAPI MsiGetFeatureStateA(MSIHANDLE hInstall, LPCSTR szFeature,
{ {
LPWSTR szwFeature = NULL; LPWSTR szwFeature = NULL;
UINT rc; UINT rc;
if (szFeature && !(szwFeature = strdupAtoW(szFeature))) return ERROR_OUTOFMEMORY; if (szFeature && !(szwFeature = strdupAtoW(szFeature))) return ERROR_OUTOFMEMORY;
rc = MsiGetFeatureStateW(hInstall, szwFeature, piInstalled, piAction); rc = MsiGetFeatureStateW(hInstall, szwFeature, piInstalled, piAction);
...@@ -1400,7 +1400,7 @@ UINT WINAPI MsiGetComponentStateA(MSIHANDLE hInstall, LPCSTR szComponent, ...@@ -1400,7 +1400,7 @@ UINT WINAPI MsiGetComponentStateA(MSIHANDLE hInstall, LPCSTR szComponent,
{ {
LPWSTR szwComponent= NULL; LPWSTR szwComponent= NULL;
UINT rc; UINT rc;
szwComponent= strdupAtoW(szComponent); szwComponent= strdupAtoW(szComponent);
rc = MsiGetComponentStateW(hInstall,szwComponent,piInstalled, piAction); rc = MsiGetComponentStateW(hInstall,szwComponent,piInstalled, piAction);
...@@ -1567,14 +1567,13 @@ LANGID WINAPI MsiGetLanguage(MSIHANDLE hInstall) ...@@ -1567,14 +1567,13 @@ LANGID WINAPI MsiGetLanguage(MSIHANDLE hInstall)
return langid; return langid;
} }
langid = msi_get_property_int( package->db, szProductLanguage, 0 ); langid = msi_get_property_int( package->db, L"ProductLanguage", 0 );
msiobj_release( &package->hdr ); msiobj_release( &package->hdr );
return langid; return langid;
} }
UINT MSI_SetInstallLevel( MSIPACKAGE *package, int iInstallLevel ) UINT MSI_SetInstallLevel( MSIPACKAGE *package, int iInstallLevel )
{ {
static const WCHAR fmt[] = { '%','d',0 };
WCHAR level[6]; WCHAR level[6];
int len; int len;
UINT r; UINT r;
...@@ -1587,8 +1586,8 @@ UINT MSI_SetInstallLevel( MSIPACKAGE *package, int iInstallLevel ) ...@@ -1587,8 +1586,8 @@ UINT MSI_SetInstallLevel( MSIPACKAGE *package, int iInstallLevel )
if (iInstallLevel < 1) if (iInstallLevel < 1)
return MSI_SetFeatureStates( package ); return MSI_SetFeatureStates( package );
len = swprintf( level, ARRAY_SIZE(level), fmt, iInstallLevel ); len = swprintf( level, ARRAY_SIZE(level), L"%d", iInstallLevel );
r = msi_set_property( package->db, szInstallLevel, level, len ); r = msi_set_property( package->db, L"INSTALLLEVEL", level, len );
if ( r == ERROR_SUCCESS ) if ( r == ERROR_SUCCESS )
r = MSI_SetFeatureStates( package ); r = MSI_SetFeatureStates( package );
......
...@@ -82,7 +82,7 @@ static UINT msi_change_media(MSIPACKAGE *package, MSIMEDIAINFO *mi) ...@@ -82,7 +82,7 @@ static UINT msi_change_media(MSIPACKAGE *package, MSIMEDIAINFO *mi)
LPWSTR source_dir; LPWSTR source_dir;
UINT r = IDRETRY; UINT r = IDRETRY;
source_dir = msi_dup_property(package->db, szSourceDir); source_dir = msi_dup_property(package->db, L"SourceDir");
record = MSI_CreateRecord(2); record = MSI_CreateRecord(2);
while (r == IDRETRY && !source_matches_volume(mi, source_dir)) while (r == IDRETRY && !source_matches_volume(mi, source_dir))
...@@ -275,12 +275,7 @@ static UINT CDECL msi_media_get_disk_info(MSIPACKAGE *package, MSIMEDIAINFO *mi) ...@@ -275,12 +275,7 @@ static UINT CDECL msi_media_get_disk_info(MSIPACKAGE *package, MSIMEDIAINFO *mi)
{ {
MSIRECORD *row; MSIRECORD *row;
static const WCHAR query[] = { row = MSI_QueryGetRecord(package->db, L"SELECT * FROM `Media` WHERE `DiskId` = %d", mi->disk_id);
'S','E','L','E','C','T',' ','*',' ', 'F','R','O','M',' ',
'`','M','e','d','i','a','`',' ','W','H','E','R','E',' ',
'`','D','i','s','k','I','d','`',' ','=',' ','%','i',0};
row = MSI_QueryGetRecord(package->db, query, mi->disk_id);
if (!row) if (!row)
{ {
TRACE("Unable to query row\n"); TRACE("Unable to query row\n");
...@@ -473,7 +468,7 @@ static INT_PTR cabinet_copy_file(FDINOTIFICATIONTYPE fdint, ...@@ -473,7 +468,7 @@ static INT_PTR cabinet_copy_file(FDINOTIFICATIONTYPE fdint,
msi_free( tmppathW ); msi_free( tmppathW );
return ERROR_OUTOFMEMORY; return ERROR_OUTOFMEMORY;
} }
if (!GetTempFileNameW(tmppathW, szMsi, 0, tmpfileW)) tmpfileW[0] = 0; if (!GetTempFileNameW(tmppathW, L"msi", 0, tmpfileW)) tmpfileW[0] = 0;
msi_free( tmppathW ); msi_free( tmppathW );
handle = CreateFileW(tmpfileW, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, attrs, NULL); handle = CreateFileW(tmpfileW, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, attrs, NULL);
...@@ -679,7 +674,7 @@ static UINT get_drive_type(const WCHAR *path) ...@@ -679,7 +674,7 @@ static UINT get_drive_type(const WCHAR *path)
static WCHAR *get_base_url( MSIDATABASE *db ) static WCHAR *get_base_url( MSIDATABASE *db )
{ {
WCHAR *p, *ret = NULL, *orig_db = msi_dup_property( db, szOriginalDatabase ); WCHAR *p, *ret = NULL, *orig_db = msi_dup_property( db, L"OriginalDatabase" );
if (UrlIsW( orig_db, URLIS_URL ) && (ret = strdupW( orig_db )) && (p = wcsrchr( ret, '/'))) p[1] = 0; if (UrlIsW( orig_db, URLIS_URL ) && (ret = strdupW( orig_db )) && (p = wcsrchr( ret, '/'))) p[1] = 0;
msi_free( orig_db ); msi_free( orig_db );
return ret; return ret;
...@@ -687,10 +682,6 @@ static WCHAR *get_base_url( MSIDATABASE *db ) ...@@ -687,10 +682,6 @@ static WCHAR *get_base_url( MSIDATABASE *db )
UINT msi_load_media_info(MSIPACKAGE *package, UINT Sequence, MSIMEDIAINFO *mi) UINT msi_load_media_info(MSIPACKAGE *package, UINT Sequence, MSIMEDIAINFO *mi)
{ {
static const WCHAR query[] = {
'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','`','M','e','d','i','a','`',' ',
'W','H','E','R','E',' ','`','L','a','s','t','S','e','q','u','e','n','c','e','`',' ',
'>','=',' ','%','i',' ','O','R','D','E','R',' ','B','Y',' ','`','D','i','s','k','I','d','`',0};
MSIRECORD *row; MSIRECORD *row;
WCHAR *source_dir, *source, *base_url = NULL; WCHAR *source_dir, *source, *base_url = NULL;
DWORD options; DWORD options;
...@@ -698,7 +689,7 @@ UINT msi_load_media_info(MSIPACKAGE *package, UINT Sequence, MSIMEDIAINFO *mi) ...@@ -698,7 +689,7 @@ UINT msi_load_media_info(MSIPACKAGE *package, UINT Sequence, MSIMEDIAINFO *mi)
if (Sequence <= mi->last_sequence) /* already loaded */ if (Sequence <= mi->last_sequence) /* already loaded */
return ERROR_SUCCESS; return ERROR_SUCCESS;
row = MSI_QueryGetRecord(package->db, query, Sequence); row = MSI_QueryGetRecord(package->db, L"SELECT * FROM `Media` WHERE `LastSequence` >= %d ORDER BY `DiskId`", Sequence);
if (!row) if (!row)
{ {
TRACE("Unable to query row\n"); TRACE("Unable to query row\n");
...@@ -717,7 +708,7 @@ UINT msi_load_media_info(MSIPACKAGE *package, UINT Sequence, MSIMEDIAINFO *mi) ...@@ -717,7 +708,7 @@ UINT msi_load_media_info(MSIPACKAGE *package, UINT Sequence, MSIMEDIAINFO *mi)
msiobj_release(&row->hdr); msiobj_release(&row->hdr);
msi_set_sourcedir_props(package, FALSE); msi_set_sourcedir_props(package, FALSE);
source_dir = msi_dup_property(package->db, szSourceDir); source_dir = msi_dup_property(package->db, L"SourceDir");
lstrcpyW(mi->sourcedir, source_dir); lstrcpyW(mi->sourcedir, source_dir);
PathAddBackslashW(mi->sourcedir); PathAddBackslashW(mi->sourcedir);
mi->type = get_drive_type(source_dir); mi->type = get_drive_type(source_dir);
...@@ -902,7 +893,7 @@ UINT ready_media( MSIPACKAGE *package, BOOL compressed, MSIMEDIAINFO *mi ) ...@@ -902,7 +893,7 @@ UINT ready_media( MSIPACKAGE *package, BOOL compressed, MSIMEDIAINFO *mi )
/* assume first volume is in the drive */ /* assume first volume is in the drive */
if (mi->last_volume && wcsicmp( mi->last_volume, mi->volume_label )) if (mi->last_volume && wcsicmp( mi->last_volume, mi->volume_label ))
{ {
WCHAR *source = msi_dup_property( package->db, szSourceDir ); WCHAR *source = msi_dup_property( package->db, L"SourceDir" );
BOOL match = source_matches_volume( mi, source ); BOOL match = source_matches_volume( mi, source );
msi_free( source ); msi_free( source );
......
...@@ -2469,7 +2469,7 @@ UINT WINAPI MsiMessageBoxA(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uTyp ...@@ -2469,7 +2469,7 @@ UINT WINAPI MsiMessageBoxA(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uTyp
{ {
FIXME("%p %s %s %u %08x %08x\n", hWnd, debugstr_a(lpText), debugstr_a(lpCaption), FIXME("%p %s %s %u %08x %08x\n", hWnd, debugstr_a(lpText), debugstr_a(lpCaption),
uType, wLanguageId, f); uType, wLanguageId, f);
return MessageBoxExA(hWnd,lpText,lpCaption,uType,wLanguageId); return MessageBoxExA(hWnd,lpText,lpCaption,uType,wLanguageId);
} }
UINT WINAPI MsiMessageBoxW(HWND hWnd, LPCWSTR lpText, LPCWSTR lpCaption, UINT uType, UINT WINAPI MsiMessageBoxW(HWND hWnd, LPCWSTR lpText, LPCWSTR lpCaption, UINT uType,
...@@ -2477,7 +2477,7 @@ UINT WINAPI MsiMessageBoxW(HWND hWnd, LPCWSTR lpText, LPCWSTR lpCaption, UINT uT ...@@ -2477,7 +2477,7 @@ UINT WINAPI MsiMessageBoxW(HWND hWnd, LPCWSTR lpText, LPCWSTR lpCaption, UINT uT
{ {
FIXME("%p %s %s %u %08x %08x\n", hWnd, debugstr_w(lpText), debugstr_w(lpCaption), FIXME("%p %s %s %u %08x %08x\n", hWnd, debugstr_w(lpText), debugstr_w(lpCaption),
uType, wLanguageId, f); uType, wLanguageId, f);
return MessageBoxExW(hWnd,lpText,lpCaption,uType,wLanguageId); return MessageBoxExW(hWnd,lpText,lpCaption,uType,wLanguageId);
} }
UINT WINAPI MsiMessageBoxExA(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType, UINT WINAPI MsiMessageBoxExA(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType,
...@@ -3522,7 +3522,7 @@ UINT WINAPI MsiProvideQualifiedComponentW( LPCWSTR szComponent, ...@@ -3522,7 +3522,7 @@ UINT WINAPI MsiProvideQualifiedComponentW( LPCWSTR szComponent,
LPCWSTR szQualifier, DWORD dwInstallMode, LPWSTR lpPathBuf, LPCWSTR szQualifier, DWORD dwInstallMode, LPWSTR lpPathBuf,
LPDWORD pcchPathBuf) LPDWORD pcchPathBuf)
{ {
return MsiProvideQualifiedComponentExW(szComponent, szQualifier, return MsiProvideQualifiedComponentExW(szComponent, szQualifier,
dwInstallMode, NULL, 0, 0, lpPathBuf, pcchPathBuf); dwInstallMode, NULL, 0, 0, lpPathBuf, pcchPathBuf);
} }
...@@ -3989,7 +3989,7 @@ UINT WINAPI MsiReinstallFeatureW( LPCWSTR szProduct, LPCWSTR szFeature, DWORD dw ...@@ -3989,7 +3989,7 @@ UINT WINAPI MsiReinstallFeatureW( LPCWSTR szProduct, LPCWSTR szFeature, DWORD dw
if (dwReinstallMode & REINSTALLMODE_PACKAGE) if (dwReinstallMode & REINSTALLMODE_PACKAGE)
*ptr++ = 'v'; *ptr++ = 'v';
*ptr = 0; *ptr = 0;
sz = sizeof(sourcepath); sz = sizeof(sourcepath);
MsiSourceListGetInfoW( szProduct, NULL, context, MSICODE_PRODUCT, MsiSourceListGetInfoW( szProduct, NULL, context, MSICODE_PRODUCT,
INSTALLPROPERTY_LASTUSEDSOURCEW, sourcepath, &sz ); INSTALLPROPERTY_LASTUSEDSOURCEW, sourcepath, &sz );
......
...@@ -1137,111 +1137,6 @@ extern DWORD call_script(MSIHANDLE hPackage, INT type, LPCWSTR script, LPCWSTR f ...@@ -1137,111 +1137,6 @@ extern DWORD call_script(MSIHANDLE hPackage, INT type, LPCWSTR script, LPCWSTR f
/* User interface messages from the actions */ /* User interface messages from the actions */
extern void msi_ui_progress(MSIPACKAGE *, int, int, int, int) DECLSPEC_HIDDEN; extern void msi_ui_progress(MSIPACKAGE *, int, int, int, int) DECLSPEC_HIDDEN;
/* common strings */
static const WCHAR szSourceDir[] = {'S','o','u','r','c','e','D','i','r',0};
static const WCHAR szSOURCEDIR[] = {'S','O','U','R','C','E','D','I','R',0};
static const WCHAR szRootDrive[] = {'R','O','O','T','D','R','I','V','E',0};
static const WCHAR szTargetDir[] = {'T','A','R','G','E','T','D','I','R',0};
static const WCHAR szLocalSid[] = {'S','-','1','-','5','-','1','8',0};
static const WCHAR szAllSid[] = {'S','-','1','-','1','-','0',0};
static const WCHAR szEmpty[] = {0};
static const WCHAR szAll[] = {'A','L','L',0};
static const WCHAR szOne[] = {'1',0};
static const WCHAR szZero[] = {'0',0};
static const WCHAR szSpace[] = {' ',0};
static const WCHAR szBackSlash[] = {'\\',0};
static const WCHAR szForwardSlash[] = {'/',0};
static const WCHAR szDot[] = {'.',0};
static const WCHAR szDotDot[] = {'.','.',0};
static const WCHAR szSemiColon[] = {';',0};
static const WCHAR szPreselected[] = {'P','r','e','s','e','l','e','c','t','e','d',0};
static const WCHAR szPatches[] = {'P','a','t','c','h','e','s',0};
static const WCHAR szState[] = {'S','t','a','t','e',0};
static const WCHAR szMsi[] = {'m','s','i',0};
static const WCHAR szPatch[] = {'P','A','T','C','H',0};
static const WCHAR szSourceList[] = {'S','o','u','r','c','e','L','i','s','t',0};
static const WCHAR szInstalled[] = {'I','n','s','t','a','l','l','e','d',0};
static const WCHAR szReinstall[] = {'R','E','I','N','S','T','A','L','L',0};
static const WCHAR szReinstallMode[] = {'R','E','I','N','S','T','A','L','L','M','O','D','E',0};
static const WCHAR szRemove[] = {'R','E','M','O','V','E',0};
static const WCHAR szUserSID[] = {'U','s','e','r','S','I','D',0};
static const WCHAR szProductCode[] = {'P','r','o','d','u','c','t','C','o','d','e',0};
static const WCHAR szRegisterClassInfo[] = {'R','e','g','i','s','t','e','r','C','l','a','s','s','I','n','f','o',0};
static const WCHAR szRegisterProgIdInfo[] = {'R','e','g','i','s','t','e','r','P','r','o','g','I','d','I','n','f','o',0};
static const WCHAR szRegisterExtensionInfo[] = {'R','e','g','i','s','t','e','r','E','x','t','e','n','s','i','o','n','I','n','f','o',0};
static const WCHAR szRegisterMIMEInfo[] = {'R','e','g','i','s','t','e','r','M','I','M','E','I','n','f','o',0};
static const WCHAR szDuplicateFiles[] = {'D','u','p','l','i','c','a','t','e','F','i','l','e','s',0};
static const WCHAR szRemoveDuplicateFiles[] = {'R','e','m','o','v','e','D','u','p','l','i','c','a','t','e','F','i','l','e','s',0};
static const WCHAR szInstallFiles[] = {'I','n','s','t','a','l','l','F','i','l','e','s',0};
static const WCHAR szPatchFiles[] = {'P','a','t','c','h','F','i','l','e','s',0};
static const WCHAR szRemoveFiles[] = {'R','e','m','o','v','e','F','i','l','e','s',0};
static const WCHAR szFindRelatedProducts[] = {'F','i','n','d','R','e','l','a','t','e','d','P','r','o','d','u','c','t','s',0};
static const WCHAR szAllUsers[] = {'A','L','L','U','S','E','R','S',0};
static const WCHAR szCustomActionData[] = {'C','u','s','t','o','m','A','c','t','i','o','n','D','a','t','a',0};
static const WCHAR szUILevel[] = {'U','I','L','e','v','e','l',0};
static const WCHAR szProductID[] = {'P','r','o','d','u','c','t','I','D',0};
static const WCHAR szPIDTemplate[] = {'P','I','D','T','e','m','p','l','a','t','e',0};
static const WCHAR szPIDKEY[] = {'P','I','D','K','E','Y',0};
static const WCHAR szTYPELIB[] = {'T','Y','P','E','L','I','B',0};
static const WCHAR szSumInfo[] = {5 ,'S','u','m','m','a','r','y','I','n','f','o','r','m','a','t','i','o','n',0};
static const WCHAR szHCR[] = {'H','K','E','Y','_','C','L','A','S','S','E','S','_','R','O','O','T','\\',0};
static const WCHAR szHCU[] = {'H','K','E','Y','_','C','U','R','R','E','N','T','_','U','S','E','R','\\',0};
static const WCHAR szHLM[] = {'H','K','E','Y','_','L','O','C','A','L','_','M','A','C','H','I','N','E','\\',0};
static const WCHAR szHU[] = {'H','K','E','Y','_','U','S','E','R','S','\\',0};
static const WCHAR szWindowsFolder[] = {'W','i','n','d','o','w','s','F','o','l','d','e','r',0};
static const WCHAR szAppSearch[] = {'A','p','p','S','e','a','r','c','h',0};
static const WCHAR szMoveFiles[] = {'M','o','v','e','F','i','l','e','s',0};
static const WCHAR szCCPSearch[] = {'C','C','P','S','e','a','r','c','h',0};
static const WCHAR szUnregisterClassInfo[] = {'U','n','r','e','g','i','s','t','e','r','C','l','a','s','s','I','n','f','o',0};
static const WCHAR szUnregisterExtensionInfo[] = {'U','n','r','e','g','i','s','t','e','r','E','x','t','e','n','s','i','o','n','I','n','f','o',0};
static const WCHAR szUnregisterMIMEInfo[] = {'U','n','r','e','g','i','s','t','e','r','M','I','M','E','I','n','f','o',0};
static const WCHAR szUnregisterProgIdInfo[] = {'U','n','r','e','g','i','s','t','e','r','P','r','o','g','I','d','I','n','f','o',0};
static const WCHAR szRegisterFonts[] = {'R','e','g','i','s','t','e','r','F','o','n','t','s',0};
static const WCHAR szUnregisterFonts[] = {'U','n','r','e','g','i','s','t','e','r','F','o','n','t','s',0};
static const WCHAR szCLSID[] = {'C','L','S','I','D',0};
static const WCHAR szProgID[] = {'P','r','o','g','I','D',0};
static const WCHAR szVIProgID[] = {'V','e','r','s','i','o','n','I','n','d','e','p','e','n','d','e','n','t','P','r','o','g','I','D',0};
static const WCHAR szAppID[] = {'A','p','p','I','D',0};
static const WCHAR szDefaultIcon[] = {'D','e','f','a','u','l','t','I','c','o','n',0};
static const WCHAR szInprocHandler[] = {'I','n','p','r','o','c','H','a','n','d','l','e','r',0};
static const WCHAR szInprocHandler32[] = {'I','n','p','r','o','c','H','a','n','d','l','e','r','3','2',0};
static const WCHAR szMIMEDatabase[] = {'M','I','M','E','\\','D','a','t','a','b','a','s','e','\\','C','o','n','t','e','n','t',' ','T','y','p','e','\\',0};
static const WCHAR szLocalPackage[] = {'L','o','c','a','l','P','a','c','k','a','g','e',0};
static const WCHAR szOriginalDatabase[] = {'O','r','i','g','i','n','a','l','D','a','t','a','b','a','s','e',0};
static const WCHAR szUpgradeCode[] = {'U','p','g','r','a','d','e','C','o','d','e',0};
static const WCHAR szAdminUser[] = {'A','d','m','i','n','U','s','e','r',0};
static const WCHAR szIntel[] = {'I','n','t','e','l',0};
static const WCHAR szIntel64[] = {'I','n','t','e','l','6','4',0};
static const WCHAR szX64[] = {'x','6','4',0};
static const WCHAR szAMD64[] = {'A','M','D','6','4',0};
static const WCHAR szARM[] = {'A','r','m',0};
static const WCHAR szARM64[] = {'A','r','m','6','4',0};
static const WCHAR szStreams[] = {'_','S','t','r','e','a','m','s',0};
static const WCHAR szStorages[] = {'_','S','t','o','r','a','g','e','s',0};
static const WCHAR szMsiPublishAssemblies[] = {'M','s','i','P','u','b','l','i','s','h','A','s','s','e','m','b','l','i','e','s',0};
static const WCHAR szMsiUnpublishAssemblies[] = {'M','s','i','U','n','p','u','b','l','i','s','h','A','s','s','e','m','b','l','i','e','s',0};
static const WCHAR szCostingComplete[] = {'C','o','s','t','i','n','g','C','o','m','p','l','e','t','e',0};
static const WCHAR szTempFolder[] = {'T','e','m','p','F','o','l','d','e','r',0};
static const WCHAR szDatabase[] = {'D','A','T','A','B','A','S','E',0};
static const WCHAR szCRoot[] = {'C',':','\\',0};
static const WCHAR szProductLanguage[] = {'P','r','o','d','u','c','t','L','a','n','g','u','a','g','e',0};
static const WCHAR szProductVersion[] = {'P','r','o','d','u','c','t','V','e','r','s','i','o','n',0};
static const WCHAR szWindowsInstaller[] = {'W','i','n','d','o','w','s','I','n','s','t','a','l','l','e','r',0};
static const WCHAR szStringData[] = {'_','S','t','r','i','n','g','D','a','t','a',0};
static const WCHAR szStringPool[] = {'_','S','t','r','i','n','g','P','o','o','l',0};
static const WCHAR szInstallLevel[] = {'I','N','S','T','A','L','L','L','E','V','E','L',0};
static const WCHAR szCostInitialize[] = {'C','o','s','t','I','n','i','t','i','a','l','i','z','e',0};
static const WCHAR szAppDataFolder[] = {'A','p','p','D','a','t','a','F','o','l','d','e','r',0};
static const WCHAR szRollbackDisabled[] = {'R','o','l','l','b','a','c','k','D','i','s','a','b','l','e','d',0};
static const WCHAR szName[] = {'N','a','m','e',0};
static const WCHAR szData[] = {'D','a','t','a',0};
static const WCHAR szLangResource[] = {'\\','V','a','r','F','i','l','e','I','n','f','o','\\','T','r','a','n','s','l','a','t','i','o','n',0};
static const WCHAR szInstallLocation[] = {'I','n','s','t','a','l','l','L','o','c','a','t','i','o','n',0};
static const WCHAR szProperty[] = {'P','r','o','p','e','r','t','y',0};
static const WCHAR szUninstallable[] = {'U','n','i','n','s','t','a','l','l','a','b','l','e',0};
static const WCHAR szEXECUTEACTION[] = {'E','X','E','C','U','T','E','A','C','T','I','O','N',0};
static const WCHAR szProductToBeRegistered[] = {'P','r','o','d','u','c','t','T','o','B','e','R','e','g','i','s','t','e','r','e','d',0};
/* memory allocation macro functions */ /* memory allocation macro functions */
static void *msi_alloc( size_t len ) __WINE_ALLOC_SIZE(1); static void *msi_alloc( size_t len ) __WINE_ALLOC_SIZE(1);
static inline void *msi_alloc( size_t len ) static inline void *msi_alloc( size_t len )
......
...@@ -517,7 +517,7 @@ UINT WINAPI MsiViewExecute(MSIHANDLE hView, MSIHANDLE hRec) ...@@ -517,7 +517,7 @@ UINT WINAPI MsiViewExecute(MSIHANDLE hView, MSIHANDLE hRec)
MSIQUERY *query; MSIQUERY *query;
MSIRECORD *rec = NULL; MSIRECORD *rec = NULL;
UINT ret; UINT ret;
TRACE("%d %d\n", hView, hRec); TRACE("%d %d\n", hView, hRec);
if( hRec ) if( hRec )
...@@ -564,7 +564,6 @@ UINT WINAPI MsiViewExecute(MSIHANDLE hView, MSIHANDLE hRec) ...@@ -564,7 +564,6 @@ UINT WINAPI MsiViewExecute(MSIHANDLE hView, MSIHANDLE hRec)
static UINT msi_set_record_type_string( MSIRECORD *rec, UINT field, static UINT msi_set_record_type_string( MSIRECORD *rec, UINT field,
UINT type, BOOL temporary ) UINT type, BOOL temporary )
{ {
static const WCHAR fmt[] = { '%','d',0 };
WCHAR szType[0x10]; WCHAR szType[0x10];
if (MSITYPE_IS_BINARY(type)) if (MSITYPE_IS_BINARY(type))
...@@ -591,7 +590,7 @@ static UINT msi_set_record_type_string( MSIRECORD *rec, UINT field, ...@@ -591,7 +590,7 @@ static UINT msi_set_record_type_string( MSIRECORD *rec, UINT field,
if (type & MSITYPE_NULLABLE) if (type & MSITYPE_NULLABLE)
szType[0] &= ~0x20; szType[0] &= ~0x20;
swprintf( &szType[1], ARRAY_SIZE(szType) - 1, fmt, (type&0xff) ); swprintf( &szType[1], ARRAY_SIZE(szType) - 1, L"%d", (type&0xff) );
TRACE("type %04x -> %s\n", type, debugstr_w(szType) ); TRACE("type %04x -> %s\n", type, debugstr_w(szType) );
...@@ -798,7 +797,7 @@ MSIDBERROR WINAPI MsiViewGetErrorW( MSIHANDLE handle, LPWSTR buffer, LPDWORD buf ...@@ -798,7 +797,7 @@ MSIDBERROR WINAPI MsiViewGetErrorW( MSIHANDLE handle, LPWSTR buffer, LPDWORD buf
} }
__ENDTRY; __ENDTRY;
if (msi_strncpyW(remote_column ? remote_column : szEmpty, -1, buffer, buflen) == ERROR_MORE_DATA) if (msi_strncpyW(remote_column ? remote_column : L"", -1, buffer, buflen) == ERROR_MORE_DATA)
r = MSIDBERROR_MOREDATA; r = MSIDBERROR_MOREDATA;
if (remote_column) if (remote_column)
...@@ -808,7 +807,7 @@ MSIDBERROR WINAPI MsiViewGetErrorW( MSIHANDLE handle, LPWSTR buffer, LPDWORD buf ...@@ -808,7 +807,7 @@ MSIDBERROR WINAPI MsiViewGetErrorW( MSIHANDLE handle, LPWSTR buffer, LPDWORD buf
} }
if ((r = query->view->error)) column = query->view->error_column; if ((r = query->view->error)) column = query->view->error_column;
else column = szEmpty; else column = L"";
if (msi_strncpyW(column, -1, buffer, buflen) == ERROR_MORE_DATA) if (msi_strncpyW(column, -1, buffer, buflen) == ERROR_MORE_DATA)
r = MSIDBERROR_MOREDATA; r = MSIDBERROR_MOREDATA;
...@@ -849,7 +848,7 @@ MSIDBERROR WINAPI MsiViewGetErrorA( MSIHANDLE handle, LPSTR buffer, LPDWORD bufl ...@@ -849,7 +848,7 @@ MSIDBERROR WINAPI MsiViewGetErrorA( MSIHANDLE handle, LPSTR buffer, LPDWORD bufl
} }
__ENDTRY; __ENDTRY;
if (msi_strncpyWtoA(remote_column ? remote_column : szEmpty, -1, buffer, buflen, FALSE) == ERROR_MORE_DATA) if (msi_strncpyWtoA(remote_column ? remote_column : L"", -1, buffer, buflen, FALSE) == ERROR_MORE_DATA)
r = MSIDBERROR_MOREDATA; r = MSIDBERROR_MOREDATA;
if (remote_column) if (remote_column)
...@@ -859,7 +858,7 @@ MSIDBERROR WINAPI MsiViewGetErrorA( MSIHANDLE handle, LPSTR buffer, LPDWORD bufl ...@@ -859,7 +858,7 @@ MSIDBERROR WINAPI MsiViewGetErrorA( MSIHANDLE handle, LPSTR buffer, LPDWORD bufl
} }
if ((r = query->view->error)) column = query->view->error_column; if ((r = query->view->error)) column = query->view->error_column;
else column = szEmpty; else column = L"";
if (msi_strncpyWtoA(column, -1, buffer, buflen, FALSE) == ERROR_MORE_DATA) if (msi_strncpyWtoA(column, -1, buffer, buflen, FALSE) == ERROR_MORE_DATA)
r = MSIDBERROR_MOREDATA; r = MSIDBERROR_MOREDATA;
...@@ -1045,11 +1044,6 @@ static UINT msi_primary_key_iterator( MSIRECORD *rec, LPVOID param ) ...@@ -1045,11 +1044,6 @@ static UINT msi_primary_key_iterator( MSIRECORD *rec, LPVOID param )
UINT MSI_DatabaseGetPrimaryKeys( MSIDATABASE *db, UINT MSI_DatabaseGetPrimaryKeys( MSIDATABASE *db,
LPCWSTR table, MSIRECORD **prec ) LPCWSTR table, MSIRECORD **prec )
{ {
static const WCHAR sql[] = {
's','e','l','e','c','t',' ','*',' ',
'f','r','o','m',' ','`','_','C','o','l','u','m','n','s','`',' ',
'w','h','e','r','e',' ',
'`','T','a','b','l','e','`',' ','=',' ','\'','%','s','\'',0 };
struct msi_primary_key_record_info info; struct msi_primary_key_record_info info;
MSIQUERY *query = NULL; MSIQUERY *query = NULL;
UINT r; UINT r;
...@@ -1057,7 +1051,7 @@ UINT MSI_DatabaseGetPrimaryKeys( MSIDATABASE *db, ...@@ -1057,7 +1051,7 @@ UINT MSI_DatabaseGetPrimaryKeys( MSIDATABASE *db,
if (!TABLE_Exists( db, table )) if (!TABLE_Exists( db, table ))
return ERROR_INVALID_TABLE; return ERROR_INVALID_TABLE;
r = MSI_OpenQuery( db, &query, sql, table ); r = MSI_OpenQuery( db, &query, L"SELECT * FROM `_Columns` WHERE `Table` = '%s'", table );
if( r != ERROR_SUCCESS ) if( r != ERROR_SUCCESS )
return r; return r;
...@@ -1133,7 +1127,7 @@ UINT WINAPI MsiDatabaseGetPrimaryKeysW( MSIHANDLE hdb, ...@@ -1133,7 +1127,7 @@ UINT WINAPI MsiDatabaseGetPrimaryKeysW( MSIHANDLE hdb,
return r; return r;
} }
UINT WINAPI MsiDatabaseGetPrimaryKeysA(MSIHANDLE hdb, UINT WINAPI MsiDatabaseGetPrimaryKeysA(MSIHANDLE hdb,
LPCSTR table, MSIHANDLE* phRec) LPCSTR table, MSIHANDLE* phRec)
{ {
LPWSTR szwTable = NULL; LPWSTR szwTable = NULL;
......
...@@ -147,7 +147,7 @@ static BOOL string2intW( LPCWSTR str, int *out ) ...@@ -147,7 +147,7 @@ static BOOL string2intW( LPCWSTR str, int *out )
if( str[0] == '-' ) /* check if it's negative */ if( str[0] == '-' ) /* check if it's negative */
x = -x; x = -x;
*out = x; *out = x;
return TRUE; return TRUE;
} }
...@@ -439,7 +439,6 @@ const WCHAR *MSI_RecordGetString( const MSIRECORD *rec, UINT iField ) ...@@ -439,7 +439,6 @@ const WCHAR *MSI_RecordGetString( const MSIRECORD *rec, UINT iField )
UINT MSI_RecordGetStringW(MSIRECORD *rec, UINT iField, UINT MSI_RecordGetStringW(MSIRECORD *rec, UINT iField,
LPWSTR szValue, LPDWORD pcchValue) LPWSTR szValue, LPDWORD pcchValue)
{ {
static const WCHAR szFormat[] = {'%','d',0};
UINT len = 0, ret = ERROR_SUCCESS; UINT len = 0, ret = ERROR_SUCCESS;
WCHAR buffer[16]; WCHAR buffer[16];
...@@ -457,7 +456,7 @@ UINT MSI_RecordGetStringW(MSIRECORD *rec, UINT iField, ...@@ -457,7 +456,7 @@ UINT MSI_RecordGetStringW(MSIRECORD *rec, UINT iField,
switch( rec->fields[iField].type ) switch( rec->fields[iField].type )
{ {
case MSIFIELD_INT: case MSIFIELD_INT:
wsprintfW(buffer, szFormat, rec->fields[iField].u.iVal); wsprintfW(buffer, L"%d", rec->fields[iField].u.iVal);
len = lstrlenW( buffer ); len = lstrlenW( buffer );
if (szValue) if (szValue)
lstrcpynW(szValue, buffer, *pcchValue); lstrcpynW(szValue, buffer, *pcchValue);
......
...@@ -49,10 +49,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(msi); ...@@ -49,10 +49,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(msi);
#endif #endif
static const WCHAR szJScript[] = { 'J','S','c','r','i','p','t',0};
static const WCHAR szVBScript[] = { 'V','B','S','c','r','i','p','t',0};
static const WCHAR szSession[] = {'S','e','s','s','i','o','n',0};
/* /*
* MsiActiveScriptSite - Our IActiveScriptSite implementation. * MsiActiveScriptSite - Our IActiveScriptSite implementation.
*/ */
...@@ -135,7 +131,7 @@ static HRESULT WINAPI MsiActiveScriptSite_GetItemInfo(IActiveScriptSite* iface, ...@@ -135,7 +131,7 @@ static HRESULT WINAPI MsiActiveScriptSite_GetItemInfo(IActiveScriptSite* iface,
} }
/* Are we looking for the session object? */ /* Are we looking for the session object? */
if (!wcscmp(szSession, pstrName)) { if (!wcscmp(L"Session", pstrName)) {
if (dwReturnMask & SCRIPTINFO_ITYPEINFO) { if (dwReturnMask & SCRIPTINFO_ITYPEINFO) {
HRESULT hr = get_typeinfo(Session_tid, ppti); HRESULT hr = get_typeinfo(Session_tid, ppti);
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
...@@ -319,9 +315,9 @@ DWORD call_script(MSIHANDLE hPackage, INT type, LPCWSTR script, LPCWSTR function ...@@ -319,9 +315,9 @@ DWORD call_script(MSIHANDLE hPackage, INT type, LPCWSTR script, LPCWSTR function
/* Create the scripting engine */ /* Create the scripting engine */
type &= msidbCustomActionTypeJScript|msidbCustomActionTypeVBScript; type &= msidbCustomActionTypeJScript|msidbCustomActionTypeVBScript;
if (type == msidbCustomActionTypeJScript) if (type == msidbCustomActionTypeJScript)
hr = CLSIDFromProgID(szJScript, &clsid); hr = CLSIDFromProgID(L"JScript", &clsid);
else if (type == msidbCustomActionTypeVBScript) else if (type == msidbCustomActionTypeVBScript)
hr = CLSIDFromProgID(szVBScript, &clsid); hr = CLSIDFromProgID(L"VBScript", &clsid);
else { else {
ERR("Unknown script type %d\n", type); ERR("Unknown script type %d\n", type);
goto done; goto done;
...@@ -345,7 +341,7 @@ DWORD call_script(MSIHANDLE hPackage, INT type, LPCWSTR script, LPCWSTR function ...@@ -345,7 +341,7 @@ DWORD call_script(MSIHANDLE hPackage, INT type, LPCWSTR script, LPCWSTR function
hr = IActiveScriptParse_InitNew(pActiveScriptParse); hr = IActiveScriptParse_InitNew(pActiveScriptParse);
if (FAILED(hr)) goto done; if (FAILED(hr)) goto done;
hr = IActiveScript_AddNamedItem(pActiveScript, szSession, SCRIPTITEM_GLOBALMEMBERS|SCRIPTITEM_ISVISIBLE); hr = IActiveScript_AddNamedItem(pActiveScript, L"Session", SCRIPTITEM_GLOBALMEMBERS|SCRIPTITEM_ISVISIBLE);
if (FAILED(hr)) goto done; if (FAILED(hr)) goto done;
hr = IActiveScriptParse_ParseScriptText(pActiveScriptParse, script, NULL, NULL, NULL, 0, 0, 0L, NULL, NULL); hr = IActiveScriptParse_ParseScriptText(pActiveScriptParse, script, NULL, NULL, NULL, 0, 0, 0L, NULL, NULL);
......
...@@ -236,10 +236,10 @@ static UINT SELECT_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *na ...@@ -236,10 +236,10 @@ static UINT SELECT_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *na
n = sv->cols[ n - 1 ]; n = sv->cols[ n - 1 ];
if( !n ) if( !n )
{ {
if (name) *name = szEmpty; if (name) *name = L"";
if (type) *type = MSITYPE_UNKNOWN | MSITYPE_VALID; if (type) *type = MSITYPE_UNKNOWN | MSITYPE_VALID;
if (temporary) *temporary = FALSE; if (temporary) *temporary = FALSE;
if (table_name) *table_name = szEmpty; if (table_name) *table_name = L"";
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
return sv->table->ops->get_column_info( sv->table, n, name, return sv->table->ops->get_column_info( sv->table, n, name,
...@@ -404,7 +404,7 @@ static UINT SELECT_AddColumn( MSISELECTVIEW *sv, LPCWSTR name, ...@@ -404,7 +404,7 @@ static UINT SELECT_AddColumn( MSISELECTVIEW *sv, LPCWSTR name,
} }
sv->cols[sv->num_cols] = n; sv->cols[sv->num_cols] = n;
TRACE("Translating column %s from %d -> %d\n", TRACE("Translating column %s from %d -> %d\n",
debugstr_w( name ), sv->num_cols, n); debugstr_w( name ), sv->num_cols, n);
sv->num_cols++; sv->num_cols++;
...@@ -433,7 +433,7 @@ UINT SELECT_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table, ...@@ -433,7 +433,7 @@ UINT SELECT_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table,
sv = msi_alloc_zero( FIELD_OFFSET( MSISELECTVIEW, cols[count] )); sv = msi_alloc_zero( FIELD_OFFSET( MSISELECTVIEW, cols[count] ));
if( !sv ) if( !sv )
return ERROR_FUNCTION_FAILED; return ERROR_FUNCTION_FAILED;
/* fill the structure */ /* fill the structure */
sv->view.ops = &select_ops; sv->view.ops = &select_ops;
sv->db = db; sv->db = db;
......
...@@ -740,7 +740,6 @@ number: ...@@ -740,7 +740,6 @@ number:
static LPWSTR parser_add_table( void *info, LPCWSTR list, LPCWSTR table ) static LPWSTR parser_add_table( void *info, LPCWSTR list, LPCWSTR table )
{ {
static const WCHAR space[] = {' ',0};
DWORD len = lstrlenW( list ) + lstrlenW( table ) + 2; DWORD len = lstrlenW( list ) + lstrlenW( table ) + 2;
LPWSTR ret; LPWSTR ret;
...@@ -748,7 +747,7 @@ static LPWSTR parser_add_table( void *info, LPCWSTR list, LPCWSTR table ) ...@@ -748,7 +747,7 @@ static LPWSTR parser_add_table( void *info, LPCWSTR list, LPCWSTR table )
if( ret ) if( ret )
{ {
lstrcpyW( ret, list ); lstrcpyW( ret, list );
lstrcatW( ret, space ); lstrcatW( ret, L" " );
lstrcatW( ret, table ); lstrcatW( ret, table );
} }
return ret; return ret;
......
...@@ -316,16 +316,16 @@ static UINT STORAGES_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR * ...@@ -316,16 +316,16 @@ static UINT STORAGES_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *
switch (n) switch (n)
{ {
case 1: case 1:
if (name) *name = szName; if (name) *name = L"Name";
if (type) *type = MSITYPE_STRING | MSITYPE_VALID | MAX_STORAGES_NAME_LEN; if (type) *type = MSITYPE_STRING | MSITYPE_VALID | MAX_STORAGES_NAME_LEN;
break; break;
case 2: case 2:
if (name) *name = szData; if (name) *name = L"Data";
if (type) *type = MSITYPE_STRING | MSITYPE_VALID | MSITYPE_NULLABLE; if (type) *type = MSITYPE_STRING | MSITYPE_VALID | MSITYPE_NULLABLE;
break; break;
} }
if (table_name) *table_name = szStorages; if (table_name) *table_name = L"_Storages";
if (temporary) *temporary = FALSE; if (temporary) *temporary = FALSE;
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
......
...@@ -278,16 +278,16 @@ static UINT STREAMS_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *n ...@@ -278,16 +278,16 @@ static UINT STREAMS_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *n
switch (n) switch (n)
{ {
case 1: case 1:
if (name) *name = szName; if (name) *name = L"Name";
if (type) *type = MSITYPE_STRING | MSITYPE_VALID | MAX_STREAM_NAME_LEN; if (type) *type = MSITYPE_STRING | MSITYPE_VALID | MAX_STREAM_NAME_LEN;
break; break;
case 2: case 2:
if (name) *name = szData; if (name) *name = L"Data";
if (type) *type = MSITYPE_STRING | MSITYPE_VALID | MSITYPE_NULLABLE; if (type) *type = MSITYPE_STRING | MSITYPE_VALID | MSITYPE_NULLABLE;
break; break;
} }
if (table_name) *table_name = szStreams; if (table_name) *table_name = L"_Streams";
if (temporary) *temporary = FALSE; if (temporary) *temporary = FALSE;
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
...@@ -614,7 +614,7 @@ UINT msi_commit_streams( MSIDATABASE *db ) ...@@ -614,7 +614,7 @@ UINT msi_commit_streams( MSIDATABASE *db )
for (i = 0; i < db->num_streams; i++) for (i = 0; i < db->num_streams; i++)
{ {
name = msi_string_lookup( db->strings, db->streams[i].str_index, NULL ); name = msi_string_lookup( db->strings, db->streams[i].str_index, NULL );
if (!wcscmp( name, szSumInfo )) continue; if (!wcscmp( name, L"\5SummaryInformation" )) continue;
if (!(encname = encode_streamname( FALSE, name ))) return ERROR_OUTOFMEMORY; if (!(encname = encode_streamname( FALSE, name ))) return ERROR_OUTOFMEMORY;
TRACE("saving stream %s as %s\n", debugstr_w(name), debugstr_w(encname)); TRACE("saving stream %s as %s\n", debugstr_w(name), debugstr_w(encname));
......
...@@ -77,7 +77,7 @@ static string_table *init_stringtable( int entries, UINT codepage ) ...@@ -77,7 +77,7 @@ static string_table *init_stringtable( int entries, UINT codepage )
st = msi_alloc( sizeof (string_table) ); st = msi_alloc( sizeof (string_table) );
if( !st ) if( !st )
return NULL; return NULL;
if( entries < 1 ) if( entries < 1 )
entries = 1; entries = 1;
...@@ -85,7 +85,7 @@ static string_table *init_stringtable( int entries, UINT codepage ) ...@@ -85,7 +85,7 @@ static string_table *init_stringtable( int entries, UINT codepage )
if( !st->strings ) if( !st->strings )
{ {
msi_free( st ); msi_free( st );
return NULL; return NULL;
} }
st->sorted = msi_alloc( sizeof (UINT) * entries ); st->sorted = msi_alloc( sizeof (UINT) * entries );
...@@ -347,7 +347,7 @@ const WCHAR *msi_string_lookup( const string_table *st, UINT id, int *len ) ...@@ -347,7 +347,7 @@ const WCHAR *msi_string_lookup( const string_table *st, UINT id, int *len )
if( id == 0 ) if( id == 0 )
{ {
if (len) *len = 0; if (len) *len = 0;
return szEmpty; return L"";
} }
if( id >= st->maxcount ) if( id >= st->maxcount )
return NULL; return NULL;
...@@ -465,12 +465,12 @@ HRESULT msi_init_string_table( IStorage *stg ) ...@@ -465,12 +465,12 @@ HRESULT msi_init_string_table( IStorage *stg )
UINT ret; UINT ret;
/* create the StringPool stream... add the zero string to it*/ /* create the StringPool stream... add the zero string to it*/
ret = write_stream_data(stg, szStringPool, zero, sizeof zero, TRUE); ret = write_stream_data(stg, L"_StringPool", zero, sizeof zero, TRUE);
if (ret != ERROR_SUCCESS) if (ret != ERROR_SUCCESS)
return E_FAIL; return E_FAIL;
/* create the StringData stream... make it zero length */ /* create the StringData stream... make it zero length */
ret = write_stream_data(stg, szStringData, NULL, 0, TRUE); ret = write_stream_data(stg, L"_StringData", NULL, 0, TRUE);
if (ret != ERROR_SUCCESS) if (ret != ERROR_SUCCESS)
return E_FAIL; return E_FAIL;
...@@ -485,10 +485,10 @@ string_table *msi_load_string_table( IStorage *stg, UINT *bytes_per_strref ) ...@@ -485,10 +485,10 @@ string_table *msi_load_string_table( IStorage *stg, UINT *bytes_per_strref )
UINT r, datasize = 0, poolsize = 0, codepage; UINT r, datasize = 0, poolsize = 0, codepage;
DWORD i, count, offset, len, n, refs; DWORD i, count, offset, len, n, refs;
r = read_stream_data( stg, szStringPool, TRUE, (BYTE **)&pool, &poolsize ); r = read_stream_data( stg, L"_StringPool", TRUE, (BYTE **)&pool, &poolsize );
if( r != ERROR_SUCCESS) if( r != ERROR_SUCCESS)
goto end; goto end;
r = read_stream_data( stg, szStringData, TRUE, (BYTE **)&data, &datasize ); r = read_stream_data( stg, L"_StringData", TRUE, (BYTE **)&data, &datasize );
if( r != ERROR_SUCCESS) if( r != ERROR_SUCCESS)
goto end; goto end;
...@@ -652,11 +652,11 @@ UINT msi_save_string_table( const string_table *st, IStorage *storage, UINT *byt ...@@ -652,11 +652,11 @@ UINT msi_save_string_table( const string_table *st, IStorage *storage, UINT *byt
} }
/* write the streams */ /* write the streams */
r = write_stream_data( storage, szStringData, data, datasize, TRUE ); r = write_stream_data( storage, L"_StringData", data, datasize, TRUE );
TRACE("Wrote StringData r=%08x\n", r); TRACE("Wrote StringData r=%08x\n", r);
if( r ) if( r )
goto err; goto err;
r = write_stream_data( storage, szStringPool, pool, poolsize, TRUE ); r = write_stream_data( storage, L"_StringPool", pool, poolsize, TRUE );
TRACE("Wrote StringPool r=%08x\n", r); TRACE("Wrote StringPool r=%08x\n", r);
if( r ) if( r )
goto err; goto err;
......
...@@ -44,7 +44,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msi); ...@@ -44,7 +44,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msi);
#include "pshpack1.h" #include "pshpack1.h"
typedef struct { typedef struct {
WORD wByteOrder; WORD wByteOrder;
WORD wFormat; WORD wFormat;
DWORD dwOSVer; DWORD dwOSVer;
...@@ -52,20 +52,20 @@ typedef struct { ...@@ -52,20 +52,20 @@ typedef struct {
DWORD reserved; DWORD reserved;
} PROPERTYSETHEADER; } PROPERTYSETHEADER;
typedef struct { typedef struct {
FMTID fmtid; FMTID fmtid;
DWORD dwOffset; DWORD dwOffset;
} FORMATIDOFFSET; } FORMATIDOFFSET;
typedef struct { typedef struct {
DWORD cbSection; DWORD cbSection;
DWORD cProperties; DWORD cProperties;
} PROPERTYSECTIONHEADER; } PROPERTYSECTIONHEADER;
typedef struct { typedef struct {
DWORD propid; DWORD propid;
DWORD dwOffset; DWORD dwOffset;
} PROPERTYIDOFFSET; } PROPERTYIDOFFSET;
typedef struct { typedef struct {
DWORD type; DWORD type;
...@@ -79,7 +79,7 @@ typedef struct { ...@@ -79,7 +79,7 @@ typedef struct {
} str; } str;
} u; } u;
} PROPERTY_DATA; } PROPERTY_DATA;
#include "poppack.h" #include "poppack.h"
static HRESULT (WINAPI *pPropVariantChangeType) static HRESULT (WINAPI *pPropVariantChangeType)
...@@ -452,7 +452,7 @@ UINT msi_get_suminfo( IStorage *stg, UINT uiUpdateCount, MSISUMMARYINFO **ret ) ...@@ -452,7 +452,7 @@ UINT msi_get_suminfo( IStorage *stg, UINT uiUpdateCount, MSISUMMARYINFO **ret )
if (!(si = create_suminfo( stg, uiUpdateCount ))) return ERROR_OUTOFMEMORY; if (!(si = create_suminfo( stg, uiUpdateCount ))) return ERROR_OUTOFMEMORY;
hr = IStorage_OpenStream( si->storage, szSumInfo, 0, STGM_READ|STGM_SHARE_EXCLUSIVE, 0, &stm ); hr = IStorage_OpenStream( si->storage, L"\5SummaryInformation", 0, STGM_READ|STGM_SHARE_EXCLUSIVE, 0, &stm );
if (FAILED( hr )) if (FAILED( hr ))
{ {
msiobj_release( &si->hdr ); msiobj_release( &si->hdr );
...@@ -479,7 +479,7 @@ UINT msi_get_db_suminfo( MSIDATABASE *db, UINT uiUpdateCount, MSISUMMARYINFO **r ...@@ -479,7 +479,7 @@ UINT msi_get_db_suminfo( MSIDATABASE *db, UINT uiUpdateCount, MSISUMMARYINFO **r
if (!(si = create_suminfo( db->storage, uiUpdateCount ))) return ERROR_OUTOFMEMORY; if (!(si = create_suminfo( db->storage, uiUpdateCount ))) return ERROR_OUTOFMEMORY;
r = msi_get_stream( db, szSumInfo, &stm ); r = msi_get_stream( db, L"\5SummaryInformation", &stm );
if (r != ERROR_SUCCESS) if (r != ERROR_SUCCESS)
{ {
msiobj_release( &si->hdr ); msiobj_release( &si->hdr );
...@@ -498,7 +498,7 @@ UINT msi_get_db_suminfo( MSIDATABASE *db, UINT uiUpdateCount, MSISUMMARYINFO **r ...@@ -498,7 +498,7 @@ UINT msi_get_db_suminfo( MSIDATABASE *db, UINT uiUpdateCount, MSISUMMARYINFO **r
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
UINT WINAPI MsiGetSummaryInformationW( MSIHANDLE hDatabase, UINT WINAPI MsiGetSummaryInformationW( MSIHANDLE hDatabase,
LPCWSTR szDatabase, UINT uiUpdateCount, MSIHANDLE *pHandle ) LPCWSTR szDatabase, UINT uiUpdateCount, MSIHANDLE *pHandle )
{ {
MSISUMMARYINFO *si; MSISUMMARYINFO *si;
...@@ -569,7 +569,7 @@ UINT WINAPI MsiGetSummaryInformationW( MSIHANDLE hDatabase, ...@@ -569,7 +569,7 @@ UINT WINAPI MsiGetSummaryInformationW( MSIHANDLE hDatabase,
return ret; return ret;
} }
UINT WINAPI MsiGetSummaryInformationA(MSIHANDLE hDatabase, UINT WINAPI MsiGetSummaryInformationA(MSIHANDLE hDatabase,
LPCSTR szDatabase, UINT uiUpdateCount, MSIHANDLE *pHandle) LPCSTR szDatabase, UINT uiUpdateCount, MSIHANDLE *pHandle)
{ {
LPWSTR szwDatabase = NULL; LPWSTR szwDatabase = NULL;
...@@ -965,7 +965,7 @@ static UINT suminfo_persist( MSISUMMARYINFO *si ) ...@@ -965,7 +965,7 @@ static UINT suminfo_persist( MSISUMMARYINFO *si )
HRESULT r; HRESULT r;
grfMode = STGM_CREATE | STGM_READWRITE | STGM_SHARE_EXCLUSIVE; grfMode = STGM_CREATE | STGM_READWRITE | STGM_SHARE_EXCLUSIVE;
r = IStorage_CreateStream( si->storage, szSumInfo, grfMode, 0, 0, &stm ); r = IStorage_CreateStream( si->storage, L"\5SummaryInformation", grfMode, 0, 0, &stm );
if( SUCCEEDED(r) ) if( SUCCEEDED(r) )
{ {
ret = save_summary_info( si, stm ); ret = save_summary_info( si, stm );
...@@ -1244,7 +1244,6 @@ UINT WINAPI MsiCreateTransformSummaryInfoW( MSIHANDLE db, MSIHANDLE db_ref, LPCW ...@@ -1244,7 +1244,6 @@ UINT WINAPI MsiCreateTransformSummaryInfoW( MSIHANDLE db, MSIHANDLE db_ref, LPCW
UINT msi_load_suminfo_properties( MSIPACKAGE *package ) UINT msi_load_suminfo_properties( MSIPACKAGE *package )
{ {
static const WCHAR packagecodeW[] = {'P','a','c','k','a','g','e','C','o','d','e',0};
MSISUMMARYINFO *si; MSISUMMARYINFO *si;
WCHAR *package_code; WCHAR *package_code;
UINT r, len; UINT r, len;
...@@ -1285,7 +1284,7 @@ UINT msi_load_suminfo_properties( MSIPACKAGE *package ) ...@@ -1285,7 +1284,7 @@ UINT msi_load_suminfo_properties( MSIPACKAGE *package )
return r; return r;
} }
r = msi_set_property( package->db, packagecodeW, package_code, len ); r = msi_set_property( package->db, L"PackageCode", package_code, len );
msi_free( package_code ); msi_free( package_code );
count = 0; count = 0;
......
...@@ -97,13 +97,13 @@ static void append_productcode( MSIPACKAGE *package, const WCHAR *action_prop, c ...@@ -97,13 +97,13 @@ static void append_productcode( MSIPACKAGE *package, const WCHAR *action_prop, c
if (prop) if (prop)
{ {
lstrcpyW( newprop, prop ); lstrcpyW( newprop, prop );
lstrcatW( newprop, szSemiColon ); lstrcatW( newprop, L";" );
} }
else newprop[0] = 0; else newprop[0] = 0;
lstrcatW( newprop, product ); lstrcatW( newprop, product );
r = msi_set_property( package->db, action_prop, newprop, -1 ); r = msi_set_property( package->db, action_prop, newprop, -1 );
if (r == ERROR_SUCCESS && !wcscmp( action_prop, szSourceDir )) if (r == ERROR_SUCCESS && !wcscmp( action_prop, L"SourceDir" ))
msi_reset_source_folders( package ); msi_reset_source_folders( package );
TRACE( "related product property %s now %s\n", debugstr_w(action_prop), debugstr_w(newprop) ); TRACE( "related product property %s now %s\n", debugstr_w(action_prop), debugstr_w(newprop) );
...@@ -210,35 +210,32 @@ static UINT ITERATE_FindRelatedProducts(MSIRECORD *rec, LPVOID param) ...@@ -210,35 +210,32 @@ static UINT ITERATE_FindRelatedProducts(MSIRECORD *rec, LPVOID param)
} }
RegCloseKey(hkey); RegCloseKey(hkey);
msiobj_release( &uirow->hdr); msiobj_release( &uirow->hdr);
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
UINT ACTION_FindRelatedProducts(MSIPACKAGE *package) UINT ACTION_FindRelatedProducts(MSIPACKAGE *package)
{ {
static const WCHAR query[] = {
'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
'`','U','p','g','r','a','d','e','`',0};
MSIQUERY *view; MSIQUERY *view;
UINT rc; UINT rc;
if (msi_get_property_int(package->db, szInstalled, 0)) if (msi_get_property_int(package->db, L"Installed", 0))
{ {
TRACE("Skipping FindRelatedProducts action: product already installed\n"); TRACE("Skipping FindRelatedProducts action: product already installed\n");
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
if (msi_action_is_unique(package, szFindRelatedProducts)) if (msi_action_is_unique(package, L"FindRelatedProducts"))
{ {
TRACE("Skipping FindRelatedProducts action: already done in UI sequence\n"); TRACE("Skipping FindRelatedProducts action: already done in UI sequence\n");
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
else else
msi_register_unique_action(package, szFindRelatedProducts); msi_register_unique_action(package, L"FindRelatedProducts");
rc = MSI_DatabaseOpenViewW(package->db, query, &view); rc = MSI_DatabaseOpenViewW(package->db, L"SELECT * FROM `Upgrade`", &view);
if (rc != ERROR_SUCCESS) if (rc != ERROR_SUCCESS)
return ERROR_SUCCESS; return ERROR_SUCCESS;
rc = MSI_IterateRecords(view, NULL, ITERATE_FindRelatedProducts, package); rc = MSI_IterateRecords(view, NULL, ITERATE_FindRelatedProducts, package);
msiobj_release(&view->hdr); msiobj_release(&view->hdr);
return rc; return rc;
......
...@@ -1235,7 +1235,7 @@ UINT WHERE_CreateView( MSIDATABASE *db, MSIVIEW **view, LPWSTR tables, ...@@ -1235,7 +1235,7 @@ UINT WHERE_CreateView( MSIDATABASE *db, MSIVIEW **view, LPWSTR tables,
wv = msi_alloc_zero( sizeof *wv ); wv = msi_alloc_zero( sizeof *wv );
if( !wv ) if( !wv )
return ERROR_FUNCTION_FAILED; return ERROR_FUNCTION_FAILED;
/* fill the structure */ /* fill the structure */
wv->view.ops = &where_ops; wv->view.ops = &where_ops;
msiobj_addref( &db->hdr ); msiobj_addref( &db->hdr );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment