msi: Use wide character string literals in msi.c.
Signed-off-by: Hans Leidekker <hans@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
d9fbe788af
commit
8255da2249
182
dlls/msi/msi.c
182
dlls/msi/msi.c
|
@ -53,8 +53,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(msi);
|
||||||
|
|
||||||
BOOL is_wow64;
|
BOOL is_wow64;
|
||||||
|
|
||||||
static const WCHAR installerW[] = {'\\','I','n','s','t','a','l','l','e','r',0};
|
|
||||||
|
|
||||||
UINT msi_locate_product(LPCWSTR szProduct, MSIINSTALLCONTEXT *context)
|
UINT msi_locate_product(LPCWSTR szProduct, MSIINSTALLCONTEXT *context)
|
||||||
{
|
{
|
||||||
HKEY hkey = NULL;
|
HKEY hkey = NULL;
|
||||||
|
@ -109,10 +107,6 @@ static UINT MSI_OpenProductW(LPCWSTR szProduct, MSIPACKAGE **package)
|
||||||
LPWSTR path;
|
LPWSTR path;
|
||||||
MSIINSTALLCONTEXT context;
|
MSIINSTALLCONTEXT context;
|
||||||
|
|
||||||
static const WCHAR managed[] = {
|
|
||||||
'M','a','n','a','g','e','d','L','o','c','a','l','P','a','c','k','a','g','e',0};
|
|
||||||
static const WCHAR local[] = {'L','o','c','a','l','P','a','c','k','a','g','e',0};
|
|
||||||
|
|
||||||
TRACE("%s %p\n", debugstr_w(szProduct), package);
|
TRACE("%s %p\n", debugstr_w(szProduct), package);
|
||||||
|
|
||||||
r = msi_locate_product(szProduct, &context);
|
r = msi_locate_product(szProduct, &context);
|
||||||
|
@ -124,9 +118,9 @@ static UINT MSI_OpenProductW(LPCWSTR szProduct, MSIPACKAGE **package)
|
||||||
return ERROR_UNKNOWN_PRODUCT;
|
return ERROR_UNKNOWN_PRODUCT;
|
||||||
|
|
||||||
if (context == MSIINSTALLCONTEXT_USERMANAGED)
|
if (context == MSIINSTALLCONTEXT_USERMANAGED)
|
||||||
path = msi_reg_get_val_str(props, managed);
|
path = msi_reg_get_val_str(props, L"ManagedLocalPackage");
|
||||||
else
|
else
|
||||||
path = msi_reg_get_val_str(props, local);
|
path = msi_reg_get_val_str(props, L"LocalPackage");
|
||||||
|
|
||||||
r = ERROR_UNKNOWN_PRODUCT;
|
r = ERROR_UNKNOWN_PRODUCT;
|
||||||
|
|
||||||
|
@ -250,7 +244,7 @@ UINT WINAPI MsiInstallProductW(LPCWSTR szPackagePath, LPCWSTR szCommandLine)
|
||||||
if (!*szPackagePath)
|
if (!*szPackagePath)
|
||||||
return ERROR_PATH_NOT_FOUND;
|
return ERROR_PATH_NOT_FOUND;
|
||||||
|
|
||||||
reinstallmode = msi_get_command_line_option(szCommandLine, szReinstallMode, &len);
|
reinstallmode = msi_get_command_line_option(szCommandLine, L"REINSTALLMODE", &len);
|
||||||
if (reinstallmode)
|
if (reinstallmode)
|
||||||
{
|
{
|
||||||
while (len > 0)
|
while (len > 0)
|
||||||
|
@ -292,7 +286,7 @@ UINT WINAPI MsiReinstallProductW(LPCWSTR szProduct, DWORD dwReinstallMode)
|
||||||
{
|
{
|
||||||
TRACE("%s %08x\n", debugstr_w(szProduct), dwReinstallMode);
|
TRACE("%s %08x\n", debugstr_w(szProduct), dwReinstallMode);
|
||||||
|
|
||||||
return MsiReinstallFeatureW(szProduct, szAll, dwReinstallMode);
|
return MsiReinstallFeatureW(szProduct, L"ALL", dwReinstallMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT WINAPI MsiApplyPatchA(LPCSTR szPatchPackage, LPCSTR szInstallPackage,
|
UINT WINAPI MsiApplyPatchA(LPCSTR szPatchPackage, LPCSTR szInstallPackage,
|
||||||
|
@ -376,9 +370,6 @@ static UINT MSI_ApplyPatchW(LPCWSTR szPatchPackage, LPCWSTR szProductCode, LPCWS
|
||||||
LPWSTR cmd, *codes = NULL;
|
LPWSTR cmd, *codes = NULL;
|
||||||
BOOL succeeded = FALSE;
|
BOOL succeeded = FALSE;
|
||||||
|
|
||||||
static const WCHAR fmt[] = {'%','s',' ','P','A','T','C','H','=','"','%','s','"',0};
|
|
||||||
static const WCHAR empty[] = {0};
|
|
||||||
|
|
||||||
if (!szPatchPackage || !szPatchPackage[0])
|
if (!szPatchPackage || !szPatchPackage[0])
|
||||||
return ERROR_INVALID_PARAMETER;
|
return ERROR_INVALID_PARAMETER;
|
||||||
|
|
||||||
|
@ -386,16 +377,16 @@ static UINT MSI_ApplyPatchW(LPCWSTR szPatchPackage, LPCWSTR szProductCode, LPCWS
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
if (!szCommandLine)
|
if (!szCommandLine)
|
||||||
cmd_ptr = empty;
|
cmd_ptr = L"";
|
||||||
|
|
||||||
size = lstrlenW(cmd_ptr) + lstrlenW(fmt) + lstrlenW(szPatchPackage) + 1;
|
size = lstrlenW(cmd_ptr) + lstrlenW(L"%s PATCH=\"%s\"") + lstrlenW(szPatchPackage) + 1;
|
||||||
cmd = msi_alloc(size * sizeof(WCHAR));
|
cmd = msi_alloc(size * sizeof(WCHAR));
|
||||||
if (!cmd)
|
if (!cmd)
|
||||||
{
|
{
|
||||||
msi_free(codes);
|
msi_free(codes);
|
||||||
return ERROR_OUTOFMEMORY;
|
return ERROR_OUTOFMEMORY;
|
||||||
}
|
}
|
||||||
swprintf(cmd, size, fmt, cmd_ptr, szPatchPackage);
|
swprintf(cmd, size, L"%s PATCH=\"%s\"", cmd_ptr, szPatchPackage);
|
||||||
|
|
||||||
if (szProductCode)
|
if (szProductCode)
|
||||||
r = MsiConfigureProductExW(szProductCode, INSTALLLEVEL_DEFAULT, INSTALLSTATE_DEFAULT, cmd);
|
r = MsiConfigureProductExW(szProductCode, INSTALLLEVEL_DEFAULT, INSTALLSTATE_DEFAULT, cmd);
|
||||||
|
@ -603,9 +594,6 @@ static UINT MSI_ApplicablePatchW( MSIPACKAGE *package, LPCWSTR patch )
|
||||||
/* IXMLDOMDocument should be set to XPath mode already */
|
/* IXMLDOMDocument should be set to XPath mode already */
|
||||||
static UINT MSI_ApplicablePatchXML( MSIPACKAGE *package, IXMLDOMDocument *desc )
|
static UINT MSI_ApplicablePatchXML( MSIPACKAGE *package, IXMLDOMDocument *desc )
|
||||||
{
|
{
|
||||||
static const WCHAR queryW[] = {'M','s','i','P','a','t','c','h','/',
|
|
||||||
'T','a','r','g','e','t','P','r','o','d','u','c','t','/',
|
|
||||||
'T','a','r','g','e','t','P','r','o','d','u','c','t','C','o','d','e',0};
|
|
||||||
UINT r = ERROR_FUNCTION_FAILED;
|
UINT r = ERROR_FUNCTION_FAILED;
|
||||||
IXMLDOMNodeList *list;
|
IXMLDOMNodeList *list;
|
||||||
LPWSTR product_code;
|
LPWSTR product_code;
|
||||||
|
@ -613,7 +601,7 @@ static UINT MSI_ApplicablePatchXML( MSIPACKAGE *package, IXMLDOMDocument *desc )
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
BSTR s;
|
BSTR s;
|
||||||
|
|
||||||
product_code = msi_dup_property( package->db, szProductCode );
|
product_code = msi_dup_property( package->db, L"ProductCode" );
|
||||||
if (!product_code)
|
if (!product_code)
|
||||||
{
|
{
|
||||||
/* FIXME: the property ProductCode should be written into the DB somewhere */
|
/* FIXME: the property ProductCode should be written into the DB somewhere */
|
||||||
|
@ -621,7 +609,7 @@ static UINT MSI_ApplicablePatchXML( MSIPACKAGE *package, IXMLDOMDocument *desc )
|
||||||
return ERROR_SUCCESS;
|
return ERROR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
s = SysAllocString(queryW);
|
s = SysAllocString( L"MsiPatch/TargetProduct/TargetProductCode" );
|
||||||
hr = IXMLDOMDocument_selectNodes( desc, s, &list );
|
hr = IXMLDOMDocument_selectNodes( desc, s, &list );
|
||||||
SysFreeString(s);
|
SysFreeString(s);
|
||||||
if (hr != S_OK)
|
if (hr != S_OK)
|
||||||
|
@ -808,7 +796,7 @@ static UINT open_package( const WCHAR *product, const WCHAR *usersid,
|
||||||
r = MSIREG_OpenInstallProps( product, context, usersid, &props, FALSE );
|
r = MSIREG_OpenInstallProps( product, context, usersid, &props, FALSE );
|
||||||
if (r != ERROR_SUCCESS) return ERROR_BAD_CONFIGURATION;
|
if (r != ERROR_SUCCESS) return ERROR_BAD_CONFIGURATION;
|
||||||
|
|
||||||
if ((localpath = msi_reg_get_val_str( props, szLocalPackage )))
|
if ((localpath = msi_reg_get_val_str( props, L"LocalPackage" )))
|
||||||
{
|
{
|
||||||
lstrcpyW( sourcepath, localpath );
|
lstrcpyW( sourcepath, localpath );
|
||||||
msi_free( localpath );
|
msi_free( localpath );
|
||||||
|
@ -858,15 +846,6 @@ UINT WINAPI MsiConfigureProductExW(LPCWSTR szProduct, int iInstallLevel,
|
||||||
WCHAR sourcepath[MAX_PATH], filename[MAX_PATH];
|
WCHAR sourcepath[MAX_PATH], filename[MAX_PATH];
|
||||||
LPWSTR commandline;
|
LPWSTR commandline;
|
||||||
|
|
||||||
static const WCHAR szInstalled[] = {
|
|
||||||
' ','I','n','s','t','a','l','l','e','d','=','1',0};
|
|
||||||
static const WCHAR szMaxInstallLevel[] = {
|
|
||||||
' ','I','N','S','T','A','L','L','L','E','V','E','L','=','3','2','7','6','7',0};
|
|
||||||
static const WCHAR szRemoveAll[] = {
|
|
||||||
' ','R','E','M','O','V','E','=','A','L','L',0};
|
|
||||||
static const WCHAR szMachine[] = {
|
|
||||||
' ','A','L','L','U','S','E','R','S','=','1',0};
|
|
||||||
|
|
||||||
TRACE("%s %d %d %s\n",debugstr_w(szProduct), iInstallLevel, eInstallState,
|
TRACE("%s %d %d %s\n",debugstr_w(szProduct), iInstallLevel, eInstallState,
|
||||||
debugstr_w(szCommandLine));
|
debugstr_w(szCommandLine));
|
||||||
|
|
||||||
|
@ -888,19 +867,19 @@ UINT WINAPI MsiConfigureProductExW(LPCWSTR szProduct, int iInstallLevel,
|
||||||
if (r != ERROR_SUCCESS)
|
if (r != ERROR_SUCCESS)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
sz = lstrlenW(szInstalled) + 1;
|
sz = lstrlenW(L" Installed=1") + 1;
|
||||||
|
|
||||||
if (szCommandLine)
|
if (szCommandLine)
|
||||||
sz += lstrlenW(szCommandLine);
|
sz += lstrlenW(szCommandLine);
|
||||||
|
|
||||||
if (eInstallState != INSTALLSTATE_DEFAULT)
|
if (eInstallState != INSTALLSTATE_DEFAULT)
|
||||||
sz += lstrlenW(szMaxInstallLevel);
|
sz += lstrlenW(L" INSTALLLEVEL=32767");
|
||||||
|
|
||||||
if (eInstallState == INSTALLSTATE_ABSENT)
|
if (eInstallState == INSTALLSTATE_ABSENT)
|
||||||
sz += lstrlenW(szRemoveAll);
|
sz += lstrlenW(L" REMOVE=ALL");
|
||||||
|
|
||||||
if (context == MSIINSTALLCONTEXT_MACHINE)
|
if (context == MSIINSTALLCONTEXT_MACHINE)
|
||||||
sz += lstrlenW(szMachine);
|
sz += lstrlenW(L" ALLUSERS=1");
|
||||||
|
|
||||||
commandline = msi_alloc(sz * sizeof(WCHAR));
|
commandline = msi_alloc(sz * sizeof(WCHAR));
|
||||||
if (!commandline)
|
if (!commandline)
|
||||||
|
@ -911,16 +890,16 @@ UINT WINAPI MsiConfigureProductExW(LPCWSTR szProduct, int iInstallLevel,
|
||||||
|
|
||||||
commandline[0] = 0;
|
commandline[0] = 0;
|
||||||
if (szCommandLine)
|
if (szCommandLine)
|
||||||
lstrcpyW(commandline,szCommandLine);
|
lstrcpyW(commandline, szCommandLine);
|
||||||
|
|
||||||
if (eInstallState != INSTALLSTATE_DEFAULT)
|
if (eInstallState != INSTALLSTATE_DEFAULT)
|
||||||
lstrcatW(commandline, szMaxInstallLevel);
|
lstrcatW(commandline, L" INSTALLLEVEL=32767");
|
||||||
|
|
||||||
if (eInstallState == INSTALLSTATE_ABSENT)
|
if (eInstallState == INSTALLSTATE_ABSENT)
|
||||||
lstrcatW(commandline, szRemoveAll);
|
lstrcatW(commandline, L" REMOVE=ALL");
|
||||||
|
|
||||||
if (context == MSIINSTALLCONTEXT_MACHINE)
|
if (context == MSIINSTALLCONTEXT_MACHINE)
|
||||||
lstrcatW(commandline, szMachine);
|
lstrcatW(commandline, L" ALLUSERS=1");
|
||||||
|
|
||||||
sz = sizeof(sourcepath);
|
sz = sizeof(sourcepath);
|
||||||
MsiSourceListGetInfoW(szProduct, NULL, context, MSICODE_PRODUCT,
|
MsiSourceListGetInfoW(szProduct, NULL, context, MSICODE_PRODUCT,
|
||||||
|
@ -1041,7 +1020,7 @@ UINT WINAPI MsiGetProductCodeW(LPCWSTR szComponent, LPWSTR szBuffer)
|
||||||
return ERROR_INVALID_PARAMETER;
|
return ERROR_INVALID_PARAMETER;
|
||||||
|
|
||||||
if (MSIREG_OpenUserDataComponentKey(szComponent, NULL, &compkey, FALSE) != ERROR_SUCCESS &&
|
if (MSIREG_OpenUserDataComponentKey(szComponent, NULL, &compkey, FALSE) != ERROR_SUCCESS &&
|
||||||
MSIREG_OpenUserDataComponentKey(szComponent, szLocalSid, &compkey, FALSE) != ERROR_SUCCESS)
|
MSIREG_OpenUserDataComponentKey(szComponent, L"S-1-5-18", &compkey, FALSE) != ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
return ERROR_UNKNOWN_COMPONENT;
|
return ERROR_UNKNOWN_COMPONENT;
|
||||||
}
|
}
|
||||||
|
@ -1102,12 +1081,11 @@ static WCHAR *reg_get_value( HKEY hkey, const WCHAR *name, DWORD *type )
|
||||||
if (*type == REG_SZ) return msi_reg_get_val_str( hkey, name );
|
if (*type == REG_SZ) return msi_reg_get_val_str( hkey, name );
|
||||||
if (*type == REG_DWORD)
|
if (*type == REG_DWORD)
|
||||||
{
|
{
|
||||||
static const WCHAR fmt[] = {'%','u',0};
|
|
||||||
WCHAR temp[11];
|
WCHAR temp[11];
|
||||||
DWORD val;
|
DWORD val;
|
||||||
|
|
||||||
if (!msi_reg_get_val_dword( hkey, name, &val )) return NULL;
|
if (!msi_reg_get_val_dword( hkey, name, &val )) return NULL;
|
||||||
swprintf( temp, ARRAY_SIZE(temp), fmt, val );
|
swprintf( temp, ARRAY_SIZE(temp), L"%u", val );
|
||||||
return strdupW( temp );
|
return strdupW( temp );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1119,10 +1097,6 @@ static UINT MSI_GetProductInfo(LPCWSTR szProduct, LPCWSTR szAttribute,
|
||||||
awstring *szValue, LPDWORD pcchValueBuf)
|
awstring *szValue, LPDWORD pcchValueBuf)
|
||||||
{
|
{
|
||||||
static WCHAR empty[] = {0};
|
static WCHAR empty[] = {0};
|
||||||
static const WCHAR sourcelist[] = {'S','o','u','r','c','e','L','i','s','t',0};
|
|
||||||
static const WCHAR display_name[] = {'D','i','s','p','l','a','y','N','a','m','e',0};
|
|
||||||
static const WCHAR display_version[] = {'D','i','s','p','l','a','y','V','e','r','s','i','o','n',0};
|
|
||||||
static const WCHAR assignment[] = {'A','s','s','i','g','n','m','e','n','t',0};
|
|
||||||
MSIINSTALLCONTEXT context = MSIINSTALLCONTEXT_USERUNMANAGED;
|
MSIINSTALLCONTEXT context = MSIINSTALLCONTEXT_USERUNMANAGED;
|
||||||
UINT r = ERROR_UNKNOWN_PROPERTY;
|
UINT r = ERROR_UNKNOWN_PROPERTY;
|
||||||
HKEY prodkey, userdata, source;
|
HKEY prodkey, userdata, source;
|
||||||
|
@ -1182,9 +1156,9 @@ static UINT MSI_GetProductInfo(LPCWSTR szProduct, LPCWSTR szAttribute,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!wcscmp( szAttribute, INSTALLPROPERTY_INSTALLEDPRODUCTNAMEW ))
|
if (!wcscmp( szAttribute, INSTALLPROPERTY_INSTALLEDPRODUCTNAMEW ))
|
||||||
szAttribute = display_name;
|
szAttribute = L"DisplayName";
|
||||||
else if (!wcscmp( szAttribute, INSTALLPROPERTY_VERSIONSTRINGW ))
|
else if (!wcscmp( szAttribute, INSTALLPROPERTY_VERSIONSTRINGW ))
|
||||||
szAttribute = display_version;
|
szAttribute = L"DisplayVersion";
|
||||||
|
|
||||||
val = reg_get_value(userdata, szAttribute, &type);
|
val = reg_get_value(userdata, szAttribute, &type);
|
||||||
if (!val)
|
if (!val)
|
||||||
|
@ -1209,11 +1183,11 @@ static UINT MSI_GetProductInfo(LPCWSTR szProduct, LPCWSTR szAttribute,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!wcscmp( szAttribute, INSTALLPROPERTY_ASSIGNMENTTYPEW ))
|
if (!wcscmp( szAttribute, INSTALLPROPERTY_ASSIGNMENTTYPEW ))
|
||||||
szAttribute = assignment;
|
szAttribute = L"Assignment";
|
||||||
|
|
||||||
if (!wcscmp( szAttribute, INSTALLPROPERTY_PACKAGENAMEW ))
|
if (!wcscmp( szAttribute, INSTALLPROPERTY_PACKAGENAMEW ))
|
||||||
{
|
{
|
||||||
res = RegOpenKeyW(prodkey, sourcelist, &source);
|
res = RegOpenKeyW(prodkey, L"SourceList", &source);
|
||||||
if (res != ERROR_SUCCESS)
|
if (res != ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
r = ERROR_UNKNOWN_PRODUCT;
|
r = ERROR_UNKNOWN_PRODUCT;
|
||||||
|
@ -1426,14 +1400,6 @@ UINT WINAPI MsiGetProductInfoExW(LPCWSTR szProductCode, LPCWSTR szUserSid,
|
||||||
MSIINSTALLCONTEXT dwContext, LPCWSTR szProperty,
|
MSIINSTALLCONTEXT dwContext, LPCWSTR szProperty,
|
||||||
LPWSTR szValue, LPDWORD pcchValue)
|
LPWSTR szValue, LPDWORD pcchValue)
|
||||||
{
|
{
|
||||||
static const WCHAR five[] = {'5',0};
|
|
||||||
static const WCHAR displayname[] = {
|
|
||||||
'D','i','s','p','l','a','y','N','a','m','e',0};
|
|
||||||
static const WCHAR displayversion[] = {
|
|
||||||
'D','i','s','p','l','a','y','V','e','r','s','i','o','n',0};
|
|
||||||
static const WCHAR managed_local_package[] = {
|
|
||||||
'M','a','n','a','g','e','d','L','o','c','a','l',
|
|
||||||
'P','a','c','k','a','g','e',0};
|
|
||||||
WCHAR *val = NULL, squashed_pc[SQUASHED_GUID_SIZE];
|
WCHAR *val = NULL, squashed_pc[SQUASHED_GUID_SIZE];
|
||||||
LPCWSTR package = NULL;
|
LPCWSTR package = NULL;
|
||||||
HKEY props = NULL, prod, classes = NULL, managed, hkey = NULL;
|
HKEY props = NULL, prod, classes = NULL, managed, hkey = NULL;
|
||||||
|
@ -1478,7 +1444,7 @@ UINT WINAPI MsiGetProductInfoExW(LPCWSTR szProductCode, LPCWSTR szUserSid,
|
||||||
}
|
}
|
||||||
else if (dwContext == MSIINSTALLCONTEXT_USERMANAGED)
|
else if (dwContext == MSIINSTALLCONTEXT_USERMANAGED)
|
||||||
{
|
{
|
||||||
package = managed_local_package;
|
package = L"ManagedLocalPackage";
|
||||||
|
|
||||||
if (!props && !managed)
|
if (!props && !managed)
|
||||||
goto done;
|
goto done;
|
||||||
|
@ -1522,13 +1488,13 @@ UINT WINAPI MsiGetProductInfoExW(LPCWSTR szProductCode, LPCWSTR szUserSid,
|
||||||
msi_free(val);
|
msi_free(val);
|
||||||
|
|
||||||
if (!wcscmp( szProperty, INSTALLPROPERTY_INSTALLEDPRODUCTNAMEW ))
|
if (!wcscmp( szProperty, INSTALLPROPERTY_INSTALLEDPRODUCTNAMEW ))
|
||||||
szProperty = displayname;
|
szProperty = L"DisplayName";
|
||||||
else if (!wcscmp( szProperty, INSTALLPROPERTY_VERSIONSTRINGW ))
|
else if (!wcscmp( szProperty, INSTALLPROPERTY_VERSIONSTRINGW ))
|
||||||
szProperty = displayversion;
|
szProperty = L"DisplayVersion";
|
||||||
|
|
||||||
val = reg_get_value(props, szProperty, &type);
|
val = reg_get_value(props, szProperty, &type);
|
||||||
if (!val)
|
if (!val)
|
||||||
val = strdupW(szEmpty);
|
val = strdupW(L"");
|
||||||
|
|
||||||
r = msi_copy_outval(val, szValue, pcchValue);
|
r = msi_copy_outval(val, szValue, pcchValue);
|
||||||
}
|
}
|
||||||
|
@ -1553,7 +1519,7 @@ UINT WINAPI MsiGetProductInfoExW(LPCWSTR szProductCode, LPCWSTR szUserSid,
|
||||||
|
|
||||||
val = reg_get_value(hkey, szProperty, &type);
|
val = reg_get_value(hkey, szProperty, &type);
|
||||||
if (!val)
|
if (!val)
|
||||||
val = strdupW(szEmpty);
|
val = strdupW(L"");
|
||||||
|
|
||||||
r = msi_copy_outval(val, szValue, pcchValue);
|
r = msi_copy_outval(val, szValue, pcchValue);
|
||||||
}
|
}
|
||||||
|
@ -1568,10 +1534,10 @@ UINT WINAPI MsiGetProductInfoExW(LPCWSTR szProductCode, LPCWSTR szUserSid,
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
msi_free(val);
|
msi_free(val);
|
||||||
val = strdupW(five);
|
val = strdupW(L"5");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
val = strdupW(szOne);
|
val = strdupW(L"1");
|
||||||
|
|
||||||
r = msi_copy_outval(val, szValue, pcchValue);
|
r = msi_copy_outval(val, szValue, pcchValue);
|
||||||
goto done;
|
goto done;
|
||||||
|
@ -1579,13 +1545,13 @@ UINT WINAPI MsiGetProductInfoExW(LPCWSTR szProductCode, LPCWSTR szUserSid,
|
||||||
else if (props && (val = reg_get_value(props, package, &type)))
|
else if (props && (val = reg_get_value(props, package, &type)))
|
||||||
{
|
{
|
||||||
msi_free(val);
|
msi_free(val);
|
||||||
val = strdupW(five);
|
val = strdupW(L"5");
|
||||||
r = msi_copy_outval(val, szValue, pcchValue);
|
r = msi_copy_outval(val, szValue, pcchValue);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (prod || managed)
|
if (prod || managed)
|
||||||
val = strdupW(szOne);
|
val = strdupW(L"1");
|
||||||
else
|
else
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
|
@ -1597,7 +1563,7 @@ UINT WINAPI MsiGetProductInfoExW(LPCWSTR szProductCode, LPCWSTR szUserSid,
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
/* FIXME */
|
/* FIXME */
|
||||||
val = strdupW(szEmpty);
|
val = strdupW(L"");
|
||||||
r = msi_copy_outval(val, szValue, pcchValue);
|
r = msi_copy_outval(val, szValue, pcchValue);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1700,8 +1666,6 @@ UINT WINAPI MsiGetPatchInfoExW(LPCWSTR szPatchCode, LPCWSTR szProductCode,
|
||||||
LPCWSTR szUserSid, MSIINSTALLCONTEXT dwContext,
|
LPCWSTR szUserSid, MSIINSTALLCONTEXT dwContext,
|
||||||
LPCWSTR szProperty, LPWSTR lpValue, DWORD *pcchValue)
|
LPCWSTR szProperty, LPWSTR lpValue, DWORD *pcchValue)
|
||||||
{
|
{
|
||||||
static const WCHAR szManagedPackage[] =
|
|
||||||
{'M','a','n','a','g','e','d','L','o','c','a','l','P','a','c','k','a','g','e',0};
|
|
||||||
WCHAR *val = NULL, squashed_pc[SQUASHED_GUID_SIZE], squashed_patch[SQUASHED_GUID_SIZE];
|
WCHAR *val = NULL, squashed_pc[SQUASHED_GUID_SIZE], squashed_patch[SQUASHED_GUID_SIZE];
|
||||||
HKEY udprod = 0, prod = 0, props = 0;
|
HKEY udprod = 0, prod = 0, props = 0;
|
||||||
HKEY patch = 0, patches = 0;
|
HKEY patch = 0, patches = 0;
|
||||||
|
@ -1735,7 +1699,7 @@ UINT WINAPI MsiGetPatchInfoExW(LPCWSTR szPatchCode, LPCWSTR szProductCode,
|
||||||
if (dwContext == MSIINSTALLCONTEXT_MACHINE && szUserSid)
|
if (dwContext == MSIINSTALLCONTEXT_MACHINE && szUserSid)
|
||||||
return ERROR_INVALID_PARAMETER;
|
return ERROR_INVALID_PARAMETER;
|
||||||
|
|
||||||
if (szUserSid && !wcscmp( szUserSid, szLocalSid ))
|
if (szUserSid && !wcscmp( szUserSid, L"S-1-5-18" ))
|
||||||
return ERROR_INVALID_PARAMETER;
|
return ERROR_INVALID_PARAMETER;
|
||||||
|
|
||||||
if (MSIREG_OpenUserDataProductKey(szProductCode, dwContext, NULL,
|
if (MSIREG_OpenUserDataProductKey(szProductCode, dwContext, NULL,
|
||||||
|
@ -1748,7 +1712,7 @@ UINT WINAPI MsiGetPatchInfoExW(LPCWSTR szPatchCode, LPCWSTR szProductCode,
|
||||||
|
|
||||||
r = ERROR_UNKNOWN_PATCH;
|
r = ERROR_UNKNOWN_PATCH;
|
||||||
|
|
||||||
res = RegOpenKeyExW(udprod, szPatches, 0, KEY_READ, &patches);
|
res = RegOpenKeyExW(udprod, L"Patches", 0, KEY_READ, &patches);
|
||||||
if (res != ERROR_SUCCESS)
|
if (res != ERROR_SUCCESS)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
|
@ -1762,7 +1726,7 @@ UINT WINAPI MsiGetPatchInfoExW(LPCWSTR szPatchCode, LPCWSTR szProductCode,
|
||||||
&prod, FALSE) != ERROR_SUCCESS)
|
&prod, FALSE) != ERROR_SUCCESS)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
res = RegOpenKeyExW(prod, szPatches, 0, KEY_ALL_ACCESS, &prodpatches);
|
res = RegOpenKeyExW(prod, L"Patches", 0, KEY_ALL_ACCESS, &prodpatches);
|
||||||
if (res != ERROR_SUCCESS)
|
if (res != ERROR_SUCCESS)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
|
@ -1778,13 +1742,13 @@ UINT WINAPI MsiGetPatchInfoExW(LPCWSTR szPatchCode, LPCWSTR szProductCode,
|
||||||
if (!wcscmp( szProperty, INSTALLPROPERTY_LOCALPACKAGEW ))
|
if (!wcscmp( szProperty, INSTALLPROPERTY_LOCALPACKAGEW ))
|
||||||
{
|
{
|
||||||
if (dwContext == MSIINSTALLCONTEXT_USERMANAGED)
|
if (dwContext == MSIINSTALLCONTEXT_USERMANAGED)
|
||||||
szProperty = szManagedPackage;
|
szProperty = L"ManagedLocalPackage";
|
||||||
datakey = udpatch;
|
datakey = udpatch;
|
||||||
}
|
}
|
||||||
else if (!wcscmp( szProperty, INSTALLPROPERTY_INSTALLDATEW ))
|
else if (!wcscmp( szProperty, INSTALLPROPERTY_INSTALLDATEW ))
|
||||||
{
|
{
|
||||||
datakey = patch;
|
datakey = patch;
|
||||||
szProperty = szInstalled;
|
szProperty = L"Installed";
|
||||||
}
|
}
|
||||||
else if (!wcscmp( szProperty, INSTALLPROPERTY_UNINSTALLABLEW ) ||
|
else if (!wcscmp( szProperty, INSTALLPROPERTY_UNINSTALLABLEW ) ||
|
||||||
!wcscmp( szProperty, INSTALLPROPERTY_PATCHSTATEW ) ||
|
!wcscmp( szProperty, INSTALLPROPERTY_PATCHSTATEW ) ||
|
||||||
|
@ -1802,7 +1766,7 @@ UINT WINAPI MsiGetPatchInfoExW(LPCWSTR szPatchCode, LPCWSTR szProductCode,
|
||||||
|
|
||||||
val = reg_get_value(datakey, szProperty, &type);
|
val = reg_get_value(datakey, szProperty, &type);
|
||||||
if (!val)
|
if (!val)
|
||||||
val = strdupW(szEmpty);
|
val = strdupW(L"");
|
||||||
|
|
||||||
r = ERROR_SUCCESS;
|
r = ERROR_SUCCESS;
|
||||||
|
|
||||||
|
@ -2048,7 +2012,7 @@ UINT WINAPI MsiEnumComponentCostsW( MSIHANDLE handle, LPCWSTR component, DWORD i
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!msi_get_property_int( package->db, szCostingComplete, 0 ))
|
if (!msi_get_property_int( package->db, L"CostingComplete", 0 ))
|
||||||
{
|
{
|
||||||
msiobj_release( &package->hdr );
|
msiobj_release( &package->hdr );
|
||||||
return ERROR_FUNCTION_NOT_CALLED;
|
return ERROR_FUNCTION_NOT_CALLED;
|
||||||
|
@ -2145,19 +2109,14 @@ static BOOL msi_comp_find_package(LPCWSTR prodcode, MSIINSTALLCONTEXT context)
|
||||||
LONG res;
|
LONG res;
|
||||||
UINT r;
|
UINT r;
|
||||||
|
|
||||||
static const WCHAR local_package[] = {'L','o','c','a','l','P','a','c','k','a','g','e',0};
|
|
||||||
static const WCHAR managed_local_package[] = {
|
|
||||||
'M','a','n','a','g','e','d','L','o','c','a','l','P','a','c','k','a','g','e',0
|
|
||||||
};
|
|
||||||
|
|
||||||
r = MSIREG_OpenInstallProps(prodcode, context, NULL, &hkey, FALSE);
|
r = MSIREG_OpenInstallProps(prodcode, context, NULL, &hkey, FALSE);
|
||||||
if (r != ERROR_SUCCESS)
|
if (r != ERROR_SUCCESS)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (context == MSIINSTALLCONTEXT_USERMANAGED)
|
if (context == MSIINSTALLCONTEXT_USERMANAGED)
|
||||||
package = managed_local_package;
|
package = L"ManagedLocalPackage";
|
||||||
else
|
else
|
||||||
package = local_package;
|
package = L"LocalPackage";
|
||||||
|
|
||||||
sz = 0;
|
sz = 0;
|
||||||
res = RegQueryValueExW(hkey, package, NULL, NULL, NULL, &sz);
|
res = RegQueryValueExW(hkey, package, NULL, NULL, NULL, &sz);
|
||||||
|
@ -2175,7 +2134,7 @@ static UINT msi_comp_find_prodcode(WCHAR *squashed_pc,
|
||||||
UINT r;
|
UINT r;
|
||||||
|
|
||||||
if (context == MSIINSTALLCONTEXT_MACHINE)
|
if (context == MSIINSTALLCONTEXT_MACHINE)
|
||||||
r = MSIREG_OpenUserDataComponentKey(comp, szLocalSid, &hkey, FALSE);
|
r = MSIREG_OpenUserDataComponentKey(comp, L"S-1-5-18", &hkey, FALSE);
|
||||||
else
|
else
|
||||||
r = MSIREG_OpenUserDataComponentKey(comp, NULL, &hkey, FALSE);
|
r = MSIREG_OpenUserDataComponentKey(comp, NULL, &hkey, FALSE);
|
||||||
|
|
||||||
|
@ -2308,7 +2267,7 @@ INSTALLSTATE WINAPI MsiQueryProductStateW(LPCWSTR szProduct)
|
||||||
if (r != ERROR_SUCCESS)
|
if (r != ERROR_SUCCESS)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
if (!msi_reg_get_val_dword(userdata, szWindowsInstaller, &val))
|
if (!msi_reg_get_val_dword(userdata, L"WindowsInstaller", &val))
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
if (val)
|
if (val)
|
||||||
|
@ -2724,11 +2683,6 @@ UINT WINAPI MsiGetProductPropertyW(MSIHANDLE hProduct, LPCWSTR szProperty,
|
||||||
LPCWSTR val;
|
LPCWSTR val;
|
||||||
UINT r;
|
UINT r;
|
||||||
|
|
||||||
static const WCHAR query[] = {
|
|
||||||
'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
|
|
||||||
'`','P','r','o','p','e','r','t','y','`',' ','W','H','E','R','E',' ',
|
|
||||||
'`','P','r','o','p','e','r','t','y','`','=','\'','%','s','\'',0};
|
|
||||||
|
|
||||||
TRACE("(%d, %s, %p, %p)\n", hProduct, debugstr_w(szProperty),
|
TRACE("(%d, %s, %p, %p)\n", hProduct, debugstr_w(szProperty),
|
||||||
szValue, pccbValue);
|
szValue, pccbValue);
|
||||||
|
|
||||||
|
@ -2742,7 +2696,7 @@ UINT WINAPI MsiGetProductPropertyW(MSIHANDLE hProduct, LPCWSTR szProperty,
|
||||||
if (!package)
|
if (!package)
|
||||||
return ERROR_INVALID_HANDLE;
|
return ERROR_INVALID_HANDLE;
|
||||||
|
|
||||||
r = MSI_OpenQuery(package->db, &view, query, szProperty);
|
r = MSI_OpenQuery(package->db, &view, L"SELECT * FROM `Property` WHERE `Property` = '%s'", szProperty);
|
||||||
if (r != ERROR_SUCCESS)
|
if (r != ERROR_SUCCESS)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
|
@ -2829,11 +2783,11 @@ static BOOL open_userdata_comp_key( const WCHAR *comp, const WCHAR *usersid, MSI
|
||||||
{
|
{
|
||||||
if (ctx & MSIINSTALLCONTEXT_MACHINE)
|
if (ctx & MSIINSTALLCONTEXT_MACHINE)
|
||||||
{
|
{
|
||||||
if (!MSIREG_OpenUserDataComponentKey( comp, szLocalSid, hkey, FALSE )) return TRUE;
|
if (!MSIREG_OpenUserDataComponentKey( comp, L"S-1-5-18", hkey, FALSE )) return TRUE;
|
||||||
}
|
}
|
||||||
if (ctx & (MSIINSTALLCONTEXT_USERMANAGED|MSIINSTALLCONTEXT_USERUNMANAGED))
|
if (ctx & (MSIINSTALLCONTEXT_USERMANAGED|MSIINSTALLCONTEXT_USERUNMANAGED))
|
||||||
{
|
{
|
||||||
if (usersid && !wcsicmp( usersid, szAllSid ))
|
if (usersid && !wcsicmp( usersid, L"S-1-1-0" ))
|
||||||
{
|
{
|
||||||
FIXME( "only looking at the current user\n" );
|
FIXME( "only looking at the current user\n" );
|
||||||
usersid = NULL;
|
usersid = NULL;
|
||||||
|
@ -2847,8 +2801,6 @@ static INSTALLSTATE MSI_GetComponentPath( const WCHAR *szProduct, const WCHAR *s
|
||||||
const WCHAR *szUserSid, MSIINSTALLCONTEXT ctx,
|
const WCHAR *szUserSid, MSIINSTALLCONTEXT ctx,
|
||||||
awstring *lpPathBuf, DWORD *pcchBuf )
|
awstring *lpPathBuf, DWORD *pcchBuf )
|
||||||
{
|
{
|
||||||
static const WCHAR wininstaller[] =
|
|
||||||
{'W','i','n','d','o','w','s','I','n','s','t','a','l','l','e','r',0};
|
|
||||||
WCHAR *path = NULL, squashed_pc[SQUASHED_GUID_SIZE], squashed_comp[SQUASHED_GUID_SIZE];
|
WCHAR *path = NULL, squashed_pc[SQUASHED_GUID_SIZE], squashed_comp[SQUASHED_GUID_SIZE];
|
||||||
HKEY hkey;
|
HKEY hkey;
|
||||||
INSTALLSTATE state;
|
INSTALLSTATE state;
|
||||||
|
@ -2877,7 +2829,7 @@ static INSTALLSTATE MSI_GetComponentPath( const WCHAR *szProduct, const WCHAR *s
|
||||||
|
|
||||||
if ((!MSIREG_OpenInstallProps(szProduct, MSIINSTALLCONTEXT_MACHINE, NULL, &hkey, FALSE) ||
|
if ((!MSIREG_OpenInstallProps(szProduct, MSIINSTALLCONTEXT_MACHINE, NULL, &hkey, FALSE) ||
|
||||||
!MSIREG_OpenUserDataProductKey(szProduct, MSIINSTALLCONTEXT_USERUNMANAGED, NULL, &hkey, FALSE)) &&
|
!MSIREG_OpenUserDataProductKey(szProduct, MSIINSTALLCONTEXT_USERUNMANAGED, NULL, &hkey, FALSE)) &&
|
||||||
msi_reg_get_val_dword(hkey, wininstaller, &version) &&
|
msi_reg_get_val_dword(hkey, L"WindowsInstaller", &version) &&
|
||||||
GetFileAttributesW(path) != INVALID_FILE_ATTRIBUTES)
|
GetFileAttributesW(path) != INVALID_FILE_ATTRIBUTES)
|
||||||
{
|
{
|
||||||
RegCloseKey(hkey);
|
RegCloseKey(hkey);
|
||||||
|
@ -2966,7 +2918,7 @@ end:
|
||||||
*/
|
*/
|
||||||
INSTALLSTATE WINAPI MsiGetComponentPathW( LPCWSTR product, LPCWSTR comp, LPWSTR buf, LPDWORD buflen )
|
INSTALLSTATE WINAPI MsiGetComponentPathW( LPCWSTR product, LPCWSTR comp, LPWSTR buf, LPDWORD buflen )
|
||||||
{
|
{
|
||||||
return MsiGetComponentPathExW( product, comp, szAllSid, MSIINSTALLCONTEXT_ALL, buf, buflen );
|
return MsiGetComponentPathExW( product, comp, L"S-1-1-0", MSIINSTALLCONTEXT_ALL, buf, buflen );
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
|
@ -3028,7 +2980,7 @@ static UINT query_feature_state( const WCHAR *product, const WCHAR *squashed, co
|
||||||
}
|
}
|
||||||
StringFromGUID2( &guid, comp, GUID_SIZE );
|
StringFromGUID2( &guid, comp, GUID_SIZE );
|
||||||
if (ctx == MSIINSTALLCONTEXT_MACHINE)
|
if (ctx == MSIINSTALLCONTEXT_MACHINE)
|
||||||
r = MSIREG_OpenUserDataComponentKey( comp, szLocalSid, &hkey, FALSE );
|
r = MSIREG_OpenUserDataComponentKey( comp, L"S-1-5-18", &hkey, FALSE );
|
||||||
else
|
else
|
||||||
r = MSIREG_OpenUserDataComponentKey( comp, usersid, &hkey, FALSE );
|
r = MSIREG_OpenUserDataComponentKey( comp, usersid, &hkey, FALSE );
|
||||||
|
|
||||||
|
@ -3214,9 +3166,6 @@ end:
|
||||||
static UINT get_file_version( const WCHAR *path, WCHAR *verbuf, DWORD *verlen,
|
static UINT get_file_version( const WCHAR *path, WCHAR *verbuf, DWORD *verlen,
|
||||||
WCHAR *langbuf, DWORD *langlen )
|
WCHAR *langbuf, DWORD *langlen )
|
||||||
{
|
{
|
||||||
static const WCHAR szVersionResource[] = {'\\',0};
|
|
||||||
static const WCHAR szVersionFormat[] = {'%','d','.','%','d','.','%','d','.','%','d',0};
|
|
||||||
static const WCHAR szLangFormat[] = {'%','d',0};
|
|
||||||
UINT ret = ERROR_MORE_DATA;
|
UINT ret = ERROR_MORE_DATA;
|
||||||
DWORD len, error;
|
DWORD len, error;
|
||||||
LPVOID version;
|
LPVOID version;
|
||||||
|
@ -3244,9 +3193,9 @@ static UINT get_file_version( const WCHAR *path, WCHAR *verbuf, DWORD *verlen,
|
||||||
}
|
}
|
||||||
if (verlen)
|
if (verlen)
|
||||||
{
|
{
|
||||||
if (VerQueryValueW( version, szVersionResource, (LPVOID *)&ffi, &len ) && len > 0)
|
if (VerQueryValueW( version, L"\\", (LPVOID *)&ffi, &len ) && len > 0)
|
||||||
{
|
{
|
||||||
swprintf( tmp, ARRAY_SIZE(tmp), szVersionFormat,
|
swprintf( tmp, ARRAY_SIZE(tmp), L"%d.%d.%d.%d",
|
||||||
HIWORD(ffi->dwFileVersionMS), LOWORD(ffi->dwFileVersionMS),
|
HIWORD(ffi->dwFileVersionMS), LOWORD(ffi->dwFileVersionMS),
|
||||||
HIWORD(ffi->dwFileVersionLS), LOWORD(ffi->dwFileVersionLS) );
|
HIWORD(ffi->dwFileVersionLS), LOWORD(ffi->dwFileVersionLS) );
|
||||||
if (verbuf) lstrcpynW( verbuf, tmp, *verlen );
|
if (verbuf) lstrcpynW( verbuf, tmp, *verlen );
|
||||||
|
@ -3262,9 +3211,9 @@ static UINT get_file_version( const WCHAR *path, WCHAR *verbuf, DWORD *verlen,
|
||||||
}
|
}
|
||||||
if (langlen)
|
if (langlen)
|
||||||
{
|
{
|
||||||
if (VerQueryValueW( version, szLangResource, (LPVOID *)&lang, &len ) && len > 0)
|
if (VerQueryValueW( version, L"\\VarFileInfo\\Translation", (LPVOID *)&lang, &len ) && len > 0)
|
||||||
{
|
{
|
||||||
swprintf( tmp, ARRAY_SIZE(tmp), szLangFormat, *lang );
|
swprintf( tmp, ARRAY_SIZE(tmp), L"%d", *lang );
|
||||||
if (langbuf) lstrcpynW( langbuf, tmp, *langlen );
|
if (langbuf) lstrcpynW( langbuf, tmp, *langlen );
|
||||||
len = lstrlenW( tmp );
|
len = lstrlenW( tmp );
|
||||||
if (*langlen > len) ret = ERROR_SUCCESS;
|
if (*langlen > len) ret = ERROR_SUCCESS;
|
||||||
|
@ -3496,7 +3445,7 @@ static UINT MSI_ProvideQualifiedComponentEx(LPCWSTR szComponent,
|
||||||
StringFromGUID2( &guid, comp, ARRAY_SIZE( comp ));
|
StringFromGUID2( &guid, comp, ARRAY_SIZE( comp ));
|
||||||
}
|
}
|
||||||
|
|
||||||
state = MSI_GetComponentPath( szProduct, comp, szAllSid, MSIINSTALLCONTEXT_ALL, lpPathBuf, pcchPathBuf );
|
state = MSI_GetComponentPath( szProduct, comp, L"S-1-1-0", MSIINSTALLCONTEXT_ALL, lpPathBuf, pcchPathBuf );
|
||||||
|
|
||||||
if (state == INSTALLSTATE_MOREDATA) return ERROR_MORE_DATA;
|
if (state == INSTALLSTATE_MOREDATA) return ERROR_MORE_DATA;
|
||||||
if (state != INSTALLSTATE_LOCAL) return ERROR_FILE_NOT_FOUND;
|
if (state != INSTALLSTATE_LOCAL) return ERROR_FILE_NOT_FOUND;
|
||||||
|
@ -3658,7 +3607,7 @@ static USERINFOSTATE MSI_GetUserInfo(LPCWSTR szProduct,
|
||||||
if (pcchOrgNameBuf)
|
if (pcchOrgNameBuf)
|
||||||
{
|
{
|
||||||
orgptr = org;
|
orgptr = org;
|
||||||
if (!orgptr) orgptr = szEmpty;
|
if (!orgptr) orgptr = L"";
|
||||||
|
|
||||||
r = msi_strcpy_to_awstring(orgptr, -1, lpOrgNameBuf, pcchOrgNameBuf);
|
r = msi_strcpy_to_awstring(orgptr, -1, lpOrgNameBuf, pcchOrgNameBuf);
|
||||||
if (r == ERROR_MORE_DATA)
|
if (r == ERROR_MORE_DATA)
|
||||||
|
@ -3755,7 +3704,6 @@ UINT WINAPI MsiCollectUserInfoW(LPCWSTR szProduct)
|
||||||
MSIHANDLE handle;
|
MSIHANDLE handle;
|
||||||
UINT rc;
|
UINT rc;
|
||||||
MSIPACKAGE *package;
|
MSIPACKAGE *package;
|
||||||
static const WCHAR szFirstRun[] = {'F','i','r','s','t','R','u','n',0};
|
|
||||||
|
|
||||||
TRACE("(%s)\n",debugstr_w(szProduct));
|
TRACE("(%s)\n",debugstr_w(szProduct));
|
||||||
|
|
||||||
|
@ -3768,7 +3716,7 @@ UINT WINAPI MsiCollectUserInfoW(LPCWSTR szProduct)
|
||||||
if (!package)
|
if (!package)
|
||||||
return ERROR_CALL_NOT_IMPLEMENTED;
|
return ERROR_CALL_NOT_IMPLEMENTED;
|
||||||
|
|
||||||
rc = ACTION_PerformAction(package, szFirstRun);
|
rc = ACTION_PerformAction(package, L"FirstRun");
|
||||||
msiobj_release( &package->hdr );
|
msiobj_release( &package->hdr );
|
||||||
|
|
||||||
MsiCloseHandle(handle);
|
MsiCloseHandle(handle);
|
||||||
|
@ -3781,7 +3729,6 @@ UINT WINAPI MsiCollectUserInfoA(LPCSTR szProduct)
|
||||||
MSIHANDLE handle;
|
MSIHANDLE handle;
|
||||||
UINT rc;
|
UINT rc;
|
||||||
MSIPACKAGE *package;
|
MSIPACKAGE *package;
|
||||||
static const WCHAR szFirstRun[] = {'F','i','r','s','t','R','u','n',0};
|
|
||||||
|
|
||||||
TRACE("(%s)\n",debugstr_a(szProduct));
|
TRACE("(%s)\n",debugstr_a(szProduct));
|
||||||
|
|
||||||
|
@ -3794,7 +3741,7 @@ UINT WINAPI MsiCollectUserInfoA(LPCSTR szProduct)
|
||||||
if (!package)
|
if (!package)
|
||||||
return ERROR_CALL_NOT_IMPLEMENTED;
|
return ERROR_CALL_NOT_IMPLEMENTED;
|
||||||
|
|
||||||
rc = ACTION_PerformAction(package, szFirstRun);
|
rc = ACTION_PerformAction(package, L"FirstRun");
|
||||||
msiobj_release( &package->hdr );
|
msiobj_release( &package->hdr );
|
||||||
|
|
||||||
MsiCloseHandle(handle);
|
MsiCloseHandle(handle);
|
||||||
|
@ -3875,7 +3822,7 @@ UINT WINAPI MsiConfigureFeatureW(LPCWSTR szProduct, LPCWSTR szFeature, INSTALLST
|
||||||
|
|
||||||
MsiSetInternalUI( INSTALLUILEVEL_BASIC, NULL );
|
MsiSetInternalUI( INSTALLUILEVEL_BASIC, NULL );
|
||||||
|
|
||||||
r = ACTION_PerformAction(package, szCostInitialize);
|
r = ACTION_PerformAction(package, L"CostInitialize");
|
||||||
if (r != ERROR_SUCCESS)
|
if (r != ERROR_SUCCESS)
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
|
@ -3911,7 +3858,7 @@ UINT WINAPI MsiCreateAndVerifyInstallerDirectory(DWORD dwReserved)
|
||||||
if (!GetWindowsDirectoryW(path, MAX_PATH))
|
if (!GetWindowsDirectoryW(path, MAX_PATH))
|
||||||
return ERROR_FUNCTION_FAILED;
|
return ERROR_FUNCTION_FAILED;
|
||||||
|
|
||||||
lstrcatW(path, installerW);
|
lstrcatW(path, L"\\Installer");
|
||||||
|
|
||||||
if (!CreateDirectoryW(path, NULL) && GetLastError() != ERROR_ALREADY_EXISTS)
|
if (!CreateDirectoryW(path, NULL) && GetLastError() != ERROR_ALREADY_EXISTS)
|
||||||
return ERROR_FUNCTION_FAILED;
|
return ERROR_FUNCTION_FAILED;
|
||||||
|
@ -4006,7 +3953,6 @@ UINT WINAPI MsiGetShortcutTargetW( LPCWSTR szShortcutTarget,
|
||||||
|
|
||||||
UINT WINAPI MsiReinstallFeatureW( LPCWSTR szProduct, LPCWSTR szFeature, DWORD dwReinstallMode )
|
UINT WINAPI MsiReinstallFeatureW( LPCWSTR szProduct, LPCWSTR szFeature, DWORD dwReinstallMode )
|
||||||
{
|
{
|
||||||
static const WCHAR fmtW[] = {'%','s','=','%','s',' ','%','s','=','%','s',0};
|
|
||||||
MSIPACKAGE *package;
|
MSIPACKAGE *package;
|
||||||
MSIINSTALLCONTEXT context;
|
MSIINSTALLCONTEXT context;
|
||||||
UINT r;
|
UINT r;
|
||||||
|
@ -4060,14 +4006,14 @@ UINT WINAPI MsiReinstallFeatureW( LPCWSTR szProduct, LPCWSTR szFeature, DWORD dw
|
||||||
if (r != ERROR_SUCCESS)
|
if (r != ERROR_SUCCESS)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
sz = (lstrlenW( fmtW ) + lstrlenW( szReinstallMode ) + lstrlenW( reinstallmode )) * sizeof(WCHAR);
|
sz = (lstrlenW( L"%s=%s %s=%s" ) + lstrlenW( L"REINSTALLMODE" ) + lstrlenW( reinstallmode )) * sizeof(WCHAR);
|
||||||
sz += (lstrlenW( szReinstall ) + lstrlenW( szFeature )) * sizeof(WCHAR);
|
sz += (lstrlenW( L"REINSTALL" ) + lstrlenW( szFeature )) * sizeof(WCHAR);
|
||||||
if (!(cmdline = msi_alloc( sz )))
|
if (!(cmdline = msi_alloc( sz )))
|
||||||
{
|
{
|
||||||
msiobj_release( &package->hdr );
|
msiobj_release( &package->hdr );
|
||||||
return ERROR_OUTOFMEMORY;
|
return ERROR_OUTOFMEMORY;
|
||||||
}
|
}
|
||||||
swprintf( cmdline, sz / sizeof(WCHAR), fmtW, szReinstallMode, reinstallmode, szReinstall, szFeature );
|
swprintf( cmdline, sz / sizeof(WCHAR), L"%s=%s %s=%s", L"REINSTALLMODE", reinstallmode, L"REINSTALL", szFeature );
|
||||||
|
|
||||||
r = MSI_InstallPackage( package, sourcepath, cmdline );
|
r = MSI_InstallPackage( package, sourcepath, cmdline );
|
||||||
msiobj_release( &package->hdr );
|
msiobj_release( &package->hdr );
|
||||||
|
|
Loading…
Reference in New Issue