summaryrefslogtreecommitdiffstats
path: root/libmsi
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-10-22 12:22:49 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2012-12-06 20:25:48 +0100
commit3e77508e10e4b8cbbc06dc74f200011934f6c69c (patch)
treeb890eb1e324f1871d6473ac682c8aab473409a80 /libmsi
parent4f63fbf96d797c5f1f8aa9f7d35d14bf0cb198b5 (diff)
downloadmsitools-3e77508e10e4b8cbbc06dc74f200011934f6c69c.tar.gz
msitools-3e77508e10e4b8cbbc06dc74f200011934f6c69c.tar.xz
msitools-3e77508e10e4b8cbbc06dc74f200011934f6c69c.zip
do not set run-time properties
Diffstat (limited to 'libmsi')
-rw-r--r--libmsi/package.c503
1 files changed, 0 insertions, 503 deletions
diff --git a/libmsi/package.c b/libmsi/package.c
index 3e3faad..06c13c5 100644
--- a/libmsi/package.c
+++ b/libmsi/package.c
@@ -516,28 +516,6 @@ UINT msi_clone_properties(MSIPACKAGE *package)
return rc;
}
-/*
- * set_installed_prop
- *
- * Sets the "Installed" property to indicate that
- * the product is installed for the current user.
- */
-static UINT set_installed_prop( MSIPACKAGE *package )
-{
- HKEY hkey;
- UINT r;
-
- if (!package->ProductCode) return ERROR_FUNCTION_FAILED;
-
- r = MSIREG_OpenUninstallKey( package->ProductCode, package->platform, &hkey, FALSE );
- if (r == ERROR_SUCCESS)
- {
- RegCloseKey( hkey );
- msi_set_property( package->db, szInstalled, szOne );
- }
- return r;
-}
-
static UINT set_user_sid_prop( MSIPACKAGE *package )
{
SID_NAME_USE use;
@@ -586,490 +564,12 @@ done:
return r;
}
-static LPWSTR get_fusion_filename(MSIPACKAGE *package)
-{
- HKEY netsetup;
- LONG res;
- LPWSTR file = NULL;
- DWORD index = 0, size;
- WCHAR ver[MAX_PATH];
- WCHAR name[MAX_PATH];
- WCHAR windir[MAX_PATH];
-
- static const WCHAR fusion[] = {'f','u','s','i','o','n','.','d','l','l',0};
- static const WCHAR sub[] = {
- 'S','o','f','t','w','a','r','e','\\',
- 'M','i','c','r','o','s','o','f','t','\\',
- 'N','E','T',' ','F','r','a','m','e','w','o','r','k',' ','S','e','t','u','p','\\',
- 'N','D','P',0
- };
- static const WCHAR subdir[] = {
- 'M','i','c','r','o','s','o','f','t','.','N','E','T','\\',
- 'F','r','a','m','e','w','o','r','k','\\',0
- };
-
- res = RegOpenKeyExW(HKEY_LOCAL_MACHINE, sub, 0, KEY_ENUMERATE_SUB_KEYS, &netsetup);
- if (res != ERROR_SUCCESS)
- return NULL;
-
- GetWindowsDirectoryW(windir, MAX_PATH);
-
- ver[0] = '\0';
- size = MAX_PATH;
- while (RegEnumKeyExW(netsetup, index, name, &size, NULL, NULL, NULL, NULL) == ERROR_SUCCESS)
- {
- index++;
-
- /* verify existence of fusion.dll .Net 3.0 does not install a new one */
- if (strcmpW( ver, name ) < 0)
- {
- LPWSTR check;
- size = lstrlenW(windir) + lstrlenW(subdir) + lstrlenW(name) +lstrlenW(fusion) + 3;
- check = msi_alloc(size * sizeof(WCHAR));
-
- if (!check)
- {
- msi_free(file);
- return NULL;
- }
-
- lstrcpyW(check, windir);
- lstrcatW(check, szBackSlash);
- lstrcatW(check, subdir);
- lstrcatW(check, name);
- lstrcatW(check, szBackSlash);
- lstrcatW(check, fusion);
-
- if(GetFileAttributesW(check) != INVALID_FILE_ATTRIBUTES)
- {
- msi_free(file);
- file = check;
- lstrcpyW(ver, name);
- }
- else
- msi_free(check);
- }
- }
-
- RegCloseKey(netsetup);
- return file;
-}
-
typedef struct tagLANGANDCODEPAGE
{
WORD wLanguage;
WORD wCodePage;
} LANGANDCODEPAGE;
-static void set_msi_assembly_prop(MSIPACKAGE *package)
-{
- UINT val_len;
- DWORD size, handle;
- LPVOID version = NULL;
- WCHAR buf[MAX_PATH];
- LPWSTR fusion, verstr;
- LANGANDCODEPAGE *translate;
-
- static const WCHAR netasm[] = {
- 'M','s','i','N','e','t','A','s','s','e','m','b','l','y','S','u','p','p','o','r','t',0
- };
- static const WCHAR translation[] = {
- '\\','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 verfmt[] = {
- '\\','S','t','r','i','n','g','F','i','l','e','I','n','f','o',
- '\\','%','0','4','x','%','0','4','x',
- '\\','P','r','o','d','u','c','t','V','e','r','s','i','o','n',0
- };
-
- fusion = get_fusion_filename(package);
- if (!fusion)
- return;
-
- size = GetFileVersionInfoSizeW(fusion, &handle);
- if (!size) return;
-
- version = msi_alloc(size);
- if (!version) return;
-
- if (!GetFileVersionInfoW(fusion, handle, size, version))
- goto done;
-
- if (!VerQueryValueW(version, translation, (LPVOID *)&translate, &val_len))
- goto done;
-
- sprintfW(buf, verfmt, translate[0].wLanguage, translate[0].wCodePage);
-
- if (!VerQueryValueW(version, buf, (LPVOID *)&verstr, &val_len))
- goto done;
-
- if (!val_len || !verstr)
- goto done;
-
- msi_set_property(package->db, netasm, verstr);
-
-done:
- msi_free(fusion);
- msi_free(version);
-}
-
-static VOID set_installer_properties(MSIPACKAGE *package)
-{
- WCHAR *ptr;
- OSVERSIONINFOEXW OSVersion;
- MEMORYSTATUSEX msex;
- DWORD verval, len;
- WCHAR pth[MAX_PATH], verstr[11], bufstr[22];
- HDC dc;
- HKEY hkey;
- LPWSTR username, companyname;
- SYSTEM_INFO sys_info;
- SYSTEMTIME systemtime;
- LANGID langid;
-
- static const WCHAR szCommonFilesFolder[] = {'C','o','m','m','o','n','F','i','l','e','s','F','o','l','d','e','r',0};
- static const WCHAR szProgramFilesFolder[] = {'P','r','o','g','r','a','m','F','i','l','e','s','F','o','l','d','e','r',0};
- static const WCHAR szCommonAppDataFolder[] = {'C','o','m','m','o','n','A','p','p','D','a','t','a','F','o','l','d','e','r',0};
- static const WCHAR szFavoritesFolder[] = {'F','a','v','o','r','i','t','e','s','F','o','l','d','e','r',0};
- static const WCHAR szFontsFolder[] = {'F','o','n','t','s','F','o','l','d','e','r',0};
- static const WCHAR szSendToFolder[] = {'S','e','n','d','T','o','F','o','l','d','e','r',0};
- static const WCHAR szStartMenuFolder[] = {'S','t','a','r','t','M','e','n','u','F','o','l','d','e','r',0};
- static const WCHAR szStartupFolder[] = {'S','t','a','r','t','u','p','F','o','l','d','e','r',0};
- static const WCHAR szTemplateFolder[] = {'T','e','m','p','l','a','t','e','F','o','l','d','e','r',0};
- static const WCHAR szDesktopFolder[] = {'D','e','s','k','t','o','p','F','o','l','d','e','r',0};
- static const WCHAR szProgramMenuFolder[] = {'P','r','o','g','r','a','m','M','e','n','u','F','o','l','d','e','r',0};
- static const WCHAR szAdminToolsFolder[] = {'A','d','m','i','n','T','o','o','l','s','F','o','l','d','e','r',0};
- static const WCHAR szSystemFolder[] = {'S','y','s','t','e','m','F','o','l','d','e','r',0};
- static const WCHAR szSystem16Folder[] = {'S','y','s','t','e','m','1','6','F','o','l','d','e','r',0};
- static const WCHAR szLocalAppDataFolder[] = {'L','o','c','a','l','A','p','p','D','a','t','a','F','o','l','d','e','r',0};
- static const WCHAR szMyPicturesFolder[] = {'M','y','P','i','c','t','u','r','e','s','F','o','l','d','e','r',0};
- static const WCHAR szPersonalFolder[] = {'P','e','r','s','o','n','a','l','F','o','l','d','e','r',0};
- static const WCHAR szWindowsVolume[] = {'W','i','n','d','o','w','s','V','o','l','u','m','e',0};
- static const WCHAR szPrivileged[] = {'P','r','i','v','i','l','e','g','e','d',0};
- static const WCHAR szVersion9x[] = {'V','e','r','s','i','o','n','9','X',0};
- static const WCHAR szVersionNT[] = {'V','e','r','s','i','o','n','N','T',0};
- static const WCHAR szMsiNTProductType[] = {'M','s','i','N','T','P','r','o','d','u','c','t','T','y','p','e',0};
- static const WCHAR szFormat[] = {'%','u',0};
- static const WCHAR szFormat2[] = {'%','u','.','%','u',0};
- static const WCHAR szWindowsBuild[] = {'W','i','n','d','o','w','s','B','u','i','l','d',0};
- static const WCHAR szServicePackLevel[] = {'S','e','r','v','i','c','e','P','a','c','k','L','e','v','e','l',0};
- static const WCHAR szVersionMsi[] = { 'V','e','r','s','i','o','n','M','s','i',0 };
- static const WCHAR szVersionDatabase[] = { 'V','e','r','s','i','o','n','D','a','t','a','b','a','s','e',0 };
- static const WCHAR szPhysicalMemory[] = { 'P','h','y','s','i','c','a','l','M','e','m','o','r','y',0 };
- static const WCHAR szScreenX[] = {'S','c','r','e','e','n','X',0};
- static const WCHAR szScreenY[] = {'S','c','r','e','e','n','Y',0};
- static const WCHAR szColorBits[] = {'C','o','l','o','r','B','i','t','s',0};
- static const WCHAR szIntFormat[] = {'%','d',0};
- static const WCHAR szMsiAMD64[] = { 'M','s','i','A','M','D','6','4',0 };
- static const WCHAR szMsix64[] = { 'M','s','i','x','6','4',0 };
- static const WCHAR szSystem64Folder[] = { 'S','y','s','t','e','m','6','4','F','o','l','d','e','r',0 };
- static const WCHAR szCommonFiles64Folder[] = { 'C','o','m','m','o','n','F','i','l','e','s','6','4','F','o','l','d','e','r',0 };
- static const WCHAR szProgramFiles64Folder[] = { 'P','r','o','g','r','a','m','F','i','l','e','s','6','4','F','o','l','d','e','r',0 };
- static const WCHAR szVersionNT64[] = { 'V','e','r','s','i','o','n','N','T','6','4',0 };
- static const WCHAR szUserInfo[] = {
- 'S','O','F','T','W','A','R','E','\\',
- 'M','i','c','r','o','s','o','f','t','\\',
- 'M','S',' ','S','e','t','u','p',' ','(','A','C','M','E',')','\\',
- 'U','s','e','r',' ','I','n','f','o',0
- };
- static const WCHAR szDefName[] = { 'D','e','f','N','a','m','e',0 };
- static const WCHAR szDefCompany[] = { 'D','e','f','C','o','m','p','a','n','y',0 };
- static const WCHAR szCurrentVersion[] = {
- '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',0
- };
- static const WCHAR szRegisteredUser[] = {'R','e','g','i','s','t','e','r','e','d','O','w','n','e','r',0};
- static const WCHAR szRegisteredOrganization[] = {
- 'R','e','g','i','s','t','e','r','e','d','O','r','g','a','n','i','z','a','t','i','o','n',0
- };
- static const WCHAR szUSERNAME[] = {'U','S','E','R','N','A','M','E',0};
- static const WCHAR szCOMPANYNAME[] = {'C','O','M','P','A','N','Y','N','A','M','E',0};
- static const WCHAR szDate[] = {'D','a','t','e',0};
- static const WCHAR szTime[] = {'T','i','m','e',0};
- static const WCHAR szUserLanguageID[] = {'U','s','e','r','L','a','n','g','u','a','g','e','I','D',0};
- static const WCHAR szSystemLangID[] = {'S','y','s','t','e','m','L','a','n','g','u','a','g','e','I','D',0};
- static const WCHAR szProductState[] = {'P','r','o','d','u','c','t','S','t','a','t','e',0};
- static const WCHAR szLogonUser[] = {'L','o','g','o','n','U','s','e','r',0};
- static const WCHAR szNetHoodFolder[] = {'N','e','t','H','o','o','d','F','o','l','d','e','r',0};
- static const WCHAR szPrintHoodFolder[] = {'P','r','i','n','t','H','o','o','d','F','o','l','d','e','r',0};
- static const WCHAR szRecentFolder[] = {'R','e','c','e','n','t','F','o','l','d','e','r',0};
- static const WCHAR szComputerName[] = {'C','o','m','p','u','t','e','r','N','a','m','e',0};
-
- /*
- * Other things that probably should be set:
- *
- * VirtualMemory ShellAdvSupport DefaultUIFont PackagecodeChanging
- * CaptionHeight BorderTop BorderSide TextHeight RedirectedDllSupport
- */
-
- SHGetFolderPathW(NULL, CSIDL_COMMON_APPDATA, NULL, 0, pth);
- strcatW(pth, szBackSlash);
- msi_set_property(package->db, szCommonAppDataFolder, pth);
-
- SHGetFolderPathW(NULL, CSIDL_FAVORITES, NULL, 0, pth);
- strcatW(pth, szBackSlash);
- msi_set_property(package->db, szFavoritesFolder, pth);
-
- SHGetFolderPathW(NULL, CSIDL_FONTS, NULL, 0, pth);
- strcatW(pth, szBackSlash);
- msi_set_property(package->db, szFontsFolder, pth);
-
- SHGetFolderPathW(NULL, CSIDL_SENDTO, NULL, 0, pth);
- strcatW(pth, szBackSlash);
- msi_set_property(package->db, szSendToFolder, pth);
-
- SHGetFolderPathW(NULL, CSIDL_STARTMENU, NULL, 0, pth);
- strcatW(pth, szBackSlash);
- msi_set_property(package->db, szStartMenuFolder, pth);
-
- SHGetFolderPathW(NULL, CSIDL_STARTUP, NULL, 0, pth);
- strcatW(pth, szBackSlash);
- msi_set_property(package->db, szStartupFolder, pth);
-
- SHGetFolderPathW(NULL, CSIDL_TEMPLATES, NULL, 0, pth);
- strcatW(pth, szBackSlash);
- msi_set_property(package->db, szTemplateFolder, pth);
-
- SHGetFolderPathW(NULL, CSIDL_DESKTOP, NULL, 0, pth);
- strcatW(pth, szBackSlash);
- msi_set_property(package->db, szDesktopFolder, pth);
-
- /* FIXME: set to AllUsers profile path if ALLUSERS is set */
- SHGetFolderPathW(NULL, CSIDL_PROGRAMS, NULL, 0, pth);
- strcatW(pth, szBackSlash);
- msi_set_property(package->db, szProgramMenuFolder, pth);
-
- SHGetFolderPathW(NULL, CSIDL_ADMINTOOLS, NULL, 0, pth);
- strcatW(pth, szBackSlash);
- msi_set_property(package->db, szAdminToolsFolder, pth);
-
- SHGetFolderPathW(NULL, CSIDL_APPDATA, NULL, 0, pth);
- strcatW(pth, szBackSlash);
- msi_set_property(package->db, szAppDataFolder, pth);
-
- SHGetFolderPathW(NULL, CSIDL_SYSTEM, NULL, 0, pth);
- strcatW(pth, szBackSlash);
- msi_set_property(package->db, szSystemFolder, pth);
- msi_set_property(package->db, szSystem16Folder, pth);
-
- SHGetFolderPathW(NULL, CSIDL_LOCAL_APPDATA, NULL, 0, pth);
- strcatW(pth, szBackSlash);
- msi_set_property(package->db, szLocalAppDataFolder, pth);
-
- SHGetFolderPathW(NULL, CSIDL_MYPICTURES, NULL, 0, pth);
- strcatW(pth, szBackSlash);
- msi_set_property(package->db, szMyPicturesFolder, pth);
-
- SHGetFolderPathW(NULL, CSIDL_PERSONAL, NULL, 0, pth);
- strcatW(pth, szBackSlash);
- msi_set_property(package->db, szPersonalFolder, pth);
-
- SHGetFolderPathW(NULL, CSIDL_WINDOWS, NULL, 0, pth);
- strcatW(pth, szBackSlash);
- msi_set_property(package->db, szWindowsFolder, pth);
-
- SHGetFolderPathW(NULL, CSIDL_PRINTHOOD, NULL, 0, pth);
- strcatW(pth, szBackSlash);
- msi_set_property(package->db, szPrintHoodFolder, pth);
-
- SHGetFolderPathW(NULL, CSIDL_NETHOOD, NULL, 0, pth);
- strcatW(pth, szBackSlash);
- msi_set_property(package->db, szNetHoodFolder, pth);
-
- SHGetFolderPathW(NULL, CSIDL_RECENT, NULL, 0, pth);
- strcatW(pth, szBackSlash);
- msi_set_property(package->db, szRecentFolder, pth);
-
- /* Physical Memory is specified in MB. Using total amount. */
- msex.dwLength = sizeof(msex);
- GlobalMemoryStatusEx( &msex );
- sprintfW( bufstr, szIntFormat, (int)(msex.ullTotalPhys / 1024 / 1024) );
- msi_set_property(package->db, szPhysicalMemory, bufstr);
-
- SHGetFolderPathW(NULL, CSIDL_WINDOWS, NULL, 0, pth);
- ptr = strchrW(pth,'\\');
- if (ptr) *(ptr + 1) = 0;
- msi_set_property(package->db, szWindowsVolume, pth);
-
- GetTempPathW(MAX_PATH,pth);
- msi_set_property(package->db, szTempFolder, pth);
-
- /* in a wine environment the user is always admin and privileged */
- msi_set_property(package->db, szAdminUser, szOne);
- msi_set_property(package->db, szPrivileged, szOne);
-
- /* set the os things */
- OSVersion.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXW);
- GetVersionExW((OSVERSIONINFOW *)&OSVersion);
- verval = OSVersion.dwMinorVersion + OSVersion.dwMajorVersion * 100;
- sprintfW(verstr, szFormat, verval);
- switch (OSVersion.dwPlatformId)
- {
- case VER_PLATFORM_WIN32_WINDOWS:
- msi_set_property(package->db, szVersion9x, verstr);
- break;
- case VER_PLATFORM_WIN32_NT:
- msi_set_property(package->db, szVersionNT, verstr);
- sprintfW(verstr, szFormat,OSVersion.wProductType);
- msi_set_property(package->db, szMsiNTProductType, verstr);
- break;
- }
- sprintfW(verstr, szFormat, OSVersion.dwBuildNumber);
- msi_set_property(package->db, szWindowsBuild, verstr);
- sprintfW(verstr, szFormat, OSVersion.wServicePackMajor);
- msi_set_property(package->db, szServicePackLevel, verstr);
-
- sprintfW( bufstr, szFormat2, MSI_MAJORVERSION, MSI_MINORVERSION);
- msi_set_property( package->db, szVersionMsi, bufstr );
- sprintfW( bufstr, szFormat, MSI_MAJORVERSION * 100);
- msi_set_property( package->db, szVersionDatabase, bufstr );
-
- GetNativeSystemInfo( &sys_info );
- sprintfW( bufstr, szIntFormat, sys_info.wProcessorLevel );
- msi_set_property( package->db, szIntel, bufstr );
- if (sys_info.u.s.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL)
- {
- GetSystemDirectoryW( pth, MAX_PATH );
- PathAddBackslashW( pth );
- msi_set_property( package->db, szSystemFolder, pth );
-
- SHGetFolderPathW( NULL, CSIDL_PROGRAM_FILES, NULL, 0, pth );
- PathAddBackslashW( pth );
- msi_set_property( package->db, szProgramFilesFolder, pth );
-
- SHGetFolderPathW( NULL, CSIDL_PROGRAM_FILES_COMMON, NULL, 0, pth );
- PathAddBackslashW( pth );
- msi_set_property( package->db, szCommonFilesFolder, pth );
- }
- else if (sys_info.u.s.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
- {
- msi_set_property( package->db, szMsiAMD64, bufstr );
- msi_set_property( package->db, szMsix64, bufstr );
- msi_set_property( package->db, szVersionNT64, verstr );
-
- GetSystemDirectoryW( pth, MAX_PATH );
- PathAddBackslashW( pth );
- msi_set_property( package->db, szSystem64Folder, pth );
-
- GetSystemWow64DirectoryW( pth, MAX_PATH );
- PathAddBackslashW( pth );
- msi_set_property( package->db, szSystemFolder, pth );
-
- SHGetFolderPathW( NULL, CSIDL_PROGRAM_FILES, NULL, 0, pth );
- PathAddBackslashW( pth );
- msi_set_property( package->db, szProgramFiles64Folder, pth );
-
- SHGetFolderPathW( NULL, CSIDL_PROGRAM_FILESX86, NULL, 0, pth );
- PathAddBackslashW( pth );
- msi_set_property( package->db, szProgramFilesFolder, pth );
-
- SHGetFolderPathW( NULL, CSIDL_PROGRAM_FILES_COMMON, NULL, 0, pth );
- PathAddBackslashW( pth );
- msi_set_property( package->db, szCommonFiles64Folder, pth );
-
- SHGetFolderPathW( NULL, CSIDL_PROGRAM_FILES_COMMONX86, NULL, 0, pth );
- PathAddBackslashW( pth );
- msi_set_property( package->db, szCommonFilesFolder, pth );
- }
-
- /* Screen properties. */
- dc = GetDC(0);
- sprintfW( bufstr, szIntFormat, GetDeviceCaps( dc, HORZRES ) );
- msi_set_property( package->db, szScreenX, bufstr );
- sprintfW( bufstr, szIntFormat, GetDeviceCaps( dc, VERTRES ));
- msi_set_property( package->db, szScreenY, bufstr );
- sprintfW( bufstr, szIntFormat, GetDeviceCaps( dc, BITSPIXEL ));
- msi_set_property( package->db, szColorBits, bufstr );
- ReleaseDC(0, dc);
-
- /* USERNAME and COMPANYNAME */
- username = msi_dup_property( package->db, szUSERNAME );
- companyname = msi_dup_property( package->db, szCOMPANYNAME );
-
- if ((!username || !companyname) &&
- RegOpenKeyW( HKEY_CURRENT_USER, szUserInfo, &hkey ) == ERROR_SUCCESS)
- {
- if (!username &&
- (username = msi_reg_get_val_str( hkey, szDefName )))
- msi_set_property( package->db, szUSERNAME, username );
- if (!companyname &&
- (companyname = msi_reg_get_val_str( hkey, szDefCompany )))
- msi_set_property( package->db, szCOMPANYNAME, companyname );
- CloseHandle( hkey );
- }
- if ((!username || !companyname) &&
- RegOpenKeyW( HKEY_LOCAL_MACHINE, szCurrentVersion, &hkey ) == ERROR_SUCCESS)
- {
- if (!username &&
- (username = msi_reg_get_val_str( hkey, szRegisteredUser )))
- msi_set_property( package->db, szUSERNAME, username );
- if (!companyname &&
- (companyname = msi_reg_get_val_str( hkey, szRegisteredOrganization )))
- msi_set_property( package->db, szCOMPANYNAME, companyname );
- CloseHandle( hkey );
- }
- msi_free( username );
- msi_free( companyname );
-
- if ( set_user_sid_prop( package ) != ERROR_SUCCESS)
- ERR("Failed to set the UserSID property\n");
-
- /* Date and time properties */
- GetSystemTime( &systemtime );
- if (GetDateFormatW( LOCALE_USER_DEFAULT, DATE_SHORTDATE, &systemtime,
- NULL, bufstr, sizeof(bufstr)/sizeof(bufstr[0]) ))
- msi_set_property( package->db, szDate, bufstr );
- else
- ERR("Couldn't set Date property: GetDateFormat failed with error %d\n", GetLastError());
-
- if (GetTimeFormatW( LOCALE_USER_DEFAULT,
- TIME_FORCE24HOURFORMAT | TIME_NOTIMEMARKER,
- &systemtime, NULL, bufstr,
- sizeof(bufstr)/sizeof(bufstr[0]) ))
- msi_set_property( package->db, szTime, bufstr );
- else
- ERR("Couldn't set Time property: GetTimeFormat failed with error %d\n", GetLastError());
-
- set_msi_assembly_prop( package );
-
- langid = GetUserDefaultLangID();
- sprintfW(bufstr, szIntFormat, langid);
- msi_set_property( package->db, szUserLanguageID, bufstr );
-
- langid = GetSystemDefaultLangID();
- sprintfW(bufstr, szIntFormat, langid);
- msi_set_property( package->db, szSystemLangID, bufstr );
-
- sprintfW(bufstr, szIntFormat, MsiQueryProductStateW(package->ProductCode));
- msi_set_property( package->db, szProductState, bufstr );
-
- len = 0;
- if (!GetUserNameW( NULL, &len ) && GetLastError() == ERROR_INSUFFICIENT_BUFFER)
- {
- WCHAR *username;
- if ((username = msi_alloc( len * sizeof(WCHAR) )))
- {
- if (GetUserNameW( username, &len ))
- msi_set_property( package->db, szLogonUser, username );
- msi_free( username );
- }
- }
- len = 0;
- if (!GetComputerNameW( NULL, &len ) && GetLastError() == ERROR_BUFFER_OVERFLOW)
- {
- WCHAR *computername;
- if ((computername = msi_alloc( len * sizeof(WCHAR) )))
- {
- if (GetComputerNameW( computername, &len ))
- msi_set_property( package->db, szComputerName, computername );
- msi_free( computername );
- }
- }
-}
-
static UINT msi_load_summary_properties( MSIPACKAGE *package )
{
UINT rc;
@@ -1224,9 +724,6 @@ MSIPACKAGE *MSI_CreatePackage( MSIDATABASE *db, LPCWSTR base_url )
package->ProductCode = msi_dup_property( package->db, szProductCode );
package->script = msi_alloc_zero( sizeof(MSISCRIPT) );
- set_installed_prop( package );
- set_installer_properties( package );
-
package->ui_level = gUILevel;
sprintfW( uilevel, fmtW, gUILevel & INSTALLUILEVEL_MASK );
msi_set_property(package->db, szUILevel, uilevel);