Set PhysicalMemory property from system data.

This commit is contained in:
Marcus Meissner 2005-05-04 10:37:05 +00:00 committed by Alexandre Julliard
parent caf6fa9531
commit 1fa2da0756

View file

@ -139,6 +139,7 @@ static VOID set_installer_properties(MSIPACKAGE *package)
WCHAR pth[MAX_PATH];
WCHAR *ptr;
OSVERSIONINFOA OSVersion;
MEMORYSTATUSEX msex;
DWORD verval;
WCHAR verstr[10], bufstr[20];
HDC dc;
@ -202,6 +203,7 @@ static VOID set_installer_properties(MSIPACKAGE *package)
static const WCHAR szSix[] = {'6',0 };
static const WCHAR szVersionMsi[] = { 'V','e','r','s','i','o','n','M','s','i',0 };
static const WCHAR szPhysicalMemory[] = { 'P','h','y','s','i','c','a','l','M','e','m','o','r','y',0 };
static const WCHAR szFormat2[] = {'%','l','i','.','%','l','i',0};
/* Screen properties */
static const WCHAR szScreenX[] = {'S','c','r','e','e','n','X',0};
@ -217,7 +219,6 @@ ComputerName
UserLanguageID
LogonUser
VirtualMemory
PhysicalMemory
Intel
ShellAdvSupport
DefaultUIFont
@ -306,6 +307,12 @@ Privileged
SHGetFolderPathW(NULL,CSIDL_WINDOWS,NULL,0,pth);
strcatW(pth,cszbs);
MSI_SetPropertyW(package, WF, pth);
/* Physical Memory is specified in MB. Using total amount. */
msex.dwLength = sizeof(msex);
GlobalMemoryStatusEx( &msex );
sprintfW( bufstr, szScreenFormat, (int)(msex.ullTotalPhys/1024/1024));
MSI_SetPropertyW(package, szPhysicalMemory, bufstr);
SHGetFolderPathW(NULL,CSIDL_WINDOWS,NULL,0,pth);
ptr = strchrW(pth,'\\');
@ -793,7 +800,7 @@ UINT MSI_GetPropertyW(MSIPACKAGE *package, LPCWSTR szName,
else
{
*pchValueBuf = 0;
TRACE("property not found\n");
TRACE("property %s not found\n", debugstr_w(szName));
}
return rc;