22 #define WIN32_LEAN_AND_MEAN 35 DEFINE_GUID(
GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
52 WCHAR msiexec_version[40];
70 WINE_ERR(
"MsiGetFileVersion failed with %ld\n",
res);
78 if (msi_res && msiexec_help) {
201 while(*
str >=
'0' && *
str <=
'9')
231 if (str1[0] !=
'/' && str1[0] !=
'-')
259 if (str1[0] !=
'/' && str1[0] !=
'-')
294 pfDllRegisterServer =
LoadProc(DllName,
"DllRegisterServer", &DllHandle);
296 hr = pfDllRegisterServer();
314 pfDllUnregisterServer =
LoadProc(DllName,
"DllUnregisterServer", &DllHandle);
316 hr = pfDllUnregisterServer();
330 SC_HANDLE scm, service;
336 fprintf(
stderr,
"Failed to open the service control manager.\n");
358 SC_HANDLE scm, service;
416 ERR(
"Failed to create custom action server pipe: %lu\n",
GetLastError());
441 ERR(
"Failed to write to custom action server pipe: %lu\n",
GetLastError());
446 ERR(
"Failed to read from custom action server pipe: %lu\n",
GetLastError());
469 for (
p =
in; *
p;
p++)
501 if (
p >
in &&
p[-1] ==
'"')
521 if (!ignore &&
out) *
out++ = *
p;
565 L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\RunOnceEntries", &hkey);
625 BOOL FunctionDllUnregisterServer =
FALSE;
635 DWORD RepairMode = 0;
643 DWORD LogAttributes = 0;
682 FunctionRegServer =
TRUE;
687 FunctionUnregServer =
TRUE;
693 FunctionInstall =
TRUE;
704 PackageName = argvWi;
708 FunctionInstall =
TRUE;
709 FunctionInstallAdmin =
TRUE;
715 PackageName = argvW[
i];
717 WINE_FIXME(
"Administrative installs are not currently supported\n");
723 FunctionRepair =
TRUE;
769 fprintf(
stderr,
"Unknown option \"%c\" in Repair mode\n", argvW[
i][
j]);
785 PackageName = argvW[
i];
789 FunctionInstall =
TRUE;
791 if(!PackageName || !PackageName[0])
796 PackageName = argvW[
i];
805 FunctionAdvertise =
TRUE;
819 fprintf(
stderr,
"Unknown option \"%c\" in Advertise mode\n", argvW[
i][
j]);
827 PackageName = argvW[
i];
831 FunctionAdvertise =
TRUE;
837 PackageName = argvW[
i];
841 FunctionAdvertise =
TRUE;
847 PackageName = argvW[
i];
958 FunctionPatch =
TRUE;
963 PatchFileName = argvW[
i];
1017 FunctionDllRegisterServer =
TRUE;
1026 FunctionDllUnregisterServer =
TRUE;
1039 FunctionUnknown =
TRUE;
1044 FunctionUnknown =
TRUE;
1049 FunctionServer =
TRUE;
1060 if(FunctionInstallAdmin && FunctionPatch)
1061 FunctionInstall =
FALSE;
1078 else if(FunctionRepair)
1081 WINE_FIXME(
"Product code treatment not implemented yet\n");
1092 else if(FunctionAdvertise)
1097 else if(FunctionPatch)
1099 ReturnCode =
MsiApplyPatchW(PatchFileName, PackageName, InstallType, Properties);
1101 else if(FunctionDllRegisterServer)
1105 else if(FunctionDllUnregisterServer)
1109 else if (FunctionRegServer)
1113 else if (FunctionUnregServer)
1117 else if (FunctionServer)
1121 else if (FunctionUnknown)
1123 WINE_FIXME(
"Unknown function, ignoring\n" );
static BOOL process_args_from_reg(const WCHAR *ident, int *pargc, WCHAR ***pargv)
static void process_args(WCHAR *cmdline, int *pargc, WCHAR ***pargv)
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
struct string_list * next
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
#define SERVICE_ERROR_NORMAL
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
#define SC_MANAGER_CONNECT
enum tagINSTALLUILEVEL INSTALLUILEVEL
SC_HANDLE WINAPI CreateServiceW(SC_HANDLE hSCManager, LPCWSTR lpServiceName, LPCWSTR lpDisplayName, DWORD dwDesiredAccess, DWORD dwServiceType, DWORD dwStartType, DWORD dwErrorControl, LPCWSTR lpBinaryPathName, LPCWSTR lpLoadOrderGroup, LPDWORD lpdwTagId, LPCWSTR lpDependencies, LPCWSTR lpServiceStartName, LPCWSTR lpPassword)
GLsizei const GLchar ** path
GLdouble GLdouble GLdouble r
char * wine_dbgstr_w(const wchar_t *wstr)
UINT WINAPI MsiMessageBoxW(HWND hWnd, const WCHAR *lpText, const WCHAR *lpCaption, UINT uType, WORD wLanguageId, DWORD f)
GLuint GLuint GLsizei count
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryExW(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
UINT WINAPI MsiInstallProductW(LPCWSTR szPackagePath, LPCWSTR szCommandLine)
#define INVALID_HANDLE_VALUE
VOID WINAPI ExitProcess(IN UINT uExitCode)
DWORD WINAPI GetLastError(VOID)
static LPWSTR build_transforms(struct string_list *transform_list)
INSTALLUILEVEL WINAPI MsiSetInternalUI(INSTALLUILEVEL dwUILevel, HWND *phWnd)
_Check_return_ long __cdecl wcstol(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
#define LOAD_WITH_ALTERED_SEARCH_PATH
BOOL WINAPI DeleteService(SC_HANDLE hService)
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
UINT WINAPI MsiApplyPatchW(LPCWSTR szPatchPackage, LPCWSTR szInstallPackage, INSTALLTYPE eInstallType, LPCWSTR szCommandLine)
static void * heap_alloc(size_t len)
static DWORD DoDllUnregisterServer(LPCWSTR DllName)
UINT WINAPI MsiEnableLogW(DWORD dwLogMode, const WCHAR *szLogFile, DWORD attributes)
UINT WINAPI MsiAdvertiseProductW(LPCWSTR szPackagePath, LPCWSTR szScriptfilePath, LPCWSTR szTransforms, LANGID lgidLanguage)
GLenum GLuint GLenum GLsizei const GLchar * buf
static DWORD CALLBACK custom_action_thread(void *arg)
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
LPWSTR WINAPI GetCommandLineW(VOID)
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
static int custom_action_server(const WCHAR *arg)
static BOOL msi_option_prefix(LPCWSTR str1, LPCSTR str2)
SC_HANDLE WINAPI OpenServiceW(SC_HANDLE hSCManager, LPCWSTR lpServiceName, DWORD dwDesiredAccess)
UINT WINAPI MsiConfigureProductExW(LPCWSTR szProduct, int iInstallLevel, INSTALLSTATE eInstallState, LPCWSTR szCommandLine)
UINT WINAPI MsiGetFileVersionW(const WCHAR *path, WCHAR *verbuf, DWORD *verlen, WCHAR *langbuf, DWORD *langlen)
static DWORD DoUnregServer(void)
BOOL WINAPI CloseServiceHandle(SC_HANDLE hSCObject)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
HRESULT(WINAPI * DLLREGISTERSERVER)(void)
static DWORD msi_atou(LPCWSTR str)
#define SC_MANAGER_CREATE_SERVICE
#define ERROR_FILE_NOT_FOUND
static VOID * LoadProc(LPCWSTR DllName, LPCSTR ProcName, HMODULE *DllHandle)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
_In_ ULONG _In_ ULONG_PTR ident
INT WINAPI CompareStringW(LCID lcid, DWORD flags, LPCWSTR str1, INT len1, LPCWSTR str2, INT len2)
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
_CONST_RETURN wchar_t *__cdecl wcschr(_In_z_ const wchar_t *_Str, wchar_t _Ch)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
UINT WINAPI MsiReinstallProductW(const WCHAR *szProduct, DWORD dwReinstallMode)
static DWORD DoRegServer(void)
static VOID StringListAppend(struct string_list **list, LPCWSTR str)
_Must_inspect_result_ _In_ ACCESS_MASK _In_opt_ POBJECT_ATTRIBUTES _In_opt_ PUNICODE_STRING LogFileName
#define SERVICE_WIN32_SHARE_PROCESS
#define SERVICES_ACTIVE_DATABASEW
#define ERROR_SERVICE_EXISTS
static BOOL msi_option_equal(LPCWSTR str1, LPCSTR str2)
WINE_DEFAULT_DEBUG_CHANNEL(msiexec)
SC_HANDLE WINAPI OpenSCManagerW(LPCWSTR lpMachineName, LPCWSTR lpDatabaseName, DWORD dwDesiredAccess)
static BOOL msi_strequal(LPCWSTR str1, LPCSTR str2)
#define memcpy(s1, s2, n)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
GLsizei const GLfloat * value
int _cdecl swprintf(const WCHAR *,...)
static void ShowUsage(int ExitCode)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
static BOOL IsProductCode(LPWSTR str)
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
static DWORD DoDllRegisterServer(LPCWSTR DllName)
#define FIELD_OFFSET(t, f)
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
UINT CDECL __wine_msi_call_dll_function(DWORD client_pid, const GUID *guid)
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
#define ReadFile(a, b, c, d, e)
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
#define MultiByteToWideChar
#define ERROR_SERVICE_DOES_NOT_EXIST
enum tagINSTALLTYPE INSTALLTYPE
HRESULT WINAPI CLSIDFromString(LPCOLESTR idstr, LPCLSID id)
static int chomp(const WCHAR *in, WCHAR *out)
#define GetProcAddress(x, y)
LANGID WINAPI GetUserDefaultLangID(void)
VOID WINAPI InitCommonControls(void)
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
GLuint GLuint GLsizei GLenum type
HRESULT(WINAPI * DLLUNREGISTERSERVER)(void)
DEFINE_GUID(GUID_NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
#define SERVICE_DEMAND_START
static LPWSTR build_properties(struct string_list *property_list)
static BOOL msi_strprefix(LPCWSTR str1, LPCSTR str2)
#define HeapFree(x, y, z)
static WCHAR * get_path_with_extension(const WCHAR *package_name)
#define RegCloseKey(hKey)
LCID WINAPI GetThreadLocale(void)
static BOOL heap_free(void *mem)
#define HKEY_LOCAL_MACHINE