Commit 75658d7a authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

Make build_icon_path return the path directly.

parent 9f1c6de1
...@@ -2815,12 +2815,12 @@ static UINT ITERATE_CreateShortcuts(MSIRECORD *row, LPVOID param) ...@@ -2815,12 +2815,12 @@ static UINT ITERATE_CreateShortcuts(MSIRECORD *row, LPVOID param)
if (!MSI_RecordIsNull(row,9)) if (!MSI_RecordIsNull(row,9))
{ {
WCHAR *Path = NULL; LPWSTR Path;
INT index; INT index;
buffer = MSI_RecordGetString(row,9); buffer = MSI_RecordGetString(row,9);
build_icon_path(package,buffer,&Path); Path = build_icon_path(package,buffer);
index = MSI_RecordGetInteger(row,10); index = MSI_RecordGetInteger(row,10);
IShellLinkW_SetIconLocation(sl,Path,index); IShellLinkW_SetIconLocation(sl,Path,index);
...@@ -2885,8 +2885,8 @@ static UINT ITERATE_PublishProduct(MSIRECORD *row, LPVOID param) ...@@ -2885,8 +2885,8 @@ static UINT ITERATE_PublishProduct(MSIRECORD *row, LPVOID param)
{ {
MSIPACKAGE* package = (MSIPACKAGE*)param; MSIPACKAGE* package = (MSIPACKAGE*)param;
HANDLE the_file; HANDLE the_file;
LPWSTR FilePath=NULL; LPWSTR FilePath;
LPCWSTR FileName=NULL; LPCWSTR FileName;
CHAR buffer[1024]; CHAR buffer[1024];
DWORD sz; DWORD sz;
UINT rc; UINT rc;
...@@ -2898,7 +2898,7 @@ static UINT ITERATE_PublishProduct(MSIRECORD *row, LPVOID param) ...@@ -2898,7 +2898,7 @@ static UINT ITERATE_PublishProduct(MSIRECORD *row, LPVOID param)
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
build_icon_path(package,FileName,&FilePath); FilePath = build_icon_path(package,FileName);
TRACE("Creating icon file at %s\n",debugstr_w(FilePath)); TRACE("Creating icon file at %s\n",debugstr_w(FilePath));
...@@ -2995,9 +2995,9 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package) ...@@ -2995,9 +2995,9 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package)
buffer = msi_dup_property( package, szARPProductIcon ); buffer = msi_dup_property( package, szARPProductIcon );
if (buffer) if (buffer)
{ {
LPWSTR path; LPWSTR path = build_icon_path(package,buffer);
build_icon_path(package,buffer,&path);
msi_reg_set_val_str( hukey, INSTALLPROPERTY_PRODUCTICONW, path ); msi_reg_set_val_str( hukey, INSTALLPROPERTY_PRODUCTICONW, path );
msi_free( path );
} }
msi_free(buffer); msi_free(buffer);
......
...@@ -260,7 +260,7 @@ extern MSIFILE *get_loaded_file( MSIPACKAGE* package, LPCWSTR file ); ...@@ -260,7 +260,7 @@ extern MSIFILE *get_loaded_file( MSIPACKAGE* package, LPCWSTR file );
extern MSIFOLDER *get_loaded_folder( MSIPACKAGE *package, LPCWSTR dir ); extern MSIFOLDER *get_loaded_folder( MSIPACKAGE *package, LPCWSTR dir );
extern int track_tempfile(MSIPACKAGE *package, LPCWSTR name, LPCWSTR path); extern int track_tempfile(MSIPACKAGE *package, LPCWSTR name, LPCWSTR path);
extern UINT schedule_action(MSIPACKAGE *package, UINT script, LPCWSTR action); extern UINT schedule_action(MSIPACKAGE *package, UINT script, LPCWSTR action);
extern UINT build_icon_path(MSIPACKAGE *, LPCWSTR, LPWSTR *); extern LPWSTR build_icon_path(MSIPACKAGE *, LPCWSTR);
extern DWORD build_version_dword(LPCWSTR); extern DWORD build_version_dword(LPCWSTR);
extern LPWSTR build_directory_name(DWORD , ...); extern LPWSTR build_directory_name(DWORD , ...);
extern BOOL create_full_pathW(const WCHAR *path); extern BOOL create_full_pathW(const WCHAR *path);
......
...@@ -153,7 +153,7 @@ static MSIPROGID *load_progid( MSIPACKAGE* package, MSIRECORD *row ) ...@@ -153,7 +153,7 @@ static MSIPROGID *load_progid( MSIPACKAGE* package, MSIRECORD *row )
LPWSTR FilePath; LPWSTR FilePath;
static const WCHAR fmt[] = {'%','s',',','%','i',0}; static const WCHAR fmt[] = {'%','s',',','%','i',0};
build_icon_path(package,FileName,&FilePath); FilePath = build_icon_path(package,FileName);
progid->IconPath = msi_alloc( (strlenW(FilePath)+10)* sizeof(WCHAR) ); progid->IconPath = msi_alloc( (strlenW(FilePath)+10)* sizeof(WCHAR) );
...@@ -166,7 +166,7 @@ static MSIPROGID *load_progid( MSIPACKAGE* package, MSIRECORD *row ) ...@@ -166,7 +166,7 @@ static MSIPROGID *load_progid( MSIPACKAGE* package, MSIRECORD *row )
{ {
buffer = MSI_RecordGetString(row,5); buffer = MSI_RecordGetString(row,5);
if (buffer) if (buffer)
build_icon_path(package,buffer,&(progid->IconPath)); progid->IconPath = build_icon_path(package,buffer);
} }
progid->CurVer = NULL; progid->CurVer = NULL;
...@@ -260,7 +260,7 @@ static MSICLASS *load_class( MSIPACKAGE* package, MSIRECORD *row ) ...@@ -260,7 +260,7 @@ static MSICLASS *load_class( MSIPACKAGE* package, MSIRECORD *row )
LPWSTR FilePath; LPWSTR FilePath;
static const WCHAR fmt[] = {'%','s',',','%','i',0}; static const WCHAR fmt[] = {'%','s',',','%','i',0};
build_icon_path(package,FileName,&FilePath); FilePath = build_icon_path(package,FileName);
cls->IconPath = msi_alloc( (strlenW(FilePath)+5)* sizeof(WCHAR) ); cls->IconPath = msi_alloc( (strlenW(FilePath)+5)* sizeof(WCHAR) );
...@@ -273,7 +273,7 @@ static MSICLASS *load_class( MSIPACKAGE* package, MSIRECORD *row ) ...@@ -273,7 +273,7 @@ static MSICLASS *load_class( MSIPACKAGE* package, MSIRECORD *row )
{ {
buffer = MSI_RecordGetString(row,8); buffer = MSI_RecordGetString(row,8);
if (buffer) if (buffer)
build_icon_path(package,buffer,&(cls->IconPath)); cls->IconPath = build_icon_path(package,buffer);
} }
if (!MSI_RecordIsNull(row,10)) if (!MSI_RecordIsNull(row,10))
...@@ -300,8 +300,7 @@ static MSICLASS *load_class( MSIPACKAGE* package, MSIRECORD *row ) ...@@ -300,8 +300,7 @@ static MSICLASS *load_class( MSIPACKAGE* package, MSIRECORD *row )
} }
else else
{ {
cls->DefInprocHandler32 = load_dynamic_stringW( cls->DefInprocHandler32 = load_dynamic_stringW( row, 10);
row, 10);
reduce_to_longfilename(cls->DefInprocHandler32); reduce_to_longfilename(cls->DefInprocHandler32);
} }
} }
......
...@@ -84,11 +84,9 @@ DWORD build_version_dword(LPCWSTR version_string) ...@@ -84,11 +84,9 @@ DWORD build_version_dword(LPCWSTR version_string)
return rc; return rc;
} }
UINT build_icon_path(MSIPACKAGE *package, LPCWSTR icon_name, LPWSTR build_icon_path(MSIPACKAGE *package, LPCWSTR icon_name )
LPWSTR *FilePath)
{ {
LPWSTR SystemFolder; LPWSTR SystemFolder, dest, FilePath;
LPWSTR dest;
static const WCHAR szInstaller[] = static const WCHAR szInstaller[] =
{'M','i','c','r','o','s','o','f','t','\\', {'M','i','c','r','o','s','o','f','t','\\',
...@@ -102,11 +100,11 @@ UINT build_icon_path(MSIPACKAGE *package, LPCWSTR icon_name, ...@@ -102,11 +100,11 @@ UINT build_icon_path(MSIPACKAGE *package, LPCWSTR icon_name,
create_full_pathW(dest); create_full_pathW(dest);
*FilePath = build_directory_name(2, dest, icon_name); FilePath = build_directory_name(2, dest, icon_name);
msi_free(SystemFolder); msi_free(SystemFolder);
msi_free(dest); msi_free(dest);
return ERROR_SUCCESS; return FilePath;
} }
WCHAR *load_dynamic_stringW(MSIRECORD *row, INT index) WCHAR *load_dynamic_stringW(MSIRECORD *row, INT index)
......
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