Commit 842525f4 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

msi: Try the registered install location first when resolving the target directory.

parent b7cefc99
...@@ -2281,6 +2281,19 @@ WCHAR *msi_normalize_path( const WCHAR *in ) ...@@ -2281,6 +2281,19 @@ WCHAR *msi_normalize_path( const WCHAR *in )
return ret; return ret;
} }
static WCHAR *get_install_location( MSIPACKAGE *package )
{
HKEY hkey;
WCHAR *path;
if (!package->ProductCode) return NULL;
if (MSIREG_OpenInstallProps( package->ProductCode, package->Context, NULL, &hkey, FALSE ))
return NULL;
path = msi_reg_get_val_str( hkey, szInstallLocation );
RegCloseKey( hkey );
return path;
}
void msi_resolve_target_folder( MSIPACKAGE *package, const WCHAR *name, BOOL load_prop ) void msi_resolve_target_folder( MSIPACKAGE *package, const WCHAR *name, BOOL load_prop )
{ {
FolderList *fl; FolderList *fl;
...@@ -2293,7 +2306,8 @@ void msi_resolve_target_folder( MSIPACKAGE *package, const WCHAR *name, BOOL loa ...@@ -2293,7 +2306,8 @@ void msi_resolve_target_folder( MSIPACKAGE *package, const WCHAR *name, BOOL loa
if (!strcmpW( folder->Directory, szTargetDir )) /* special resolving for target root dir */ if (!strcmpW( folder->Directory, szTargetDir )) /* special resolving for target root dir */
{ {
if (!load_prop || !(path = msi_dup_property( package->db, szTargetDir ))) if (!(path = get_install_location( package )) &&
(!load_prop || !(path = msi_dup_property( package->db, szTargetDir ))))
{ {
path = msi_dup_property( package->db, szRootDrive ); path = msi_dup_property( package->db, szRootDrive );
} }
...@@ -4837,8 +4851,6 @@ static UINT msi_publish_install_properties(MSIPACKAGE *package, HKEY hkey) ...@@ -4837,8 +4851,6 @@ static UINT msi_publish_install_properties(MSIPACKAGE *package, HKEY hkey)
{'H','e','l','p','T','e','l','e','p','h','o','n','e',0}; {'H','e','l','p','T','e','l','e','p','h','o','n','e',0};
static const WCHAR szARPINSTALLLOCATION[] = static const WCHAR szARPINSTALLLOCATION[] =
{'A','R','P','I','N','S','T','A','L','L','L','O','C','A','T','I','O','N',0}; {'A','R','P','I','N','S','T','A','L','L','L','O','C','A','T','I','O','N',0};
static const WCHAR szInstallLocation[] =
{'I','n','s','t','a','l','l','L','o','c','a','t','i','o','n',0};
static const WCHAR szManufacturer[] = static const WCHAR szManufacturer[] =
{'M','a','n','u','f','a','c','t','u','r','e','r',0}; {'M','a','n','u','f','a','c','t','u','r','e','r',0};
static const WCHAR szPublisher[] = static const WCHAR szPublisher[] =
......
...@@ -1177,6 +1177,7 @@ static const WCHAR szRollbackDisabled[] = {'R','o','l','l','b','a','c','k','D',' ...@@ -1177,6 +1177,7 @@ static const WCHAR szRollbackDisabled[] = {'R','o','l','l','b','a','c','k','D','
static const WCHAR szName[] = {'N','a','m','e',0}; static const WCHAR szName[] = {'N','a','m','e',0};
static const WCHAR szData[] = {'D','a','t','a',0}; static const WCHAR szData[] = {'D','a','t','a',0};
static const WCHAR szLangResource[] = {'\\','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 szLangResource[] = {'\\','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 szInstallLocation[] = {'I','n','s','t','a','l','l','L','o','c','a','t','i','o','n',0};
/* memory allocation macro functions */ /* memory allocation macro functions */
static void *msi_alloc( size_t len ) __WINE_ALLOC_SIZE(1); static void *msi_alloc( size_t len ) __WINE_ALLOC_SIZE(1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment