Sync to Wine-20050211
Mike McCormack <mike@codeweavers.com>
- add support for Edit boxes in MSI dialogs
- run the message loop when waiting for threads or processes
- fix the dialog font
- allow waiting on a handle while running the message loop
- implement checkboxes in dialogs
- use TextStyle enumeration instead of numbers
- fix MSI_IterateRecords to return the correct count
- Add more dialog controls, do something when they're clicked on.
- Implement MsiPreviewDialog.
- Implement and document MsiLoadString.
- Added stub implementations for MsiPreviewDialog and
  MsiPreviewBillboard.
- Fix MsiModifyView and MsiViewGetColumnInfo to use MSIRECORD* not MSIHANDLE.
- Implement, test and document MsiDecomposeDescriptor.
- Handle a number as a parameter for custom action 19.
- Move OpenQuery into msiquery.c and make it non-static.
- Fix and test inserting records.
- Fix refcounting, use Interlocked functions.
- MsiEvaluateCondition returns an error when passed NULL as a
  condition.
- Lock record in MsiViewExecute, move stubs to end.
- Fix MsiRecordSetString for NULL strings and update test case.
- Fix a bug caused by freeing memory too soon in the table code.
- Update headers, add MsiGetUserInfoA stub implementation.
- Fix a memory leak in MsiConfigureProductExW.
- Indentation and style cleanup.
- implement MsiOpenPackageEx, and forward MsiOpenPackage there
- make a MSI_CreatePackage function and use it in MSI_OpenPackage
- move MsiOpenPackageA down with the rest of the API functions
Juan Lang <juan_lang@yahoo.com>
- Partially implement AppSearch action.
- If a full path isn't specified, search across all fixed drives.
- Simplify AppSearch error checking.
- Identifiers evaluate to true if they are non-empty, regardless of
  value.
Aric Stewart <aric@codeweavers.com>
- action.c is getting too big, so split out all the handling of
  CustomActions into custom.c. Cleaned up a lot of the handling of
  custom actions including scripting actions and processing return
  codes.
- Mike McCormack pointed out that MsiFormatRecord is basically the
  same as internal function deformat_string. So broke deformat_string
  out and updated it to function as MsiFormatRecord and implemented
  MsiFormatRecord.
- A number of random fixes to action.c including properly calculating
  the length for the LocalPackage name, not forcing a reboot when
  really we should just return ERROR_INSTALL_SUSPEND and handling
  REG_MULTI_SZ now that we can deformat the properly.
- Move the guid squishing functions out of msi.c and make a new
  registry.c file. Also clean up all the various registry keys we need
  to open and create to this module and modify the functions for msi.c
  to call these functions.
- Added a few more stub implementations.
- Implement custom action type 19, Halt install and display error
  message.
- Continued work to simplify the ProcessAction call, also split it into
  a ProcessAction and ProcessUIAction for future dialog box work.
  Also fix a bug in deformat_string where i was not freeing the created
  record.
- Make a temp file for each dll saved for custom actions. This prevents
  name collisions from causing custom actions to fail.
- Do not track the temp files for custom actions based on the name from
  the table because then we get conflicts and files not tracked or
  cleaned up.
- Add the RegisterUser action.
- Implement RegisterExtensionInfo and RegisterMIMEInfo.
- Add logic to be able to resolve the SourceDir based on
  CurrentPath. Also add logic to get the source locations of a file if
  it is not in a cabinet.
- Finish up the framework by stubbing out all the remaining Standard
  actions.
- A fix to deformat_string so it only returns a null return if you
  provided a null buffer.
- Eliminate the giant if.. else if block from ACTION_ProcessAction in
  favor of a table of handlers.
- Return code of the install should not depend on the return code of the
  final action.
- Update component installed states as they are installed so that
  conditions based on component states are at least a little more
  correct.
- Add icon and argument when regestering clsids.
- Add a stub for ResolveSource because we do that work just not in
  ResolveSource like we should.
- When quering a Component state return the correct state.
- Enable the updating of Feature and thus the resulting component
  states.
- Run the end of install actions for suspend and user exit states as
  well.
- Start putting in place a currently running state for future ui use.
- Use the new registry functions in registry.c.
- Do not force a reboot, just return ERROR_INSTALL_SUSPEND and write
  some keys to the registry.
- Quite a few fixes:
- Allow for the queing of custom actions to trigger on the
  InstallExecute or InstallExecuteAgain actions.
- allow for the queing of custom actions to trigger on
  InstallFinalize.
- Properly set the CustomActionData property for said queued actions.
- Implement RegisterProduct.
- Beginning implementation of ForceReboot.
- Don't kill install if an item to be duplicated does not exist.
- Write out SourceList and LastUsedSource for resuming installs.
- Use regsvr32 to register self reg dlls.
- Implementations for SelfRegModules and PublishFeatures.
- Set default ACTION property for Install.
- Deformat more than JUST properties properly. Allows for Files and
  Component paths in deformat.
- Properly deformat a LaunchCondition failure dialog box.
- Resolve and save registry Keypaths.
- Write the Features published keys more correctly. Still some
  problems.
- First implementation of the WriteIniValues action.
- Custom actions can have null in their target parameters, handle that
  without crashing. Also enable deformating of lines greater than 256
  characters.
- Added some more suminfo stubs.
- An implementation of MsiSummaryInfoGetPropertyW based off of
  MsiSummaryInfoGetPropertyA.
- Added stubs for MsiGetShortcutTargetA/W.
- Do a very basic first implementation of MsiConfigureProductExW for
  msiexec /@  when run as a reboot.
- Also add a number of new stubs for the office xp and 2k3 install and
  startup process.
- Fix a copy and paste error, check for a null value and discard
  unneeded errors.
- Do not limit properties to 256 characters when evaluating them.
- Setting a record to an empty string is the same as making it null.
- First pass implement ion of MsiQueryProductState[A/W] as well as a few
  fixes for MsiGetComponentPath.
- Actually start on an implemention for MsiGetComponentPathW that should
  handle all keypaths that are files.
- A reworking of format.c to remove the recursion, clean things up and
  stabilize behavior to match windows.
- Cleanup processing a bit more.
- Allow for nested keys to work properly.
- MsiGetProperty does not return any error on missing properties.
- The new Insert fixes now properly require ?,? instead of just ? for
  the Insert call. This fix modifies the MSI_SetProperty query to be
  correct.
Michael Stefaniuc <mstefani@redhat.de>
- Do not check for non NULL pointer before HeapFree'ing it. It's
  redundant.
Francois Gouget <fgouget@free.fr>
- Assorted spelling fixes.
Ulrich Czekalla <ulrich@codeweavers.com>
- Handle 0 length buffers in MSI_FormatRecordW.
- Remove unused buffer in deformat_string.
Mike Hearn <mh@codeweavers.com>
- Correctly ensure properties set from resolved directory paths are
  backslash terminated.
Francois Gouget <fgouget@free.fr>
- Assorted spelling fixes.
Marcus Meissner <meissner@suse.de>
- Initialize rc in create_component_directory().
Alexandre Julliard <julliard@winehq.org>
- Avoid unnecessary run-time initializations.
Modified: trunk/reactos/include/wine/msi.h
Added: trunk/reactos/include/wine/msidefs.h
Modified: trunk/reactos/lib/msi/Makefile.in
Modified: trunk/reactos/lib/msi/action.c
Added: trunk/reactos/lib/msi/action.h
Added: trunk/reactos/lib/msi/appsearch.c
Modified: trunk/reactos/lib/msi/cond.tab.c
Modified: trunk/reactos/lib/msi/cond.tab.h
Modified: trunk/reactos/lib/msi/cond.y
Modified: trunk/reactos/lib/msi/create.c
Added: trunk/reactos/lib/msi/custom.c
Added: trunk/reactos/lib/msi/dialog.c
Modified: trunk/reactos/lib/msi/distinct.c
Added: trunk/reactos/lib/msi/format.c
Modified: trunk/reactos/lib/msi/handle.c
Modified: trunk/reactos/lib/msi/insert.c
Modified: trunk/reactos/lib/msi/msi.c
Added: trunk/reactos/lib/msi/msi.rc
Modified: trunk/reactos/lib/msi/msi.spec
Added: trunk/reactos/lib/msi/msi_En.rc
Modified: trunk/reactos/lib/msi/msipriv.h
Modified: trunk/reactos/lib/msi/msiquery.c
Modified: trunk/reactos/lib/msi/order.c
Modified: trunk/reactos/lib/msi/package.c
Added: trunk/reactos/lib/msi/preview.c
Modified: trunk/reactos/lib/msi/record.c
Added: trunk/reactos/lib/msi/registry.c
Modified: trunk/reactos/lib/msi/select.c
Modified: trunk/reactos/lib/msi/sql.tab.c
Modified: trunk/reactos/lib/msi/sql.y
Modified: trunk/reactos/lib/msi/string.c
Modified: trunk/reactos/lib/msi/suminfo.c
Modified: trunk/reactos/lib/msi/table.c
Modified: trunk/reactos/lib/msi/update.c
Modified: trunk/reactos/lib/msi/where.c

Modified: trunk/reactos/include/wine/msi.h
--- trunk/reactos/include/wine/msi.h	2005-02-12 21:46:45 UTC (rev 13517)
+++ trunk/reactos/include/wine/msi.h	2005-02-12 22:59:04 UTC (rev 13518)
@@ -55,6 +55,15 @@
     INSTALLUILEVEL_SOURCERESONLY = 0x100
 } INSTALLUILEVEL;
 
+typedef enum tagUSERINFOSTATE
+{
+    USERINFOSTATE_MOREDATA = -3,
+    USERINFOSTATE_INVALIDARG = -2,
+    USERINFOSTATE_UNKNOWN = -1,
+    USERINFOSTATE_ABSENT = 0,
+    USERINFOSTATE_PRESENT = 1,
+} USERINFOSTATE;
+
 typedef enum tagINSTALLLEVEL
 {
     INSTALLLEVEL_DEFAULT = 0,
@@ -137,15 +146,17 @@
 
 #define MAX_FEATURE_CHARS 38
 
-typedef INT (CALLBACK *INSTALLUI_HANDLERA)(LPVOID pvContext, UINT iMessageType,
-                                       LPCSTR szMessage);
-typedef INT (CALLBACK *INSTALLUI_HANDLERW)(LPVOID pvContext, UINT iMessageType,
-                                       LPCWSTR szMessage);
+typedef INT (CALLBACK *INSTALLUI_HANDLERA)(LPVOID, UINT, LPCSTR);
+typedef INT (CALLBACK *INSTALLUI_HANDLERW)(LPVOID, UINT, LPCWSTR);
 
 UINT WINAPI MsiAdvertiseProductA(LPCSTR, LPCSTR, LPCSTR, LANGID);
 UINT WINAPI MsiAdvertiseProductW(LPCWSTR, LPCWSTR, LPCWSTR, LANGID);
 #define     MsiAdvertiseProduct WINELIB_NAME_AW(MsiAdvertiseProduct)
 
+UINT WINAPI MsiAdvertiseProductExA(LPCSTR, LPCSTR, LPCSTR, LANGID, DWORD, DWORD);
+UINT WINAPI MsiAdvertiseProductExW(LPCWSTR, LPCWSTR, LPCWSTR, LANGID, DWORD, DWORD);
+#define     MsiAdvertiseProductEx WINELIB_NAME_AW(MsiAdvertiseProductEx)
+
 UINT WINAPI MsiInstallProductA(LPCSTR, LPCSTR);
 UINT WINAPI MsiInstallProductW(LPCWSTR, LPCWSTR);
 #define     MsiInstallProduct WINELIB_NAME_AW(MsiInstallProduct)
@@ -158,8 +169,8 @@
 UINT WINAPI MsiApplyPatchW(LPCWSTR, LPCWSTR, INSTALLTYPE, LPCWSTR);
 #define     MsiApplyPatch WINELIB_NAME_AW(MsiApplyPatch)
 
-UINT WINAPI MsiEnumProductsA(DWORD index, LPSTR lpguid);
-UINT WINAPI MsiEnumProductsW(DWORD index, LPWSTR lpguid);
+UINT WINAPI MsiEnumProductsA(DWORD, LPSTR);
+UINT WINAPI MsiEnumProductsW(DWORD, LPWSTR);
 #define     MsiEnumProducts WINELIB_NAME_AW(MsiEnumProducts)
 
 UINT WINAPI MsiEnumFeaturesA(LPCSTR, DWORD, LPSTR, LPSTR);
@@ -198,6 +209,12 @@
 UINT WINAPI MsiSummaryInfoGetPropertyW(MSIHANDLE,UINT,UINT*,INT*,FILETIME*,LPWSTR,DWORD*);
 #define     MsiSummaryInfoGetProperty WINELIB_NAME_AW(MsiSummaryInfoGetProperty)
 
+UINT WINAPI MsiSummaryInfoPersist(MSIHANDLE);
+
+UINT WINAPI MsiSummaryInfoSetPropertyA(MSIHANDLE, UINT, UINT, INT, FILETIME*, LPSTR);
+UINT WINAPI MsiSummaryInfoSetPropertyW(MSIHANDLE, UINT, UINT, INT, FILETIME*, LPWSTR);
+#define     MsiSummaryInfoSetProperty WINELIB_NAME_AW(MsiSummaryInfoSetProperty)
+
 UINT WINAPI MsiProvideComponentFromDescriptorA(LPCSTR,LPSTR,DWORD*,DWORD*);
 UINT WINAPI MsiProvideComponentFromDescriptorW(LPCWSTR,LPWSTR,DWORD*,DWORD*);
 #define     MsiProvideComponentFromDescriptor WINELIB_NAME_AW(MsiProvideComponentFromDescriptor)
@@ -218,20 +235,24 @@
 INSTALLSTATE WINAPI MsiQueryProductStateW(LPCWSTR);
 #define      MsiQueryProductState WINELIB_NAME_AW(MsiQueryProductState)
 
-UINT WINAPI MsiConfigureProductA(LPCSTR szProduct, int iInstallLevel, INSTALLSTATE eInstallState);
-UINT WINAPI MsiConfigureProductW(LPCWSTR szProduct, int iInstallLevel, INSTALLSTATE eInstallState);
+UINT WINAPI MsiConfigureProductA(LPCSTR, int, INSTALLSTATE);
+UINT WINAPI MsiConfigureProductW(LPCWSTR, int, INSTALLSTATE);
 #define     MsiConfigureProduct WINELIB_NAME_AW(MsiConfigureProduct);
 
-UINT WINAPI MsiGetProductCodeA(LPCSTR szComponent, LPSTR szBuffer);
-UINT WINAPI MsiGetProductCodeW(LPCWSTR szComponent, LPWSTR szBuffer);
+UINT WINAPI MsiConfigureProductExA(LPCSTR, int, INSTALLSTATE, LPCSTR);
+UINT WINAPI MsiConfigureProductExW(LPCWSTR, int, INSTALLSTATE, LPCWSTR);
+#define     MsiConfigureProductEx WINELIB_NAME_AW(MsiConfigureProductEx);
+
+UINT WINAPI MsiGetProductCodeA(LPCSTR, LPSTR);
+UINT WINAPI MsiGetProductCodeW(LPCWSTR, LPWSTR);
 #define     MsiGetProductCode WINELIB_NAME_AW(MsiGetProductCode)
 
-UINT WINAPI MsiGetProductInfoA(LPCSTR szProduct, LPCSTR szAttribute, LPSTR szBuffer, DWORD *pcchValueBuf);
-UINT WINAPI MsiGetProductInfoW(LPCWSTR szProduct, LPCWSTR szAttribute, LPWSTR szBuffer, DWORD *pcchValueBuf);
+UINT WINAPI MsiGetProductInfoA(LPCSTR, LPCSTR, LPSTR, DWORD *);
+UINT WINAPI MsiGetProductInfoW(LPCWSTR, LPCWSTR, LPWSTR, DWORD *);
 #define     MsiGetProductInfo WINELIB_NAME_AW(MsiGetProductInfo)
 
-UINT WINAPI MsiEnableLogA(DWORD dwLogMode, LPCSTR szLogFile, DWORD attributes);
-UINT WINAPI MsiEnableLogW(DWORD dwLogMode, LPCWSTR szLogFile, DWORD attributes);
+UINT WINAPI MsiEnableLogA(DWORD, LPCSTR, DWORD);
+UINT WINAPI MsiEnableLogW(DWORD, LPCWSTR, DWORD);
 #define     MsiEnableLog WINELIB_NAME_AW(MsiEnableLog)
 
 INSTALLUI_HANDLERA WINAPI MsiSetExternalUIA(INSTALLUI_HANDLERA, DWORD, LPVOID);
@@ -242,15 +263,53 @@
 INSTALLSTATE WINAPI MsiGetComponentPathW(LPCWSTR, LPCWSTR, LPWSTR, DWORD*);
 #define MsiGetComponentPath WINELIB_NAME_AW(MsiGetComponentPath)
 
-INSTALLSTATE WINAPI MsiQueryFeatureStateA(LPCSTR szProduct, LPCSTR szFeature);
-INSTALLSTATE WINAPI MsiQueryFeatureStateW(LPCWSTR szProduct, LPCWSTR szFeature);
+INSTALLSTATE WINAPI MsiQueryFeatureStateA(LPCSTR, LPCSTR);
+INSTALLSTATE WINAPI MsiQueryFeatureStateW(LPCWSTR, LPCWSTR);
 #define MsiQueryFeatureState WINELIB_NAME_AW(MsiQueryFeatureState)
 
-/**
- * Non Unicode
- */
+UINT WINAPI MsiGetFeatureUsageA(LPCSTR, LPCSTR, DWORD*, WORD*);
+UINT WINAPI MsiGetFeatureUsageW(LPCWSTR, LPCWSTR, DWORD*, WORD*);
+#define MsiGetFeatureUsage WINELIB_NAME_AW(MsiGetFeatureUsage)
+
+UINT WINAPI MsiEnumRelatedProductsA(LPCSTR, DWORD, DWORD, LPSTR);
+UINT WINAPI MsiEnumRelatedProductsW(LPCWSTR, DWORD, DWORD, LPWSTR);
+#define MsiEnumRelatedProducts WINELIB_NAME_AW(MsiEnumRelatedProducts)
+
+UINT WINAPI MsiProvideAssemblyA(LPCSTR, LPCSTR, DWORD, DWORD, LPSTR, DWORD*);
+UINT WINAPI MsiProvideAssemblyW(LPCWSTR, LPCWSTR, DWORD, DWORD, LPWSTR, DWORD*);
+#define MsiProvideAssembly WINELIB_NAME_AW(MsiProvideAssembly)
+
+UINT WINAPI MsiEnumComponentQualifiersA(LPSTR, DWORD, LPSTR, DWORD*, LPSTR, DWORD*);
+UINT WINAPI MsiEnumComponentQualifiersW(LPWSTR, DWORD, LPWSTR, DWORD*, LPWSTR, DWORD*);
+#define MsiEnumComponentQualifiers WINELIB_NAME_AW(MsiEnumComponentQualifiers)
+
+UINT WINAPI MsiGetFileVersionA(LPCSTR, LPSTR, DWORD*, LPSTR, DWORD*);
+UINT WINAPI MsiGetFileVersionW(LPCWSTR, LPWSTR, DWORD*, LPWSTR, DWORD*);
+#define MsiGetFileVersion WINELIB_NAME_AW(MsiGetFileVersion)
+
+UINT WINAPI MsiMessageBoxA(HWND, LPCSTR, LPCSTR, UINT, WORD, DWORD);
+UINT WINAPI MsiMessageBoxW(HWND, LPCWSTR, LPCWSTR, UINT, WORD, DWORD);
+#define MsiMessageBox WINELIB_NAME_AW(MsiMessageBox)
+
+UINT WINAPI MsiProvideQualifiedComponentExA(LPCSTR, LPCSTR, DWORD, LPSTR, DWORD, DWORD, LPSTR, DWORD*);
+UINT WINAPI MsiProvideQualifiedComponentExW(LPCWSTR, LPCWSTR, DWORD, LPWSTR, DWORD, DWORD, LPWSTR, DWORD*);
+#define MsiProvideQualifiedComponentEx WINELIB_NAME_AW(MsiProvideQualifiedComponentEx)
+
+UINT WINAPI MsiProvideQualifiedComponentA(LPCSTR, LPCSTR, DWORD, LPSTR, DWORD*);
+UINT WINAPI MsiProvideQualifiedComponentW(LPCWSTR, LPCWSTR, DWORD, LPWSTR, DWORD*);
+#define MsiProvideQualifiedComponent WINELIB_NAME_AW(MsiProvideQualifiedComponent)
+
+USERINFOSTATE WINAPI MsiGetUserInfoA(LPCSTR, LPSTR, DWORD*, LPSTR, DWORD*, LPSTR, DWORD*);
+USERINFOSTATE WINAPI MsiGetUserInfoW(LPCWSTR, LPWSTR, DWORD*, LPWSTR, DWORD*, LPWSTR, DWORD*);
+#define MsiGetUserInfo WINELIB_NAME_AW(MsiGetUserInfo)
+
+UINT WINAPI MsiCollectUserInfoA( LPCSTR );
+UINT WINAPI MsiCollectUserInfoW( LPCWSTR );
+#define MsiCollectUserInfo WINELIB_NAME_AW(MsiCollectUserInfo)
+
+/* Non Unicode */
 UINT WINAPI MsiCloseHandle(MSIHANDLE);
-UINT WINAPI MsiCloseAllHandles();
+UINT WINAPI MsiCloseAllHandles(void);
 INSTALLUILEVEL WINAPI MsiSetInternalUI(INSTALLUILEVEL, HWND*);
 
 #ifdef __cplusplus

Added: trunk/reactos/include/wine/msidefs.h
--- trunk/reactos/include/wine/msidefs.h	2005-02-12 21:46:45 UTC (rev 13517)
+++ trunk/reactos/include/wine/msidefs.h	2005-02-12 22:59:04 UTC (rev 13518)
@@ -0,0 +1,96 @@
+/*
+ * Copyright (C) 2005 Mike McCormack
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef __WINE_MSIDEFS_H
+#define __WINE_MSIDEFS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum msidbDialogAttributes {
+    msidbDialogAttributesVisible = 0x00000001,
+    msidbDialogAttributesModal = 0x00000002,
+    msidbDialogAttributesMinimize = 0x00000004,
+    msidbDialogAttributesSysModal = 0x00000008,
+    msidbDialogAttributesKeepModeless = 0x00000010,
+    msidbDialogAttributesTrackDiskSpace = 0x00000020,
+    msidbDialogAttributesUseCustomPalette = 0x00000040,
+    msidbDialogAttributesRTLRO = 0x00000080,
+    msidbDialogAttributesRightAligned = 0x00000100,
+    msidbDialogAttributesLeftScroll = 0x00000200,
+    msidbDialogAttributesBidi = 0x00000380,
+    msidbDialogAttributesError = 0x00010000
+};
+
+enum msidbTextStyleStyleBits
+{
+    msidbTextStyleStyleBitsBold = 0x00000001,
+    msidbTextStyleStyleBitsItalic = 0x00000002,
+    msidbTextStyleStyleBitsUnderline = 0x00000004,
+    msidbTextStyleStyleBitsStrike = 0x00000008,
+};
+
+enum msidbCustomActionType
+{
+    msidbCustomActionTypeDll = 0x00000001,
+    msidbCustomActionTypeExe = 0x00000002,
+    msidbCustomActionTypeTextData = 0x00000003,
+    msidbCustomActionTypeJScript = 0x00000005,
+    msidbCustomActionTypeVBScript = 0x00000006,
+    msidbCustomActionTypeInstall = 0x00000007,
+
+    msidbCustomActionTypeBinaryData = 0x00000000,
+    msidbCustomActionTypeSourceFile = 0x00000010,
+    msidbCustomActionTypeDirectory = 0x00000020,
+    msidbCustomActionTypeProperty = 0x00000030,
+
+    msidbCustomActionTypeContinue = 0x00000040,
+    msidbCustomActionTypeAsync = 0x00000080,
+
+    msidbCustomActionTypeFirstSequence = 0x00000100,
+    msidbCustomActionTypeOncePerProcess = 0x00000200,
+    msidbCustomActionTypeClientRepeat = 0x00000300,
+    msidbCustomActionTypeInScript = 0x00000400,
+
+    msidbCustomActionTypeRollback = 0x00000100,
+    msidbCustomActionTypeCommit = 0x00000200,
+
+    msidbCustomActionTypeNoImpersonate = 0x00000800,
+    msidbCustomActionTypeTSAware = 0x00004000,
+
+    msidbCustomActionType64BitScript = 0x00001000,
+    msidbCustomActionTypeHideTarget = 0x00002000
+};
+
+enum msidbFeatureAttributes
+{
+    msidbFeatureAttributesFavorLocal = 0x00000000,
+    msidbFeatureAttributesFavorSource = 0x00000001,
+    msidbFeatureAttributesFollowParent = 0x00000002,
+    msidbFeatureAttributesFavorAdvertise = 0x00000004,
+    msidbFeatureAttributesDisallowAdvertise = 0x00000008,
+    msidbFeatureAttributesUIDisallowAbsent = 0x00000010,
+    msidbFeatureAttributesNoUnsupportedAdvertise = 0x00000020
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __WINE_MSIDEFS_H */
Property changes on: trunk/reactos/include/wine/msidefs.h
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Modified: trunk/reactos/lib/msi/Makefile.in
--- trunk/reactos/lib/msi/Makefile.in	2005-02-12 21:46:45 UTC (rev 13517)
+++ trunk/reactos/lib/msi/Makefile.in	2005-02-12 22:59:04 UTC (rev 13518)
@@ -8,15 +8,21 @@
 
 C_SRCS = \
 	action.c \
+	appsearch.c \
 	create.c \
+	custom.c \
+	dialog.c \
 	distinct.c \
+	format.c \
 	handle.c \
 	insert.c \
 	msi.c \
 	msiquery.c \
 	order.c \
 	package.c \
+	preview.c \
 	record.c \
+	registry.c \
 	regsvr.c \
 	select.c \
 	string.c \
@@ -26,7 +32,7 @@
 	update.c \
 	where.c
 
-RC_SRCS = version.rc
+RC_SRCS = msi.rc
 
 EXTRA_SRCS = sql.y cond.y
 EXTRA_OBJS = sql.tab.o cond.tab.o

Modified: trunk/reactos/lib/msi/action.c
--- trunk/reactos/lib/msi/action.c	2005-02-12 21:46:45 UTC (rev 13517)
+++ trunk/reactos/lib/msi/action.c	2005-02-12 22:59:04 UTC (rev 13518)
@@ -49,100 +49,27 @@
 #include "shlobj.h"
 #include "wine/unicode.h"
 #include "ver.h"
+#include "action.h"
 
-#define CUSTOM_ACTION_TYPE_MASK 0x3F
 #define REG_PROGRESS_VALUE 13200
 #define COMPONENT_PROGRESS_VALUE 24000
 
 WINE_DEFAULT_DEBUG_CHANNEL(msi);
 
-typedef struct tagMSIFEATURE
-{
-    WCHAR Feature[96];
-    WCHAR Feature_Parent[96];
-    WCHAR Title[0x100];
-    WCHAR Description[0x100];
-    INT Display;
-    INT Level;
-    WCHAR Directory[96];
-    INT Attributes;
-    
-    INSTALLSTATE Installed;
-    INSTALLSTATE ActionRequest;
-    INSTALLSTATE Action;
-
-    INT ComponentCount;
-    INT Components[1024]; /* yes hardcoded limit.... I am bad */
-    INT Cost;
-} MSIFEATURE;
-
-typedef struct tagMSICOMPONENT
-{
-    WCHAR Component[96];
-    WCHAR ComponentId[96];
-    WCHAR Directory[96];
-    INT Attributes;
-    WCHAR Condition[0x100];
-    WCHAR KeyPath[96];
-
-    INSTALLSTATE Installed;
-    INSTALLSTATE ActionRequest;
-    INSTALLSTATE Action;
-
-    BOOL Enabled;
-    INT  Cost;
-} MSICOMPONENT;
-
-typedef struct tagMSIFOLDER
-{
-    LPWSTR Directory;
-    LPWSTR TargetDefault;
-    LPWSTR SourceDefault;
-
-    LPWSTR ResolvedTarget;
-    LPWSTR ResolvedSource;
-    LPWSTR Property;   /* initially set property */
-    INT   ParentIndex;
-    INT   State;
-        /* 0 = uninitialized */
-        /* 1 = existing */
-        /* 2 = created remove if empty */
-        /* 3 = created persist if empty */
-    INT   Cost;
-    INT   Space;
-}MSIFOLDER;
-
-typedef struct tagMSIFILE
-{
-    LPWSTR File;
-    INT ComponentIndex;
-    LPWSTR FileName;
-    INT FileSize;
-    LPWSTR Version;
-    LPWSTR Language;
-    INT Attributes;
-    INT Sequence;   
-
-    INT State;
-       /* 0 = uninitialize */
-       /* 1 = not present */
-       /* 2 = present but replace */
-       /* 3 = present do not replace */
-       /* 4 = Installed */
-    LPWSTR  SourcePath;
-    LPWSTR  TargetPath;
-    BOOL    Temporary; 
-}MSIFILE;
-
 /*
  * Prototypes
  */
 static UINT ACTION_ProcessExecSequence(MSIPACKAGE *package, BOOL UIran);
 static UINT ACTION_ProcessUISequence(MSIPACKAGE *package);
-
 static UINT ACTION_PerformActionSequence(MSIPACKAGE *package, UINT seq);
-UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action);
+static UINT build_icon_path(MSIPACKAGE *package, LPCWSTR icon_name, 
+                            LPWSTR *FilePath);
 
+/* 
+ * action handlers
+ */
+typedef UINT (*STANDARDACTIONHANDLER)(MSIPACKAGE*);
+
 static UINT ACTION_LaunchConditions(MSIPACKAGE *package);
 static UINT ACTION_CostInitialize(MSIPACKAGE *package);
 static UINT ACTION_CreateFolders(MSIPACKAGE *package);
@@ -151,32 +78,26 @@
 static UINT ACTION_InstallFiles(MSIPACKAGE *package);
 static UINT ACTION_DuplicateFiles(MSIPACKAGE *package);
 static UINT ACTION_WriteRegistryValues(MSIPACKAGE *package);
-static UINT ACTION_CustomAction(MSIPACKAGE *package,const WCHAR *action);
 static UINT ACTION_InstallInitialize(MSIPACKAGE *package);
 static UINT ACTION_InstallValidate(MSIPACKAGE *package);
 static UINT ACTION_ProcessComponents(MSIPACKAGE *package);
 static UINT ACTION_RegisterTypeLibraries(MSIPACKAGE *package);
 static UINT ACTION_RegisterClassInfo(MSIPACKAGE *package);
 static UINT ACTION_RegisterProgIdInfo(MSIPACKAGE *package);
+static UINT ACTION_RegisterExtensionInfo(MSIPACKAGE *package);
+static UINT ACTION_RegisterMIMEInfo(MSIPACKAGE *package);
+static UINT ACTION_RegisterUser(MSIPACKAGE *package);
 static UINT ACTION_CreateShortcuts(MSIPACKAGE *package);
 static UINT ACTION_PublishProduct(MSIPACKAGE *package);
+static UINT ACTION_WriteIniValues(MSIPACKAGE *package);
+static UINT ACTION_SelfRegModules(MSIPACKAGE *package);
+static UINT ACTION_PublishFeatures(MSIPACKAGE *package);
+static UINT ACTION_RegisterProduct(MSIPACKAGE *package);
+static UINT ACTION_InstallExecute(MSIPACKAGE *package);
+static UINT ACTION_InstallFinalize(MSIPACKAGE *package);
+static UINT ACTION_ForceReboot(MSIPACKAGE *package);
+static UINT ACTION_ResolveSource(MSIPACKAGE *package);
 
-static UINT HANDLE_CustomType1(MSIPACKAGE *package, const LPWSTR source, 
-                                const LPWSTR target, const INT type);
-static UINT HANDLE_CustomType2(MSIPACKAGE *package, const LPWSTR source, 
-                                const LPWSTR target, const INT type);
-static UINT HANDLE_CustomType18(MSIPACKAGE *package, const LPWSTR source,
-                                const LPWSTR target, const INT type);
-static UINT HANDLE_CustomType50(MSIPACKAGE *package, const LPWSTR source,
-                                const LPWSTR target, const INT type);
-static UINT HANDLE_CustomType34(MSIPACKAGE *package, const LPWSTR source,
-                                const LPWSTR target, const INT type);
-
-static DWORD deformat_string(MSIPACKAGE *package, WCHAR* ptr,WCHAR** data);
-static LPWSTR resolve_folder(MSIPACKAGE *package, LPCWSTR name,
-                           BOOL source, BOOL set_prop, MSIFOLDER **folder);
-
-static int track_tempfile(MSIPACKAGE *package, LPCWSTR name, LPCWSTR path);
  
 /*
  * consts and values used
@@ -188,31 +109,30 @@
 static const WCHAR cszDatabase[]={'D','A','T','A','B','A','S','E',0};
 static const WCHAR c_collen[] = {'C',':','\\',0};
  
-static const WCHAR cszlsb[]={'[',0};
-static const WCHAR cszrsb[]={']',0};
 static const WCHAR cszbs[]={'\\',0};
 
 const static WCHAR szCreateFolders[] =
-    {'C','r','e','a','t','e','F','o','l','d','e','r','s',0};
+{'C','r','e','a','t','e','F','o','l','d','e','r','s',0};
 const static WCHAR szCostFinalize[] =
-    {'C','o','s','t','F','i','n','a','l','i','z','e',0};
+{'C','o','s','t','F','i','n','a','l','i','z','e',0};
 const static WCHAR szInstallFiles[] =
-    {'I','n','s','t','a','l','l','F','i','l','e','s',0};
+{'I','n','s','t','a','l','l','F','i','l','e','s',0};
 const static WCHAR szDuplicateFiles[] =
-    {'D','u','p','l','i','c','a','t','e','F','i','l','e','s',0};
+{'D','u','p','l','i','c','a','t','e','F','i','l','e','s',0};
 const static WCHAR szWriteRegistryValues[] =
 {'W','r','i','t','e','R','e','g','i','s','t','r','y','V','a','l','u','e','s',0};
 const static WCHAR szCostInitialize[] =
-    {'C','o','s','t','I','n','i','t','i','a','l','i','z','e',0};
-const static WCHAR szFileCost[] = {'F','i','l','e','C','o','s','t',0};
+{'C','o','s','t','I','n','i','t','i','a','l','i','z','e',0};
+const static WCHAR szFileCost[] = 
+{'F','i','l','e','C','o','s','t',0};
 const static WCHAR szInstallInitialize[] = 
-    {'I','n','s','t','a','l','l','I','n','i','t','i','a','l','i','z','e',0};
+{'I','n','s','t','a','l','l','I','n','i','t','i','a','l','i','z','e',0};
 const static WCHAR szInstallValidate[] = 
-    {'I','n','s','t','a','l','l','V','a','l','i','d','a','t','e',0};
+{'I','n','s','t','a','l','l','V','a','l','i','d','a','t','e',0};
 const static WCHAR szLaunchConditions[] = 
-    {'L','a','u','n','c','h','C','o','n','d','i','t','i','o','n','s',0};
+{'L','a','u','n','c','h','C','o','n','d','i','t','i','o','n','s',0};
 const static WCHAR szProcessComponents[] = 
-    {'P','r','o','c','e','s','s','C','o','m','p','o','n','e','n','t','s',0};
+{'P','r','o','c','e','s','s','C','o','m','p','o','n','e','n','t','s',0};
 const static WCHAR szRegisterTypeLibraries[] = 
 {'R','e','g','i','s','t','e','r','T','y','p','e','L','i','b','r','a','r',
 'i','e','s',0};
@@ -224,7 +144,210 @@
 {'C','r','e','a','t','e','S','h','o','r','t','c','u','t','s',0};
 const static WCHAR szPublishProduct[] = 
 {'P','u','b','l','i','s','h','P','r','o','d','u','c','t',0};
+const static WCHAR szWriteIniValues[] = 
+{'W','r','i','t','e','I','n','i','V','a','l','u','e','s',0};
+const static WCHAR szSelfRegModules[] = 
+{'S','e','l','f','R','e','g','M','o','d','u','l','e','s',0};
+const static WCHAR szPublishFeatures[] = 
+{'P','u','b','l','i','s','h','F','e','a','t','u','r','e','s',0};
+const static WCHAR szRegisterProduct[] = 
+{'R','e','g','i','s','t','e','r','P','r','o','d','u','c','t',0};
+const static WCHAR szInstallExecute[] = 
+{'I','n','s','t','a','l','l','E','x','e','c','u','t','e',0};
+const static WCHAR szInstallExecuteAgain[] = 
+{'I','n','s','t','a','l','l','E','x','e','c','u','t','e','A','g','a','i','n',0};
+const static WCHAR szInstallFinalize[] = 
+{'I','n','s','t','a','l','l','F','i','n','a','l','i','z','e',0};
+const static WCHAR szForceReboot[] = 
+{'F','o','r','c','e','R','e','b','o','o','t',0};
+const static WCHAR szResolveSource[] =
+{'R','e','s','o','l','v','e','S','o','u','r','c','e',0};
+const static WCHAR szAppSearch[] = 
+{'A','p','p','S','e','a','r','c','h',0};
+const static WCHAR szAllocateRegistrySpace[] = 
+{'A','l','l','o','c','a','t','e','R','e','g','i','s','t','r','y','S','p','a','c','e',0};
+const static WCHAR szBindImage[] = 
+{'B','i','n','d','I','m','a','g','e',0};
+const static WCHAR szCCPSearch[] = 
+{'C','C','P','S','e','a','r','c','h',0};
+const static WCHAR szDeleteServices[] = 
+{'D','e','l','e','t','e','S','e','r','v','i','c','e','s',0};
+const static WCHAR szDisableRollback[] = 
+{'D','i','s','a','b','l','e','R','o','l','l','b','a','c','k',0};
+const static WCHAR szExecuteAction[] = 
+{'E','x','e','c','u','t','e','A','c','t','i','o','n',0};
+const static WCHAR szFindRelatedProducts[] = 
+{'F','i','n','d','R','e','l','a','t','e','d','P','r','o','d','u','c','t','s',0};
+const static WCHAR szInstallAdminPackage[] = 
+{'I','n','s','t','a','l','l','A','d','m','i','n','P','a','c','k','a','g','e',0};
+const static WCHAR szInstallSFPCatalogFile[] = 
+{'I','n','s','t','a','l','l','S','F','P','C','a','t','a','l','o','g','F','i','l','e',0};
+const static WCHAR szIsolateComponents[] = 
+{'I','s','o','l','a','t','e','C','o','m','p','o','n','e','n','t','s',0};
+const static WCHAR szMigrateFeatureStates[] = 
+{'M','i','g','r','a','t','e','F','e','a','t','u','r','e','S','t','a','t','e','s',0};
+const static WCHAR szMoveFiles[] = 
+{'M','o','v','e','F','i','l','e','s',0};
+const static WCHAR szMsiPublishAssemblies[] = 
+{'M','s','i','P','u','b','l','i','s','h','A','s','s','e','m','b','l','i','e','s',0};
+const static WCHAR szMsiUnpublishAssemblies[] = 
+{'M','s','i','U','n','p','u','b','l','i','s','h','A','s','s','e','m','b','l','i','e','s',0};
+const static WCHAR szInstallODBC[] = 
+{'I','n','s','t','a','l','l','O','D','B','C',0};
+const static WCHAR szInstallServices[] = 
+{'I','n','s','t','a','l','l','S','e','r','v','i','c','e','s',0};
+const static WCHAR szPatchFiles[] = 
+{'P','a','t','c','h','F','i','l','e','s',0};
+const static WCHAR szPublishComponents[] = 
+{'P','u','b','l','i','s','h','C','o','m','p','o','n','e','n','t','s',0};
+const static WCHAR szRegisterComPlus[] =
+{'R','e','g','i','s','t','e','r','C','o','m','P','l','u','s',0};
+const static WCHAR szRegisterExtensionInfo[] =
+{'R','e','g','i','s','t','e','r','E','x','t','e','n','s','i','o','n','I','n','f','o',0};
+const static WCHAR szRegisterFonts[] =
+{'R','e','g','i','s','t','e','r','F','o','n','t','s',0};
+const static WCHAR szRegisterMIMEInfo[] =
+{'R','e','g','i','s','t','e','r','M','I','M','E','I','n','f','o',0};
+const static WCHAR szRegisterUser[] =
+{'R','e','g','i','s','t','e','r','U','s','e','r',0};
+const static WCHAR szRemoveDuplicateFiles[] =
+{'R','e','m','o','v','e','D','u','p','l','i','c','a','t','e','F','i','l','e','s',0};
+const static WCHAR szRemoveEnvironmentStrings[] =
+{'R','e','m','o','v','e','E','n','v','i','r','o','n','m','e','n','t','S','t','r','i','n','g','s',0};
+const static WCHAR szRemoveExistingProducts[] =
+{'R','e','m','o','v','e','E','x','i','s','t','i','n','g','P','r','o','d','u','c','t','s',0};
+const static WCHAR szRemoveFiles[] =
+{'R','e','m','o','v','e','F','i','l','e','s',0};
+const static WCHAR szRemoveFolders[] =
+{'R','e','m','o','v','e','F','o','l','d','e','r','s',0};
+const static WCHAR szRemoveIniValues[] =
+{'R','e','m','o','v','e','I','n','i','V','a','l','u','e','s',0};
+const static WCHAR szRemoveODBC[] =
+{'R','e','m','o','v','e','O','D','B','C',0};
+const static WCHAR szRemoveRegistryValues[] =
+{'R','e','m','o','v','e','R','e','g','i','s','t','r','y','V','a','l','u','e','s',0};
+const static WCHAR szRemoveShortcuts[] =
+{'R','e','m','o','v','e','S','h','o','r','t','c','u','t','s',0};
+const static WCHAR szRMCCPSearch[] =
+{'R','M','C','C','P','S','e','a','r','c','h',0};
+const static WCHAR szScheduleReboot[] =
+{'S','c','h','e','d','u','l','e','R','e','b','o','o','t',0};
+const static WCHAR szSelfUnregModules[] =
+{'S','e','l','f','U','n','r','e','g','M','o','d','u','l','e','s',0};
+const static WCHAR szSetODBCFolders[] =
+{'S','e','t','O','D','B','C','F','o','l','d','e','r','s',0};
+const static WCHAR szStartServices[] =
+{'S','t','a','r','t','S','e','r','v','i','c','e','s',0};
+const static WCHAR szStopServices[] =
+{'S','t','o','p','S','e','r','v','i','c','e','s',0};
+const static WCHAR szUnpublishComponents[] =
+{'U','n','p','u','b','l','i','s','h','C','o','m','p','o','n','e','n','t','s',0};
+const static WCHAR szUnpublishFeatures[] =
+{'U','n','p','u','b','l','i','s','h','F','e','a','t','u','r','e','s',0};
+const static WCHAR szUnregisterClassInfo[] =
+{'U','n','r','e','g','i','s','t','e','r','C','l','a','s','s','I','n','f','o',0};
+const static WCHAR szUnregisterComPlus[] =
+{'U','n','r','e','g','i','s','t','e','r','C','o','m','P','l','u','s',0};
+const static WCHAR szUnregisterExtensionInfo[] =
+{'U','n','r','e','g','i','s','t','e','r','E','x','t','e','n','s','i','o','n','I','n','f','o',0};
+const static WCHAR szUnregisterFonts[] =
+{'U','n','r','e','g','i','s','t','e','r','F','o','n','t','s',0};
+const static WCHAR szUnregisterMIMEInfo[] =
+{'U','n','r','e','g','i','s','t','e','r','M','I','M','E','I','n','f','o',0};
+const static WCHAR szUnregisterProgIdInfo[] =
+{'U','n','r','e','g','i','s','t','e','r','P','r','o','g','I','d','I','n','f','o',0};
+const static WCHAR szUnregisterTypeLibraries[] =
+{'U','n','r','e','g','i','s','t','e','r','T','y','p','e','L','i','b','r','a','r','i','e','s',0};
+const static WCHAR szValidateProductID[] =
+{'V','a','l','i','d','a','t','e','P','r','o','d','u','c','t','I','D',0};
+const static WCHAR szWriteEnvironmentStrings[] =
+{'W','r','i','t','e','E','n','v','i','r','o','n','m','e','n','t','S','t','r','i','n','g','s',0};
 
+struct _actions {
+    LPCWSTR action;
+    STANDARDACTIONHANDLER handler;
+};
+
+struct _actions StandardActions[] = {
+    { szAllocateRegistrySpace, NULL},
+    { szAppSearch, ACTION_AppSearch },
+    { szBindImage, NULL},
+    { szCCPSearch, NULL},
+    { szCostFinalize, ACTION_CostFinalize },
+    { szCostInitialize, ACTION_CostInitialize },
+    { szCreateFolders, ACTION_CreateFolders },
+    { szCreateShortcuts, ACTION_CreateShortcuts },
+    { szDeleteServices, NULL},
+    { szDisableRollback, NULL},
+    { szDuplicateFiles, ACTION_DuplicateFiles},
+    { szExecuteAction, NULL},
+    { szFileCost, ACTION_FileCost },
+    { szFindRelatedProducts, NULL},
+    { szForceReboot, ACTION_ForceReboot },
+    { szInstallAdminPackage, NULL},
+    { szInstallExecute, ACTION_InstallExecute },
+    { szInstallExecuteAgain, ACTION_InstallExecute },
+    { szInstallFiles, ACTION_InstallFiles},
+    { szInstallFinalize, ACTION_InstallFinalize },
+    { szInstallInitialize, ACTION_InstallInitialize },
+    { szInstallSFPCatalogFile, NULL},
+    { szInstallValidate, ACTION_InstallValidate },
+    { szIsolateComponents, NULL},
+    { szLaunchConditions, ACTION_LaunchConditions },
+    { szMigrateFeatureStates, NULL},
+    { szMoveFiles, NULL},
+    { szMsiPublishAssemblies, NULL},
+    { szMsiUnpublishAssemblies, NULL},
+    { szInstallODBC, NULL},
+    { szInstallServices, NULL},
+    { szPatchFiles, NULL},
+    { szProcessComponents, ACTION_ProcessComponents },
+    { szPublishComponents, NULL},
+    { szPublishFeatures, ACTION_PublishFeatures },
+    { szPublishProduct, ACTION_PublishProduct },
+    { szRegisterClassInfo, ACTION_RegisterClassInfo },
+    { szRegisterComPlus, NULL},
+    { szRegisterExtensionInfo, ACTION_RegisterExtensionInfo },
+    { szRegisterFonts, NULL},
+    { szRegisterMIMEInfo, ACTION_RegisterMIMEInfo },
+    { szRegisterProduct, ACTION_RegisterProduct },
+    { szRegisterProgIdInfo, ACTION_RegisterProgIdInfo },
+    { szRegisterTypeLibraries, ACTION_RegisterTypeLibraries },
+    { szRegisterUser, ACTION_RegisterUser},
+    { szRemoveDuplicateFiles, NULL},
+    { szRemoveEnvironmentStrings, NULL},
+    { szRemoveExistingProducts, NULL},
+    { szRemoveFiles, NULL},
+    { szRemoveFolders, NULL},
+    { szRemoveIniValues, NULL},
+    { szRemoveODBC, NULL},
+    { szRemoveRegistryValues, NULL},
+    { szRemoveShortcuts, NULL},
+    { szResolveSource, ACTION_ResolveSource},
+    { szRMCCPSearch, NULL},
+    { szScheduleReboot, NULL},
+    { szSelfRegModules, ACTION_SelfRegModules },
+    { szSelfUnregModules, NULL},
+    { szSetODBCFolders, NULL},
+    { szStartServices, NULL},
+    { szStopServices, NULL},
+    { szUnpublishComponents, NULL},
+    { szUnpublishFeatures, NULL},
+    { szUnregisterClassInfo, NULL},
+    { szUnregisterComPlus, NULL},
+    { szUnregisterExtensionInfo, NULL},
+    { szUnregisterFonts, NULL},
+    { szUnregisterMIMEInfo, NULL},
+    { szUnregisterProgIdInfo, NULL},
+    { szUnregisterTypeLibraries, NULL},
+    { szValidateProductID, NULL},
+    { szWriteEnvironmentStrings, NULL},
+    { szWriteIniValues, ACTION_WriteIniValues },
+    { szWriteRegistryValues, ACTION_WriteRegistryValues},
+    { NULL, NULL},
+};
+
+
 /******************************************************** 
  * helper functions to get around current HACKS and such
  ********************************************************/
@@ -235,42 +358,8 @@
         memmove(filename, p+1, (strlenW(p+1)+1)*sizeof(WCHAR));
 }
 
-inline static char *strdupWtoA( const WCHAR *str )
+WCHAR *load_dynamic_stringW(MSIRECORD *row, INT index)
 {
-    char *ret = NULL;
-    if (str)
-    {
-        DWORD len = WideCharToMultiByte( CP_ACP, 0, str, -1, NULL, 0, NULL, NULL
-);
-        if ((ret = HeapAlloc( GetProcessHeap(), 0, len )))
-            WideCharToMultiByte( CP_ACP, 0, str, -1, ret, len, NULL, NULL );
-    }
-    return ret;
-}
-
-inline static WCHAR *strdupAtoW( const char *str )
-{
-    WCHAR *ret = NULL;
-    if (str)
-    {
-        DWORD len = MultiByteToWideChar( CP_ACP, 0, str, -1, NULL, 0 );
-        if ((ret = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) )))
-            MultiByteToWideChar( CP_ACP, 0, str, -1, ret, len );
-    }
-    return ret;
-}
-
-static LPWSTR dupstrW(LPCWSTR src)
-{
-    LPWSTR dest;
-    if (!src) return NULL;
-    dest = HeapAlloc(GetProcessHeap(), 0, (strlenW(src)+1)*sizeof(WCHAR));
-    strcpyW(dest, src);
-    return dest;
-}
-
-inline static WCHAR *load_dynamic_stringW(MSIRECORD *row, INT index)
-{
     UINT rc;
     DWORD sz;
     LPWSTR ret;
@@ -301,8 +390,7 @@
     return ret;
 }
 
-inline static LPWSTR load_dynamic_property(MSIPACKAGE *package, LPCWSTR prop,
-                                           UINT* rc)
+LPWSTR load_dynamic_property(MSIPACKAGE *package, LPCWSTR prop, UINT* rc)
 {
     DWORD sz = 0;
     LPWSTR str;
@@ -328,7 +416,7 @@
     return str;
 }
 
-inline static int get_loaded_component(MSIPACKAGE* package, LPCWSTR Component )
+int get_loaded_component(MSIPACKAGE* package, LPCWSTR Component )
 {
     int rc = -1;
     DWORD i;
@@ -344,7 +432,7 @@
     return rc;
 }
 
-inline static int get_loaded_feature(MSIPACKAGE* package, LPCWSTR Feature )
+int get_loaded_feature(MSIPACKAGE* package, LPCWSTR Feature )
 {
     int rc = -1;
     DWORD i;
@@ -360,7 +448,7 @@
     return rc;
 }
 
-inline static int get_loaded_file(MSIPACKAGE* package, LPCWSTR file)
+int get_loaded_file(MSIPACKAGE* package, LPCWSTR file)
 {
     int rc = -1;
     DWORD i;
@@ -376,8 +464,7 @@
     return rc;
 }
 
-
-static int track_tempfile(MSIPACKAGE *package, LPCWSTR name, LPCWSTR path)
+int track_tempfile(MSIPACKAGE *package, LPCWSTR name, LPCWSTR path)
 {
     DWORD i;
     DWORD index;
@@ -408,7 +495,7 @@
     return 0;
 }
 
-void ACTION_remove_tracked_tempfiles(MSIPACKAGE* package)
+static void remove_tracked_tempfiles(MSIPACKAGE* package)
 {
     DWORD i;
 
@@ -426,13 +513,43 @@
     }
 }
 
+/* wrapper to resist a need for a full rewrite right now */
+DWORD deformat_string(MSIPACKAGE *package, LPCWSTR ptr, WCHAR** data )
+{
+    if (ptr)
+    {
+        MSIRECORD *rec = MSI_CreateRecord(1);
+        DWORD size = 0;
+
+        MSI_RecordSetStringW(rec,0,ptr);
+        MSI_FormatRecordW(package,rec,NULL,&size);
+        if (size >= 0)
+        {
+            size++;
+            *data = HeapAlloc(GetProcessHeap(),0,size*sizeof(WCHAR));
+            if (size > 1)
+                MSI_FormatRecordW(package,rec,*data,&size);
+            else
+                *data[0] = 0;
+            msiobj_release( &rec->hdr );
+            return sizeof(WCHAR)*size;
+        }
+        msiobj_release( &rec->hdr );
+    }
+
+    *data = NULL;
+    return 0;
+}
+
 /* Called when the package is being closed */
-extern void ACTION_free_package_structures( MSIPACKAGE* package)
+void ACTION_free_package_structures( MSIPACKAGE* package)
 {
     INT i;
     
     TRACE("Freeing package action data\n");
 
+    remove_tracked_tempfiles(package);
+
     /* No dynamic buffers in features */
     if (package->features && package->loaded_features > 0)
         HeapFree(GetProcessHeap(),0,package->features);
@@ -465,54 +582,16 @@
 
     if (package->files && package->loaded_files > 0)
         HeapFree(GetProcessHeap(),0,package->files);
-}
 
-static UINT ACTION_OpenQuery( MSIDATABASE *db, MSIQUERY **view, LPCWSTR fmt, ... )
-{
-    LPWSTR szQuery;
-    LPCWSTR p;
-    UINT sz, rc;
-    va_list va;
+    for (i = 0; i < package->DeferredActionCount; i++)
+        HeapFree(GetProcessHeap(),0,package->DeferredAction[i]);
+    HeapFree(GetProcessHeap(),0,package->DeferredAction);
 
-    /* figure out how much space we need to allocate */
-    va_start(va, fmt);
-    sz = strlenW(fmt) + 1;
-    p = fmt;
-    while (*p)
-    {
-        p = strchrW(p, '%');
-        if (!p)
-            break;
-        p++;
-        switch (*p)
-        {
-        case 's':  /* a string */
-            sz += strlenW(va_arg(va,LPCWSTR));
-            break;
-        case 'd':
-        case 'i':  /* an integer -2147483648 seems to be longest */
-            sz += 3*sizeof(int);
-            (void)va_arg(va,int);
-            break;
-        case '%':  /* a single % - leave it alone */
-            break;
-        default:
-            FIXME("Unhandled character type %c\n",*p);
-        }
-        p++;
-    }
-    va_end(va);
+    for (i = 0; i < package->CommitActionCount; i++)
+        HeapFree(GetProcessHeap(),0,package->CommitAction[i]);
+    HeapFree(GetProcessHeap(),0,package->CommitAction);
 
-    /* construct the string */
-    szQuery = HeapAlloc(GetProcessHeap(), 0, sz*sizeof(WCHAR));
-    va_start(va, fmt);
-    vsnprintfW(szQuery, sz, fmt, va);
-    va_end(va);
-
-    /* perform the query */
-    rc = MSI_DatabaseOpenViewW(db, szQuery, view);
-    HeapFree(GetProcessHeap(), 0, szQuery);
-    return rc;
+    HeapFree(GetProcessHeap(),0,package->PackagePath);
 }
 
 static void ui_progress(MSIPACKAGE *package, int a, int b, int c, int d )
@@ -526,6 +605,8 @@
     MSI_RecordSetInteger(row,4,d);
     MSI_ProcessMessage(package, INSTALLMESSAGE_PROGRESS, row);
     msiobj_release(&row->hdr);
+
+    msi_dialog_check_messages(package->dialog, NULL);
 }
 
 static void ui_actiondata(MSIPACKAGE *package, LPCWSTR action, MSIRECORD * record)
@@ -538,11 +619,11 @@
     UINT rc;
     MSIQUERY * view;
     MSIRECORD * row = 0;
-    LPWSTR ptr;
+    DWORD size;
 
     if (!package->LastAction || strcmpW(package->LastAction,action))
     {
-        rc = ACTION_OpenQuery(package->db, &view, Query_t, action);
+        rc = MSI_OpenQuery(package->db, &view, Query_t, action);
         if (rc != ERROR_SUCCESS)
             return;
 
@@ -568,12 +649,10 @@
         }
 
         /* update the cached actionformat */
-        if (package->ActionFormat)
-            HeapFree(GetProcessHeap(),0,package->ActionFormat);
+        HeapFree(GetProcessHeap(),0,package->ActionFormat);
         package->ActionFormat = load_dynamic_stringW(row,3);
 
-        if (package->LastAction)
-            HeapFree(GetProcessHeap(),0,package->LastAction);
+        HeapFree(GetProcessHeap(),0,package->LastAction);
         package->LastAction = dupstrW(action);
 
         msiobj_release(&row->hdr);
@@ -581,39 +660,10 @@
         msiobj_release(&view->hdr);
     }
 
-    message[0]=0;
-    ptr = package->ActionFormat;
-    while (*ptr)
-    {
-        LPWSTR ptr2;
-        LPWSTR data=NULL;
-        WCHAR tmp[1023];
-        INT field;
+    MSI_RecordSetStringW(record,0,package->ActionFormat);
+    size = 1024;
+    MSI_FormatRecordW(package,record,message,&size);
 
-        ptr2 = strchrW(ptr,'[');
-        if (ptr2)
-        {
-            strncpyW(tmp,ptr,ptr2-ptr);
-            tmp[ptr2-ptr]=0;
-            strcatW(message,tmp);
-            ptr2++;
-            field = atoiW(ptr2);
-            data = load_dynamic_stringW(record,field);
-            if (data)
-            {
-                strcatW(message,data);
-                HeapFree(GetProcessHeap(),0,data);
-            }
-            ptr=strchrW(ptr2,']');
-            ptr++;
-        }
-        else
-        {
-            strcatW(message,ptr);
-            break;
-        }
-    }
-
     row = MSI_CreateRecord(1);
     MSI_RecordSetStringW(row,1,message);
  
[truncated at 1000 lines; 12207 more skipped]