Author: akhaldi Date: Sat May 18 13:53:18 2013 New Revision: 59034
URL: http://svn.reactos.org/svn/reactos?rev=59034&view=rev Log: [MSIEXEC] * Sync with Wine 1.5.26.
Modified: trunk/reactos/base/system/msiexec/msiexec.c trunk/reactos/base/system/msiexec/rsrc.rc trunk/reactos/media/doc/README.WINE
Modified: trunk/reactos/base/system/msiexec/msiexec.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/msiexec/msiexec... ============================================================================== --- trunk/reactos/base/system/msiexec/msiexec.c [iso-8859-1] (original) +++ trunk/reactos/base/system/msiexec/msiexec.c [iso-8859-1] Sat May 18 13:53:18 2013 @@ -114,10 +114,8 @@ static VOID StringListAppend(struct string_list **list, LPCWSTR str) { struct string_list *entry; - DWORD size; - - size = sizeof *entry + lstrlenW(str) * sizeof (WCHAR); - entry = HeapAlloc(GetProcessHeap(), 0, size); + + entry = HeapAlloc(GetProcessHeap(), 0, FIELD_OFFSET(struct string_list, str[lstrlenW(str) + 1])); if(!entry) { WINE_ERR("Out of memory!\n"); @@ -351,29 +349,57 @@
static DWORD DoRegServer(void) { + static const WCHAR msiserverW[] = {'M','S','I','S','e','r','v','e','r',0}; + static const WCHAR msiexecW[] = {'\','m','s','i','e','x','e','c',' ','/','V',0}; SC_HANDLE scm, service; - CHAR path[MAX_PATH+12]; - DWORD ret = 0; - - scm = OpenSCManagerA(NULL, SERVICES_ACTIVE_DATABASEA, SC_MANAGER_CREATE_SERVICE); - if (!scm) + WCHAR path[MAX_PATH+12]; + DWORD len, ret = 0; + + if (!(scm = OpenSCManagerW(NULL, SERVICES_ACTIVE_DATABASEW, SC_MANAGER_CREATE_SERVICE))) { fprintf(stderr, "Failed to open the service control manager.\n"); return 1; } - - GetSystemDirectoryA(path, MAX_PATH); - lstrcatA(path, "\msiexec.exe /V"); - - service = CreateServiceA(scm, "MSIServer", "MSIServer", GENERIC_ALL, - SERVICE_WIN32_SHARE_PROCESS, SERVICE_DEMAND_START, - SERVICE_ERROR_NORMAL, path, NULL, NULL, - NULL, NULL, NULL); - - if (service) CloseServiceHandle(service); + len = GetSystemDirectoryW(path, MAX_PATH); + lstrcpyW(path + len, msiexecW); + if ((service = CreateServiceW(scm, msiserverW, msiserverW, GENERIC_ALL, + SERVICE_WIN32_SHARE_PROCESS, SERVICE_DEMAND_START, + SERVICE_ERROR_NORMAL, path, NULL, NULL, NULL, NULL, NULL))) + { + CloseServiceHandle(service); + } else if (GetLastError() != ERROR_SERVICE_EXISTS) { fprintf(stderr, "Failed to create MSI service\n"); + ret = 1; + } + CloseServiceHandle(scm); + return ret; +} + +static DWORD DoUnregServer(void) +{ + static const WCHAR msiserverW[] = {'M','S','I','S','e','r','v','e','r',0}; + SC_HANDLE scm, service; + DWORD ret = 0; + + if (!(scm = OpenSCManagerW(NULL, SERVICES_ACTIVE_DATABASEW, SC_MANAGER_CONNECT))) + { + fprintf(stderr, "Failed to open service control manager\n"); + return 1; + } + if ((service = OpenServiceW(scm, msiserverW, DELETE))) + { + if (!DeleteService(service)) + { + fprintf(stderr, "Failed to delete MSI service\n"); + ret = 1; + } + CloseServiceHandle(service); + } + else if (GetLastError() != ERROR_SERVICE_DOES_NOT_EXIST) + { + fprintf(stderr, "Failed to open MSI service\n"); ret = 1; } CloseServiceHandle(scm); @@ -477,12 +503,12 @@ *pargv = argv; }
-static BOOL process_args_from_reg( LPWSTR ident, int *pargc, WCHAR ***pargv ) +static BOOL process_args_from_reg( const WCHAR *ident, int *pargc, WCHAR ***pargv ) { LONG r; - HKEY hkey = 0, hkeyArgs = 0; + HKEY hkey; DWORD sz = 0, type = 0; - LPWSTR buf = NULL; + WCHAR *buf; BOOL ret = FALSE;
r = RegOpenKeyW(HKEY_LOCAL_MACHINE, InstallRunOnce, &hkey); @@ -491,8 +517,15 @@ r = RegQueryValueExW(hkey, ident, 0, &type, 0, &sz); if(r == ERROR_SUCCESS && type == REG_SZ) { - buf = HeapAlloc(GetProcessHeap(), 0, sz); - r = RegQueryValueExW(hkey, ident, 0, &type, (LPBYTE)buf, &sz); + int len = lstrlenW( *pargv[0] ); + if (!(buf = HeapAlloc( GetProcessHeap(), 0, sz + (len + 1) * sizeof(WCHAR) ))) + { + RegCloseKey( hkey ); + return FALSE; + } + memcpy( buf, *pargv[0], len * sizeof(WCHAR) ); + buf[len++] = ' '; + r = RegQueryValueExW(hkey, ident, 0, &type, (LPBYTE)(buf + len), &sz); if( r == ERROR_SUCCESS ) { process_args(buf, pargc, pargv); @@ -500,7 +533,7 @@ } HeapFree(GetProcessHeap(), 0, buf); } - RegCloseKey(hkeyArgs); + RegCloseKey(hkey); return ret; }
@@ -569,7 +602,8 @@ { FunctionRegServer = TRUE; } - else if (msi_option_equal(argvW[i], "unregserver") || msi_option_equal(argvW[i], "unregister")) + else if (msi_option_equal(argvW[i], "unregserver") || msi_option_equal(argvW[i], "unregister") + || msi_option_equal(argvW[i], "unreg")) { FunctionUnregServer = TRUE; } @@ -884,6 +918,11 @@ InstallUILevel = INSTALLUILEVEL_BASIC|INSTALLUILEVEL_ENDDIALOG; WINE_FIXME("Unknown modifier: !\n"); } + else if(msi_strequal(argvW[i]+2, "b!")) + { + InstallUILevel = INSTALLUILEVEL_BASIC; + WINE_FIXME("Unknown modifier: !\n"); + } else { fprintf(stderr, "Unknown option "%s" for UI level\n", @@ -976,7 +1015,7 @@ } else if (FunctionUnregServer) { - WINE_FIXME( "/unregserver not implemented yet, ignoring\n" ); + ReturnCode = DoUnregServer(); } else if (FunctionServer) {
Modified: trunk/reactos/base/system/msiexec/rsrc.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/msiexec/rsrc.rc... ============================================================================== --- trunk/reactos/base/system/msiexec/rsrc.rc [iso-8859-1] (original) +++ trunk/reactos/base/system/msiexec/rsrc.rc [iso-8859-1] Sat May 18 13:53:18 2013 @@ -21,10 +21,10 @@ #define WINE_FILEDESCRIPTION_STR "Wine Installer" #define WINE_FILENAME_STR "msiexec.exe" #define WINE_FILETYPE VFT_APP -#define WINE_FILEVERSION 3,1,4000,1823 -#define WINE_FILEVERSION_STR "3.1.4000.1823" -#define WINE_PRODUCTVERSION 3,1,4000,1823 -#define WINE_PRODUCTVERSION_STR "3.1.4000.1823" +#define WINE_FILEVERSION 4,5,6001,22299 +#define WINE_FILEVERSION_STR "4.5.6001.22299" +#define WINE_PRODUCTVERSION 4,5,6001,22299 +#define WINE_PRODUCTVERSION_STR "4.5.6001.22299" #define WINE_PRODUCTNAME_STR "Wine Installer"
#include "wine/wine_common_ver.rc"
Modified: trunk/reactos/media/doc/README.WINE URL: http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=5... ============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sat May 18 13:53:18 2013 @@ -221,7 +221,7 @@ reactos/base/applications/wordpad # Synced to Wine-1.5.26 reactos/base/services/rpcss # Synced to Wine-20081105 reactos/base/system/expand # Synced to Wine-1.5.26 -reactos/base/system/msiexec # Autosync +reactos/base/system/msiexec # Synced to Wine-1.5.26 reactos/modules/rosapps/winfile # Autosync
In addition the following libs, dlls and source files are mostly based on code ported