Use the strings defined in msi.h.
This commit is contained in:
parent
de7a621b06
commit
c6d24d235a
|
@ -3007,22 +3007,12 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package)
|
|||
/* for registry stuff */
|
||||
HKEY hkey=0;
|
||||
HKEY hukey=0;
|
||||
static const WCHAR szProductName[] =
|
||||
{'P','r','o','d','u','c','t','N','a','m','e',0};
|
||||
static const WCHAR szPackageCode[] =
|
||||
{'P','a','c','k','a','g','e','C','o','d','e',0};
|
||||
static const WCHAR szLanguage[] =
|
||||
{'L','a','n','g','u','a','g','e',0};
|
||||
static const WCHAR szProductLanguage[] =
|
||||
{'P','r','o','d','u','c','t','L','a','n','g','u','a','g','e',0};
|
||||
static const WCHAR szProductIcon[] =
|
||||
{'P','r','o','d','u','c','t','I','c','o','n',0};
|
||||
static const WCHAR szARPProductIcon[] =
|
||||
{'A','R','P','P','R','O','D','U','C','T','I','C','O','N',0};
|
||||
static const WCHAR szProductVersion[] =
|
||||
{'P','r','o','d','u','c','t','V','e','r','s','i','o','n',0};
|
||||
static const WCHAR szVersion[] =
|
||||
{'V','e','r','s','i','o','n',0};
|
||||
DWORD langid;
|
||||
LPWSTR buffer;
|
||||
DWORD size;
|
||||
|
@ -3051,15 +3041,17 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package)
|
|||
goto end;
|
||||
|
||||
|
||||
buffer = load_dynamic_property(package,szProductName,NULL);
|
||||
buffer = load_dynamic_property(package,INSTALLPROPERTY_PRODUCTNAMEstringW,NULL);
|
||||
size = strlenW(buffer)*sizeof(WCHAR);
|
||||
RegSetValueExW(hukey,szProductName,0,REG_SZ, (LPBYTE)buffer,size);
|
||||
RegSetValueExW(hukey,INSTALLPROPERTY_PRODUCTNAMEstringW,0,REG_SZ,
|
||||
(LPBYTE)buffer,size);
|
||||
HeapFree(GetProcessHeap(),0,buffer);
|
||||
|
||||
buffer = load_dynamic_property(package,szProductLanguage,NULL);
|
||||
size = sizeof(DWORD);
|
||||
langid = atoiW(buffer);
|
||||
RegSetValueExW(hukey,szLanguage,0,REG_DWORD, (LPBYTE)&langid,size);
|
||||
RegSetValueExW(hukey,INSTALLPROPERTY_LANGUAGEstringW,0,REG_DWORD,
|
||||
(LPBYTE)&langid,size);
|
||||
HeapFree(GetProcessHeap(),0,buffer);
|
||||
|
||||
buffer = load_dynamic_property(package,szARPProductIcon,NULL);
|
||||
|
@ -3068,7 +3060,8 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package)
|
|||
LPWSTR path;
|
||||
build_icon_path(package,buffer,&path);
|
||||
size = strlenW(path) * sizeof(WCHAR);
|
||||
RegSetValueExW(hukey,szProductIcon,0,REG_SZ, (LPBYTE)path,size);
|
||||
RegSetValueExW(hukey,INSTALLPROPERTY_PRODUCTICONstringW,0,REG_SZ,
|
||||
(LPBYTE)path,size);
|
||||
}
|
||||
HeapFree(GetProcessHeap(),0,buffer);
|
||||
|
||||
|
@ -3077,7 +3070,8 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package)
|
|||
{
|
||||
DWORD verdword = build_version_dword(buffer);
|
||||
size = sizeof(DWORD);
|
||||
RegSetValueExW(hukey,szVersion,0,REG_DWORD, (LPBYTE)&verdword,size);
|
||||
RegSetValueExW(hukey,INSTALLPROPERTY_VERSIONstringW,0,REG_DWORD, (LPBYTE
|
||||
)&verdword,size);
|
||||
}
|
||||
HeapFree(GetProcessHeap(),0,buffer);
|
||||
|
||||
|
@ -3100,8 +3094,8 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package)
|
|||
if (ptr) *ptr = 0;
|
||||
squash_guid(guidbuffer,squashed);
|
||||
size = strlenW(squashed)*sizeof(WCHAR);
|
||||
RegSetValueExW(hukey,szPackageCode,0,REG_SZ, (LPBYTE)squashed,
|
||||
size);
|
||||
RegSetValueExW(hukey,INSTALLPROPERTY_PACKAGECODEstringW,0,REG_SZ,
|
||||
(LPBYTE)squashed, size);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -3457,8 +3451,6 @@ static UINT ACTION_RegisterProduct(MSIPACKAGE *package)
|
|||
'%','s','\\',
|
||||
'I','n','s','t','a','l','l','e','r','\\',
|
||||
'%','x','.','m','s','i',0};
|
||||
static const WCHAR szLocalPackage[]=
|
||||
{'L','o','c','a','l','P','a','c','k','a','g','e',0};
|
||||
static const WCHAR szUpgradeCode[] =
|
||||
{'U','p','g','r','a','d','e','C','o','d','e',0};
|
||||
static const WCHAR modpath_fmt[] =
|
||||
|
@ -3469,20 +3461,10 @@ static UINT ACTION_RegisterProduct(MSIPACKAGE *package)
|
|||
{'U','n','i','n','s','t','a','l','l','S','t','r','i','n','g',0};
|
||||
static const WCHAR szEstimatedSize[] =
|
||||
{'E','s','t','i','m','a','t','e','d','S','i','z','e',0};
|
||||
static const WCHAR szInstallDate[] =
|
||||
{'I','n','s','t','a','l','l','D','a','t','e',0};
|
||||
static const WCHAR szLanguage[] =
|
||||
{'L','a','n','g','u','a','g','e',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 szVersion[] =
|
||||
{'V','e','r','s','i','o','n',0};
|
||||
static const WCHAR szVersionMajor[] =
|
||||
{'V','e','r','s','i','o','n','M','a','j','o','r',0};
|
||||
static const WCHAR szVersionMinor[] =
|
||||
{'V','e','r','s','i','o','n','M','i','n','o','r',0};
|
||||
|
||||
SYSTEMTIME systime;
|
||||
static const WCHAR date_fmt[] = {'%','i','%','i','%','i',0};
|
||||
|
@ -3548,7 +3530,8 @@ static UINT ACTION_RegisterProduct(MSIPACKAGE *package)
|
|||
debugstr_w(package->msiFilePath), debugstr_w(packagefile),
|
||||
GetLastError());
|
||||
size = strlenW(packagefile)*sizeof(WCHAR);
|
||||
RegSetValueExW(hkey,szLocalPackage,0,REG_SZ,(LPBYTE)packagefile,size);
|
||||
RegSetValueExW(hkey,INSTALLPROPERTY_LOCALPACKAGEstringW,0,REG_SZ,
|
||||
(LPBYTE)packagefile,size);
|
||||
|
||||
/* do ModifyPath and UninstallString */
|
||||
size = deformat_string(package,modpath_fmt,&buffer);
|
||||
|
@ -3565,12 +3548,14 @@ static UINT ACTION_RegisterProduct(MSIPACKAGE *package)
|
|||
buffer= HeapAlloc(GetProcessHeap(),0,size);
|
||||
sprintfW(buffer,date_fmt,systime.wYear,systime.wMonth,systime.wDay);
|
||||
size = strlenW(buffer)*sizeof(WCHAR);
|
||||
RegSetValueExW(hkey,szInstallDate,0,REG_SZ,(LPBYTE)buffer,size);
|
||||
RegSetValueExW(hkey,INSTALLPROPERTY_INSTALLDATEstringW,0,REG_SZ,
|
||||
(LPBYTE)buffer,size);
|
||||
HeapFree(GetProcessHeap(),0,buffer);
|
||||
|
||||
buffer = load_dynamic_property(package,szProductLanguage,NULL);
|
||||
size = atoiW(buffer);
|
||||
RegSetValueExW(hkey,szLanguage,0,REG_DWORD, (LPBYTE)&size,sizeof(DWORD));
|
||||
RegSetValueExW(hkey,INSTALLPROPERTY_LANGUAGEstringW,0,REG_DWORD,
|
||||
(LPBYTE)&size,sizeof(DWORD));
|
||||
HeapFree(GetProcessHeap(),1,buffer);
|
||||
|
||||
buffer = load_dynamic_property(package,szProductVersion,NULL);
|
||||
|
@ -3580,9 +3565,12 @@ static UINT ACTION_RegisterProduct(MSIPACKAGE *package)
|
|||
DWORD vermajor = verdword>>24;
|
||||
DWORD verminor = (verdword>>16)&0x00FF;
|
||||
size = sizeof(DWORD);
|
||||
RegSetValueExW(hkey,szVersion,0,REG_DWORD,(LPBYTE)&verdword,size);
|
||||
RegSetValueExW(hkey,szVersionMajor,0,REG_DWORD,(LPBYTE)&vermajor,size);
|
||||
RegSetValueExW(hkey,szVersionMinor,0,REG_DWORD,(LPBYTE)&verminor,size);
|
||||
RegSetValueExW(hkey,INSTALLPROPERTY_VERSIONstringW,0,REG_DWORD,
|
||||
(LPBYTE)&verdword,size);
|
||||
RegSetValueExW(hkey,INSTALLPROPERTY_VERSIONMAJORstringW,0,REG_DWORD,
|
||||
(LPBYTE)&vermajor,size);
|
||||
RegSetValueExW(hkey,INSTALLPROPERTY_VERSIONMINORstringW,0,REG_DWORD,
|
||||
(LPBYTE)&verminor,size);
|
||||
}
|
||||
HeapFree(GetProcessHeap(),0,buffer);
|
||||
|
||||
|
@ -3709,8 +3697,6 @@ UINT ACTION_ResolveSource(MSIPACKAGE* package)
|
|||
|
||||
static UINT ACTION_RegisterUser(MSIPACKAGE *package)
|
||||
{
|
||||
static const WCHAR szProductID[]=
|
||||
{'P','r','o','d','u','c','t','I','D',0};
|
||||
HKEY hkey=0;
|
||||
LPWSTR buffer;
|
||||
LPWSTR productid;
|
||||
|
@ -3736,7 +3722,8 @@ static UINT ACTION_RegisterUser(MSIPACKAGE *package)
|
|||
if (!package)
|
||||
return ERROR_INVALID_HANDLE;
|
||||
|
||||
productid = load_dynamic_property(package,szProductID,&rc);
|
||||
productid = load_dynamic_property(package,INSTALLPROPERTY_PRODUCTIDstringW,
|
||||
&rc);
|
||||
if (!productid)
|
||||
return ERROR_SUCCESS;
|
||||
|
||||
|
|
|
@ -83,9 +83,6 @@ UINT WINAPI MsiOpenProductA(LPCSTR szProduct, MSIHANDLE *phProduct)
|
|||
|
||||
UINT WINAPI MsiOpenProductW(LPCWSTR szProduct, MSIHANDLE *phProduct)
|
||||
{
|
||||
static const WCHAR szLocalPackage[] = {
|
||||
'L','o','c','a','l','P','a','c','k','a','g','e', 0
|
||||
};
|
||||
LPWSTR path = NULL;
|
||||
UINT r;
|
||||
HKEY hKeyProduct = NULL;
|
||||
|
@ -102,7 +99,7 @@ UINT WINAPI MsiOpenProductW(LPCWSTR szProduct, MSIHANDLE *phProduct)
|
|||
|
||||
/* find the size of the path */
|
||||
type = count = 0;
|
||||
r = RegQueryValueExW( hKeyProduct, szLocalPackage,
|
||||
r = RegQueryValueExW( hKeyProduct, INSTALLPROPERTY_LOCALPACKAGEstringW,
|
||||
NULL, &type, NULL, &count );
|
||||
if( r != ERROR_SUCCESS )
|
||||
{
|
||||
|
@ -115,7 +112,7 @@ UINT WINAPI MsiOpenProductW(LPCWSTR szProduct, MSIHANDLE *phProduct)
|
|||
if( !path )
|
||||
goto end;
|
||||
|
||||
r = RegQueryValueExW( hKeyProduct, szLocalPackage,
|
||||
r = RegQueryValueExW( hKeyProduct, INSTALLPROPERTY_LOCALPACKAGEstringW,
|
||||
NULL, &type, (LPBYTE) path, &count );
|
||||
if( r != ERROR_SUCCESS )
|
||||
{
|
||||
|
@ -527,16 +524,8 @@ UINT WINAPI MsiGetProductInfoW(LPCWSTR szProduct, LPCWSTR szAttribute,
|
|||
{
|
||||
MSIHANDLE hProduct;
|
||||
UINT r;
|
||||
static const WCHAR szPackageCode[] =
|
||||
{'P','a','c','k','a','g','e','C','o','d','e',0};
|
||||
static const WCHAR szVersionString[] =
|
||||
{'V','e','r','s','i','o','n','S','t','r','i','n','g',0};
|
||||
static const WCHAR szProductVersion[] =
|
||||
{'P','r','o','d','u','c','t','V','e','r','s','i','o','n',0};
|
||||
static const WCHAR szAssignmentType[] =
|
||||
{'A','s','s','i','g','n','m','e','n','t','T','y','p','e',0};
|
||||
static const WCHAR szLanguage[] =
|
||||
{'L','a','n','g','u','a','g','e',0};
|
||||
static const WCHAR szProductLanguage[] =
|
||||
{'P','r','o','d','u','c','t','L','a','n','g','u','a','g','e',0};
|
||||
|
||||
|
@ -549,7 +538,7 @@ UINT WINAPI MsiGetProductInfoW(LPCWSTR szProduct, LPCWSTR szAttribute,
|
|||
return ERROR_INVALID_PARAMETER;
|
||||
|
||||
/* check for special properties */
|
||||
if (strcmpW(szAttribute, szPackageCode)==0)
|
||||
if (strcmpW(szAttribute, INSTALLPROPERTY_PACKAGECODEstringW)==0)
|
||||
{
|
||||
HKEY hkey;
|
||||
WCHAR squished[GUID_SIZE];
|
||||
|
@ -560,7 +549,7 @@ UINT WINAPI MsiGetProductInfoW(LPCWSTR szProduct, LPCWSTR szAttribute,
|
|||
if (r != ERROR_SUCCESS)
|
||||
return ERROR_UNKNOWN_PRODUCT;
|
||||
|
||||
r = RegQueryValueExW(hkey, szPackageCode, NULL, NULL,
|
||||
r = RegQueryValueExW(hkey, INSTALLPROPERTY_PACKAGECODEstringW, NULL, NULL,
|
||||
(LPBYTE)squished, &sz);
|
||||
if (r != ERROR_SUCCESS)
|
||||
{
|
||||
|
@ -581,7 +570,7 @@ UINT WINAPI MsiGetProductInfoW(LPCWSTR szProduct, LPCWSTR szAttribute,
|
|||
RegCloseKey(hkey);
|
||||
r = ERROR_SUCCESS;
|
||||
}
|
||||
else if (strcmpW(szAttribute, szVersionString)==0)
|
||||
else if (strcmpW(szAttribute, INSTALLPROPERTY_VERSIONSTRINGstringW)==0)
|
||||
{
|
||||
r = MsiOpenProductW(szProduct, &hProduct);
|
||||
if (ERROR_SUCCESS != r)
|
||||
|
@ -590,7 +579,7 @@ UINT WINAPI MsiGetProductInfoW(LPCWSTR szProduct, LPCWSTR szAttribute,
|
|||
r = MsiGetPropertyW(hProduct, szProductVersion, szBuffer, pcchValueBuf);
|
||||
MsiCloseHandle(hProduct);
|
||||
}
|
||||
else if (strcmpW(szAttribute, szAssignmentType)==0)
|
||||
else if (strcmpW(szAttribute, INSTALLPROPERTY_ASSIGNMENTTYPEstringW)==0)
|
||||
{
|
||||
FIXME("0 (zero) if advertised or per user , 1(one) if per machine.\n");
|
||||
if (szBuffer)
|
||||
|
@ -602,7 +591,7 @@ UINT WINAPI MsiGetProductInfoW(LPCWSTR szProduct, LPCWSTR szAttribute,
|
|||
*pcchValueBuf = 1;
|
||||
r = ERROR_SUCCESS;
|
||||
}
|
||||
else if (strcmpW(szAttribute, szLanguage)==0)
|
||||
else if (strcmpW(szAttribute, INSTALLPROPERTY_LANGUAGEstringW)==0)
|
||||
{
|
||||
r = MsiOpenProductW(szProduct, &hProduct);
|
||||
if (ERROR_SUCCESS != r)
|
||||
|
@ -1587,9 +1576,6 @@ USERINFOSTATE WINAPI MsiGetUserInfoW(LPCWSTR szProduct, LPWSTR lpUserNameBuf,
|
|||
HKEY hkey;
|
||||
DWORD sz;
|
||||
UINT rc = ERROR_SUCCESS,rc2 = ERROR_SUCCESS;
|
||||
static const WCHAR szOwner[] = {'R','e','g','O','w','n','e','r',0};
|
||||
static const WCHAR szCompany[] = {'R','e','g','C','o','m','p','a','n','y',0};
|
||||
static const WCHAR szSerial[] = {'P','r','o','d','u','c','t','I','D',0};
|
||||
|
||||
TRACE("%s %p %p %p %p %p %p\n",debugstr_w(szProduct), lpUserNameBuf,
|
||||
pcchUserNameBuf, lpOrgNameBuf, pcchOrgNameBuf, lpSerialBuf,
|
||||
|
@ -1602,13 +1588,15 @@ USERINFOSTATE WINAPI MsiGetUserInfoW(LPCWSTR szProduct, LPWSTR lpUserNameBuf,
|
|||
if (lpUserNameBuf)
|
||||
{
|
||||
sz = *lpUserNameBuf * sizeof(WCHAR);
|
||||
rc = RegQueryValueExW( hkey, szOwner, NULL, NULL, (LPBYTE)lpUserNameBuf,
|
||||
rc = RegQueryValueExW( hkey, INSTALLPROPERTY_REGOWNERstringW, NULL,
|
||||
NULL, (LPBYTE)lpUserNameBuf,
|
||||
&sz);
|
||||
}
|
||||
if (!lpUserNameBuf && pcchUserNameBuf)
|
||||
{
|
||||
sz = 0;
|
||||
rc = RegQueryValueExW( hkey, szOwner, NULL, NULL, NULL, &sz);
|
||||
rc = RegQueryValueExW( hkey, INSTALLPROPERTY_REGOWNERstringW, NULL,
|
||||
NULL, NULL, &sz);
|
||||
}
|
||||
|
||||
if (pcchUserNameBuf)
|
||||
|
@ -1617,13 +1605,14 @@ USERINFOSTATE WINAPI MsiGetUserInfoW(LPCWSTR szProduct, LPWSTR lpUserNameBuf,
|
|||
if (lpOrgNameBuf)
|
||||
{
|
||||
sz = *pcchOrgNameBuf * sizeof(WCHAR);
|
||||
rc2 = RegQueryValueExW( hkey, szCompany, NULL, NULL,
|
||||
(LPBYTE)lpOrgNameBuf, &sz);
|
||||
rc2 = RegQueryValueExW( hkey, INSTALLPROPERTY_REGCOMPANYstringW, NULL,
|
||||
NULL, (LPBYTE)lpOrgNameBuf, &sz);
|
||||
}
|
||||
if (!lpOrgNameBuf && pcchOrgNameBuf)
|
||||
{
|
||||
sz = 0;
|
||||
rc2 = RegQueryValueExW( hkey, szCompany, NULL, NULL, NULL, &sz);
|
||||
rc2 = RegQueryValueExW( hkey, INSTALLPROPERTY_REGCOMPANYstringW, NULL,
|
||||
NULL, NULL, &sz);
|
||||
}
|
||||
|
||||
if (pcchOrgNameBuf)
|
||||
|
@ -1639,13 +1628,14 @@ USERINFOSTATE WINAPI MsiGetUserInfoW(LPCWSTR szProduct, LPWSTR lpUserNameBuf,
|
|||
if (lpSerialBuf)
|
||||
{
|
||||
sz = *pcchSerialBuf * sizeof(WCHAR);
|
||||
RegQueryValueExW( hkey, szSerial, NULL, NULL, (LPBYTE)lpSerialBuf,
|
||||
&sz);
|
||||
RegQueryValueExW( hkey, INSTALLPROPERTY_PRODUCTIDstringW, NULL, NULL,
|
||||
(LPBYTE)lpSerialBuf, &sz);
|
||||
}
|
||||
if (!lpSerialBuf && pcchSerialBuf)
|
||||
{
|
||||
sz = 0;
|
||||
rc = RegQueryValueExW( hkey, szSerial, NULL, NULL, NULL, &sz);
|
||||
rc = RegQueryValueExW( hkey, INSTALLPROPERTY_PRODUCTIDstringW, NULL,
|
||||
NULL, NULL, &sz);
|
||||
}
|
||||
if (pcchSerialBuf)
|
||||
*pcchSerialBuf = sz / sizeof(WCHAR);
|
||||
|
|
|
@ -136,10 +136,6 @@ static UINT ITERATE_FindRelatedProducts(MSIRECORD *rec, LPVOID param)
|
|||
DWORD sz = 0x100;
|
||||
HKEY hukey;
|
||||
INT r;
|
||||
static const WCHAR szVersion[] =
|
||||
{'V','e','r','s','i','o','n',0};
|
||||
static const WCHAR szLanguage[] =
|
||||
{'L','a','n','g','u','a','g','e',0};
|
||||
|
||||
unsquash_guid(product,productid);
|
||||
rc = MSIREG_OpenUserProductsKey(productid, &hukey, FALSE);
|
||||
|
@ -151,8 +147,8 @@ static UINT ITERATE_FindRelatedProducts(MSIRECORD *rec, LPVOID param)
|
|||
}
|
||||
|
||||
sz = sizeof(DWORD);
|
||||
RegQueryValueExW(hukey, szVersion, NULL, NULL, (LPBYTE)&check,
|
||||
&sz);
|
||||
RegQueryValueExW(hukey, INSTALLPROPERTY_VERSIONstringW, NULL, NULL,
|
||||
(LPBYTE)&check, &sz);
|
||||
/* check min */
|
||||
ver = MSI_RecordGetString(rec,2);
|
||||
comp_ver = build_version_dword(ver);
|
||||
|
@ -179,8 +175,8 @@ static UINT ITERATE_FindRelatedProducts(MSIRECORD *rec, LPVOID param)
|
|||
|
||||
/* check language*/
|
||||
sz = sizeof(DWORD);
|
||||
RegQueryValueExW(hukey, szLanguage, NULL, NULL, (LPBYTE)&check,
|
||||
&sz);
|
||||
RegQueryValueExW(hukey, INSTALLPROPERTY_LANGUAGEstringW, NULL, NULL,
|
||||
(LPBYTE)&check, &sz);
|
||||
RegCloseKey(hukey);
|
||||
language = MSI_RecordGetString(rec,4);
|
||||
TRACE("Checking languages 0x%lx and %s\n", check,
|
||||
|
|
Loading…
Reference in New Issue