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.
This commit is contained in:
Aric Stewart 2005-07-08 14:19:00 +00:00 committed by Alexandre Julliard
parent 433197172d
commit b95beae8f9
2 changed files with 9 additions and 3 deletions

View File

@ -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;

View File

@ -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;