22#define WIN32_LEAN_AND_MEAN
34DEFINE_GUID(
GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
67 WCHAR msiexec_version[40];
85 WINE_ERR(
"MsiGetFileVersion failed with %ld\n",
res);
92 msiexec_help =
malloc((
len + 1) *
sizeof(
WCHAR) +
sizeof(msiexec_version));
93 if (msi_res && msiexec_help) {
216 while(*
str >=
'0' && *
str <=
'9')
246 if (
str1[0] !=
'/' &&
str1[0] !=
'-')
274 if (
str1[0] !=
'/' &&
str1[0] !=
'-')
309 pfDllRegisterServer =
LoadProc(DllName,
"DllRegisterServer", &DllHandle);
311 hr = pfDllRegisterServer();
329 pfDllUnregisterServer =
LoadProc(DllName,
"DllUnregisterServer", &DllHandle);
331 hr = pfDllUnregisterServer();
345 SC_HANDLE scm, service;
351 report_error(
"Failed to open the service control manager.\n");
373 SC_HANDLE scm, service;
378 report_error(
"Failed to open service control manager\n");
435 ERR(
"Failed to create custom action server pipe: %lu\n",
GetLastError());
460 ERR(
"Failed to write to custom action server pipe: %lu\n",
GetLastError());
465 ERR(
"Failed to read from custom action server pipe: %lu\n",
GetLastError());
488 for (
p =
in; *
p;
p++)
522 if (
p >
in &&
p[-1] ==
'"')
543 if (!ignore &&
out) *
out++ = *
p;
587 L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\RunOnceEntries", &hkey);
664 BOOL FunctionDllUnregisterServer =
FALSE;
674 DWORD RepairMode = 0;
681 DWORD LogAttributes = 0;
720 FunctionRegServer =
TRUE;
725 FunctionUnregServer =
TRUE;
731 FunctionInstall =
TRUE;
742 PackageName = argvWi;
746 FunctionInstall =
TRUE;
747 FunctionInstallAdmin =
TRUE;
753 PackageName = argvW[
i];
760 FunctionRepair =
TRUE;
806 report_error(
"Unknown option \"%c\" in Repair mode\n", argvW[
i][
j]);
822 PackageName = argvW[
i];
826 FunctionInstall =
TRUE;
828 if(!PackageName || !PackageName[0])
833 PackageName = argvW[
i];
842 FunctionAdvertise =
TRUE;
856 report_error(
"Unknown option \"%c\" in Advertise mode\n", argvW[
i][
j]);
864 PackageName = argvW[
i];
868 FunctionAdvertise =
TRUE;
874 PackageName = argvW[
i];
878 FunctionAdvertise =
TRUE;
884 PackageName = argvW[
i];
995 FunctionPatch =
TRUE;
1000 PatchFileName = argvW[
i];
1055 FunctionDllRegisterServer =
TRUE;
1064 FunctionDllUnregisterServer =
TRUE;
1077 FunctionUnknown =
TRUE;
1082 FunctionUnknown =
TRUE;
1087 FunctionServer =
TRUE;
1098 if(FunctionInstallAdmin && FunctionPatch)
1099 FunctionInstall =
FALSE;
1101 if (PackageName && !(package_unquoted =
remove_quotes(PackageName)))
return 1;
1102 if (PatchFileName && !(patch_unquoted =
remove_quotes(PatchFileName)))
return 1;
1103 if (DllName && !(dll_unquoted =
remove_quotes(DllName)))
return 1;
1120 else if(FunctionRepair)
1123 WINE_FIXME(
"Product code treatment not implemented yet\n");
1134 else if(FunctionAdvertise)
1139 else if(FunctionPatch)
1141 ReturnCode =
MsiApplyPatchW(patch_unquoted, package_unquoted, InstallType, Properties);
1143 else if(FunctionDllRegisterServer)
1147 else if(FunctionDllUnregisterServer)
1151 else if (FunctionRegServer)
1155 else if (FunctionUnregServer)
1159 else if (FunctionServer)
1163 else if (FunctionUnknown)
1165 WINE_FIXME(
"Unknown function, ignoring\n" );
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
#define RegCloseKey(hKey)
VOID WINAPI InitCommonControls(void)
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(void *reserved, DWORD model)
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
HRESULT WINAPI CLSIDFromString(LPCOLESTR str, LPCLSID clsid)
#define ReadFile(a, b, c, d, e)
#define GetProcAddress(x, y)
#define INVALID_HANDLE_VALUE
#define MultiByteToWideChar
static const WCHAR *const ext[]
BOOL WINAPI WriteFile(_In_ HANDLE hFile, _In_reads_bytes_opt_(nNumberOfBytesToWrite) LPCVOID lpBuffer, _In_ DWORD nNumberOfBytesToWrite, _Out_opt_ LPDWORD lpNumberOfBytesWritten, _Inout_opt_ LPOVERLAPPED lpOverlapped)
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryExW(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
VOID WINAPI ExitProcess(IN UINT uExitCode)
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)
LCID WINAPI GetThreadLocale(void)
INT WINAPI CompareStringW(LCID lcid, DWORD flags, LPCWSTR str1, INT len1, LPCWSTR str2, INT len2)
LANGID WINAPI GetUserDefaultLangID(void)
LPWSTR WINAPI GetCommandLineW(void)
UINT WINAPI MsiGetFileVersionW(const WCHAR *path, WCHAR *verbuf, DWORD *verlen, WCHAR *langbuf, DWORD *langlen)
UINT WINAPI MsiConfigureProductExW(LPCWSTR szProduct, int iInstallLevel, INSTALLSTATE eInstallState, LPCWSTR szCommandLine)
UINT WINAPI MsiMessageBoxW(HWND hWnd, const WCHAR *lpText, const WCHAR *lpCaption, UINT uType, WORD wLanguageId, DWORD f)
UINT WINAPI MsiEnableLogW(DWORD dwLogMode, const WCHAR *szLogFile, DWORD attributes)
UINT WINAPI MsiInstallProductW(LPCWSTR szPackagePath, LPCWSTR szCommandLine)
UINT WINAPI MsiMessageBoxA(HWND hWnd, const char *lpText, const char *lpCaption, UINT uType, WORD wLanguageId, DWORD f)
INSTALLUILEVEL WINAPI MsiSetInternalUI(INSTALLUILEVEL dwUILevel, HWND *phWnd)
UINT WINAPI MsiAdvertiseProductW(LPCWSTR szPackagePath, LPCWSTR szScriptfilePath, LPCWSTR szTransforms, LANGID lgidLanguage)
UINT WINAPI MsiApplyPatchW(LPCWSTR szPatchPackage, LPCWSTR szInstallPackage, INSTALLTYPE eInstallType, LPCWSTR szCommandLine)
UINT WINAPI MsiReinstallProductW(const WCHAR *szProduct, DWORD dwReinstallMode)
_ACRTIMP __msvcrt_long __cdecl wcstol(const wchar_t *, wchar_t **, int)
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
GLuint GLuint GLsizei count
GLuint GLuint GLsizei GLenum type
GLdouble GLdouble GLdouble r
GLenum GLuint GLenum GLsizei const GLchar * buf
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
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
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
#define memcpy(s1, s2, n)
#define ERROR_FILE_NOT_FOUND
enum tagINSTALLTYPE INSTALLTYPE
@ INSTALLLOGATTRIBUTES_FLUSHEACHLINE
@ INSTALLLOGATTRIBUTES_APPEND
@ ADVERTISEFLAGS_USERASSIGN
@ ADVERTISEFLAGS_MACHINEASSIGN
@ INSTALLLOGMODE_ACTIONDATA
@ INSTALLLOGMODE_ACTIONSTART
@ INSTALLLOGMODE_FATALEXIT
@ INSTALLLOGMODE_PROPERTYDUMP
@ INSTALLLOGMODE_RESOLVESOURCE
@ INSTALLLOGMODE_COMMONDATA
@ INSTALLLOGMODE_INITIALIZE
@ INSTALLLOGMODE_TERMINATE
@ INSTALLLOGMODE_OUTOFDISKSPACE
@ INSTALLLOGMODE_PROGRESS
@ INSTALLLOGMODE_SHOWDIALOG
@ INSTALLTYPE_NETWORK_IMAGE
@ REINSTALLMODE_MACHINEDATA
@ REINSTALLMODE_FILEREPLACE
@ REINSTALLMODE_FILEOLDERVERSION
@ REINSTALLMODE_FILEEXACT
@ REINSTALLMODE_FILEEQUALVERSION
@ REINSTALLMODE_FILEVERIFY
@ REINSTALLMODE_FILEMISSING
enum tagINSTALLUILEVEL INSTALLUILEVEL
@ INSTALLUILEVEL_ENDDIALOG
@ INSTALLUILEVEL_HIDECANCEL
@ INSTALLUILEVEL_PROGRESSONLY
static BOOL IsProductCode(LPWSTR str)
HRESULT(WINAPI * DLLUNREGISTERSERVER)(void)
static BOOL msi_strprefix(LPCWSTR str1, LPCSTR str2)
static DWORD DoUnregServer(void)
static DWORD DoDllRegisterServer(LPCWSTR DllName)
void report_error(const char *msg,...)
static void ShowUsage(int ExitCode)
static VOID * LoadProc(LPCWSTR DllName, LPCSTR ProcName, HMODULE *DllHandle)
static int chomp(const WCHAR *in, WCHAR *out)
static LPWSTR build_transforms(struct string_list *transform_list)
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
static int custom_action_server(const WCHAR *arg)
UINT CDECL __wine_msi_call_dll_function(DWORD client_pid, const GUID *guid)
static BOOL msi_strequal(LPCWSTR str1, LPCSTR str2)
static LPWSTR build_properties(struct string_list *property_list)
static WCHAR * get_path_with_extension(const WCHAR *package_name)
static BOOL msi_option_prefix(LPCWSTR str1, LPCSTR str2)
static VOID StringListAppend(struct string_list **list, LPCWSTR str)
static WCHAR * remove_quotes(const WCHAR *filename)
static BOOL msi_option_equal(LPCWSTR str1, LPCSTR str2)
static DWORD DoDllUnregisterServer(LPCWSTR DllName)
static void process_args(WCHAR *cmdline, int *pargc, WCHAR ***pargv)
static DWORD DoRegServer(void)
static DWORD CALLBACK custom_action_thread(void *arg)
HRESULT(WINAPI * DLLREGISTERSERVER)(void)
static BOOL process_args_from_reg(const WCHAR *ident, int *pargc, WCHAR ***pargv)
static DWORD msi_atou(LPCWSTR str)
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8)
#define IsEqualGUID(rguid1, rguid2)
#define SC_MANAGER_CREATE_SERVICE
#define SC_MANAGER_CONNECT
#define SERVICES_ACTIVE_DATABASEW
BOOL WINAPI DeleteService(SC_HANDLE hService)
SC_HANDLE WINAPI OpenSCManagerW(LPCWSTR lpMachineName, LPCWSTR lpDatabaseName, DWORD dwDesiredAccess)
SC_HANDLE WINAPI OpenServiceW(SC_HANDLE hSCManager, LPCWSTR lpServiceName, DWORD dwDesiredAccess)
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)
BOOL WINAPI CloseServiceHandle(SC_HANDLE hSCObject)
XML_HIDDEN void xmlParserErrors const char const xmlChar const xmlChar * str2
XML_HIDDEN void xmlParserErrors const char const xmlChar * str1
struct string_list * next
#define FIELD_OFFSET(t, f)
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
DWORD WINAPI GetLastError(void)
#define LOAD_WITH_ALTERED_SEARCH_PATH
_In_ ULONG _In_ ULONG_PTR ident
#define ERROR_SERVICE_DOES_NOT_EXIST
#define ERROR_SERVICE_EXISTS
#define HKEY_LOCAL_MACHINE
#define SERVICE_DEMAND_START
#define SERVICE_WIN32_SHARE_PROCESS
#define SERVICE_ERROR_NORMAL