From 1fa2da0756f722c3856c97eab8eef2f47a0bf65f Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Wed, 4 May 2005 10:37:05 +0000 Subject: [PATCH] Set PhysicalMemory property from system data. --- dlls/msi/package.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/dlls/msi/package.c b/dlls/msi/package.c index d2f6e0a847f..30e15ba921d 100644 --- a/dlls/msi/package.c +++ b/dlls/msi/package.c @@ -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;