Commit adaef111 authored by Aric Stewart's avatar Aric Stewart Committed by Alexandre Julliard

Fill and use the ProductCode part of the MSIPACKAGE structure.

parent 0af6ae55
...@@ -40,7 +40,6 @@ static const WCHAR cszTargetDir[] = {'T','A','R','G','E','T','D','I','R',0}; ...@@ -40,7 +40,6 @@ static const WCHAR cszTargetDir[] = {'T','A','R','G','E','T','D','I','R',0};
static const WCHAR cszDatabase[]={'D','A','T','A','B','A','S','E',0}; static const WCHAR cszDatabase[]={'D','A','T','A','B','A','S','E',0};
const WCHAR cszSourceDir[] = {'S','o','u','r','c','e','D','i','r',0}; const WCHAR cszSourceDir[] = {'S','o','u','r','c','e','D','i','r',0};
const WCHAR szProductCode[]= {'P','r','o','d','u','c','t','C','o','d','e',0};
const WCHAR cszRootDrive[] = {'R','O','O','T','D','R','I','V','E',0}; const WCHAR cszRootDrive[] = {'R','O','O','T','D','R','I','V','E',0};
const WCHAR cszbs[]={'\\',0}; const WCHAR cszbs[]={'\\',0};
...@@ -88,10 +87,8 @@ DWORD build_version_dword(LPCWSTR version_string) ...@@ -88,10 +87,8 @@ DWORD build_version_dword(LPCWSTR version_string)
UINT build_icon_path(MSIPACKAGE *package, LPCWSTR icon_name, UINT build_icon_path(MSIPACKAGE *package, LPCWSTR icon_name,
LPWSTR *FilePath) LPWSTR *FilePath)
{ {
LPWSTR ProductCode;
LPWSTR SystemFolder; LPWSTR SystemFolder;
LPWSTR dest; LPWSTR dest;
UINT rc;
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','\\',
...@@ -99,20 +96,15 @@ UINT build_icon_path(MSIPACKAGE *package, LPCWSTR icon_name, ...@@ -99,20 +96,15 @@ UINT build_icon_path(MSIPACKAGE *package, LPCWSTR icon_name,
static const WCHAR szFolder[] = static const WCHAR szFolder[] =
{'A','p','p','D','a','t','a','F','o','l','d','e','r',0}; {'A','p','p','D','a','t','a','F','o','l','d','e','r',0};
ProductCode = load_dynamic_property(package,szProductCode,&rc);
if (!ProductCode)
return rc;
SystemFolder = load_dynamic_property(package,szFolder,NULL); SystemFolder = load_dynamic_property(package,szFolder,NULL);
dest = build_directory_name(3, SystemFolder, szInstaller, ProductCode); dest = build_directory_name(3, SystemFolder, szInstaller, package->ProductCode);
create_full_pathW(dest); create_full_pathW(dest);
*FilePath = build_directory_name(2, dest, icon_name); *FilePath = build_directory_name(2, dest, icon_name);
HeapFree(GetProcessHeap(),0,SystemFolder); HeapFree(GetProcessHeap(),0,SystemFolder);
HeapFree(GetProcessHeap(),0,ProductCode);
HeapFree(GetProcessHeap(),0,dest); HeapFree(GetProcessHeap(),0,dest);
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
...@@ -586,6 +578,7 @@ void ACTION_free_package_structures( MSIPACKAGE* package) ...@@ -586,6 +578,7 @@ void ACTION_free_package_structures( MSIPACKAGE* package)
HeapFree(GetProcessHeap(),0,package->PackagePath); HeapFree(GetProcessHeap(),0,package->PackagePath);
HeapFree(GetProcessHeap(),0,package->msiFilePath); HeapFree(GetProcessHeap(),0,package->msiFilePath);
HeapFree(GetProcessHeap(),0,package->ProductCode);
/* cleanup control event subscriptions */ /* cleanup control event subscriptions */
ControlEvent_CleanupSubscriptions(package); ControlEvent_CleanupSubscriptions(package);
...@@ -801,7 +794,6 @@ void reduce_to_shortfilename(WCHAR* filename) ...@@ -801,7 +794,6 @@ void reduce_to_shortfilename(WCHAR* filename)
LPWSTR create_component_advertise_string(MSIPACKAGE* package, LPWSTR create_component_advertise_string(MSIPACKAGE* package,
MSICOMPONENT* component, LPCWSTR feature) MSICOMPONENT* component, LPCWSTR feature)
{ {
LPWSTR productid=NULL;
GUID clsid; GUID clsid;
WCHAR productid_85[21]; WCHAR productid_85[21];
WCHAR component_85[21]; WCHAR component_85[21];
...@@ -820,8 +812,7 @@ LPWSTR create_component_advertise_string(MSIPACKAGE* package, ...@@ -820,8 +812,7 @@ LPWSTR create_component_advertise_string(MSIPACKAGE* package,
memset(productid_85,0,sizeof(productid_85)); memset(productid_85,0,sizeof(productid_85));
memset(component_85,0,sizeof(component_85)); memset(component_85,0,sizeof(component_85));
productid = load_dynamic_property(package,szProductCode,NULL); CLSIDFromString(package->ProductCode, &clsid);
CLSIDFromString(productid, &clsid);
encode_base85_guid(&clsid,productid_85); encode_base85_guid(&clsid,productid_85);
...@@ -847,8 +838,6 @@ LPWSTR create_component_advertise_string(MSIPACKAGE* package, ...@@ -847,8 +838,6 @@ LPWSTR create_component_advertise_string(MSIPACKAGE* package,
else else
sprintfW(output,fmt1,productid_85,feature); sprintfW(output,fmt1,productid_85,feature);
HeapFree(GetProcessHeap(),0,productid);
return output; return output;
} }
......
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