msi: load PackageCode in OpenPackage

Aric Stewart aric at codeweavers.com
Fri Jul 8 07:37:42 CDT 2005


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.
-------------- next part --------------
Index: dlls/msi/action.c
===================================================================
RCS file: /home/wine/wine/dlls/msi/action.c,v
retrieving revision 1.170
diff -u -r1.170 action.c
--- dlls/msi/action.c	7 Jul 2005 20:27:06 -0000	1.170
+++ dlls/msi/action.c	8 Jul 2005 12:36:16 -0000
@@ -441,7 +441,6 @@
     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);
 
@@ -451,8 +450,6 @@
     package->script->InWhatSequence = SEQUENCE_INSTALL;
 
     package->msiFilePath= strdupW(msiFilePath);
-
-    package->ProductCode = load_dynamic_property(package,szProductCode,NULL);
 
     if (szPackagePath)   
     {
Index: dlls/msi/package.c
===================================================================
RCS file: /home/wine/wine/dlls/msi/package.c,v
retrieving revision 1.44
diff -u -r1.44 package.c
--- dlls/msi/package.c	28 Jun 2005 19:14:30 -0000	1.44
+++ dlls/msi/package.c	8 Jul 2005 12:36:16 -0000
@@ -408,6 +408,8 @@
     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 @@
         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;


More information about the wine-patches mailing list