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

InstallShield does a number of actions using DoAction before the

Install starts so the PackageCode needs to be loaded on OpenPackage instead of the beginning of the install process.
parent 43319717
......@@ -441,7 +441,6 @@ UINT ACTION_DoTopLevelINSTALL(MSIPACKAGE *package, LPCWSTR szPackagePath,
static const WCHAR szUILevel[] = {'U','I','L','e','v','e','l',0};
static const WCHAR szAction[] = {'A','C','T','I','O','N',0};
static const WCHAR szInstall[] = {'I','N','S','T','A','L','L',0};
static const WCHAR szProductCode[]= {'P','r','o','d','u','c','t','C','o','d','e',0};
MSI_SetPropertyW(package, szAction, szInstall);
......@@ -452,8 +451,6 @@ UINT ACTION_DoTopLevelINSTALL(MSIPACKAGE *package, LPCWSTR szPackagePath,
package->msiFilePath= strdupW(msiFilePath);
package->ProductCode = load_dynamic_property(package,szProductCode,NULL);
if (szPackagePath)
{
LPWSTR p, check, path;
......
......@@ -408,6 +408,8 @@ UINT MSI_OpenPackageW(LPCWSTR szPackage, MSIPACKAGE **pPackage)
MSIDATABASE *db = NULL;
MSIPACKAGE *package;
MSIHANDLE handle;
DWORD size;
static const WCHAR szProductCode[]= {'P','r','o','d','u','c','t','C','o','d','e',0};
TRACE("%s %p\n", debugstr_w(szPackage), pPackage);
......@@ -445,6 +447,13 @@ UINT MSI_OpenPackageW(LPCWSTR szPackage, MSIPACKAGE **pPackage)
MSI_SetPropertyW( package, Database, szPackage );
}
/* this property must exist */
size = 0;
MSI_GetPropertyW(package,szProductCode,NULL,&size);
size ++;
package->ProductCode = HeapAlloc(GetProcessHeap(),0,size * sizeof(WCHAR));
MSI_GetPropertyW(package,szProductCode,package->ProductCode, &size);
*pPackage = package;
return ERROR_SUCCESS;
......
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