Implement patching in msiexec.
This commit is contained in:
parent
e720ac9a44
commit
bbc3974aa5
|
@ -573,6 +573,18 @@ UINT WINAPI MsiReinstallProductW(LPCWSTR szProduct, DWORD dwReinstallMode)
|
||||||
return ERROR_CALL_NOT_IMPLEMENTED;
|
return ERROR_CALL_NOT_IMPLEMENTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UINT WINAPI MsiApplyPatchA(LPCSTR szPatchPackage, LPCSTR szInstallPackage, INSTALLTYPE eInstallType, LPCSTR szCommandLine)
|
||||||
|
{
|
||||||
|
FIXME("%s %s %d %s\n", debugstr_a(szPatchPackage), debugstr_a(szInstallPackage), eInstallType, debugstr_a(szCommandLine));
|
||||||
|
return ERROR_CALL_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
UINT WINAPI MsiApplyPatchW(LPCWSTR szPatchPackage, LPCWSTR szInstallPackage, INSTALLTYPE eInstallType, LPCWSTR szCommandLine)
|
||||||
|
{
|
||||||
|
FIXME("%s %s %d %s\n", debugstr_w(szPatchPackage), debugstr_w(szInstallPackage), eInstallType, debugstr_w(szCommandLine));
|
||||||
|
return ERROR_CALL_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
UINT WINAPI MsiConfigureProductA(LPCSTR szProduct, int iInstallLevel, INSTALLSTATE eInstallState)
|
UINT WINAPI MsiConfigureProductA(LPCSTR szProduct, int iInstallLevel, INSTALLSTATE eInstallState)
|
||||||
{
|
{
|
||||||
LPWSTR szwProduct = NULL;
|
LPWSTR szwProduct = NULL;
|
||||||
|
|
|
@ -171,8 +171,8 @@
|
||||||
171 stdcall MsiFormatRecordW(long long ptr ptr)
|
171 stdcall MsiFormatRecordW(long long ptr ptr)
|
||||||
172 stdcall MsiGetComponentPathA(str str ptr ptr)
|
172 stdcall MsiGetComponentPathA(str str ptr ptr)
|
||||||
173 stdcall MsiGetComponentPathW(wstr wstr ptr ptr)
|
173 stdcall MsiGetComponentPathW(wstr wstr ptr ptr)
|
||||||
174 stub MsiApplyPatchA
|
174 stdcall MsiApplyPatchA(str str long str)
|
||||||
175 stub MsiApplyPatchW
|
175 stdcall MsiApplyPatchW(wstr wstr long wstr)
|
||||||
176 stub MsiAdvertiseScriptA
|
176 stub MsiAdvertiseScriptA
|
||||||
177 stub MsiAdvertiseScriptW
|
177 stub MsiAdvertiseScriptW
|
||||||
178 stub MsiGetPatchInfoA
|
178 stub MsiGetPatchInfoA
|
||||||
|
|
|
@ -129,6 +129,12 @@ typedef enum tagADVERTISEFLAGS
|
||||||
ADVERTISEFLAGS_USERASSIGN = 1
|
ADVERTISEFLAGS_USERASSIGN = 1
|
||||||
} ADVERTISEFLAGS;
|
} ADVERTISEFLAGS;
|
||||||
|
|
||||||
|
typedef enum tagINSTALLTYPE
|
||||||
|
{
|
||||||
|
INSTALLTYPE_DEFAULT = 0,
|
||||||
|
INSTALLTYPE_NETWORK_IMAGE = 1
|
||||||
|
} INSTALLTYPE;
|
||||||
|
|
||||||
#define MAX_FEATURE_CHARS 38
|
#define MAX_FEATURE_CHARS 38
|
||||||
|
|
||||||
typedef INT (CALLBACK *INSTALLUI_HANDLERA)(LPVOID pvContext, UINT iMessageType,
|
typedef INT (CALLBACK *INSTALLUI_HANDLERA)(LPVOID pvContext, UINT iMessageType,
|
||||||
|
@ -148,6 +154,10 @@ UINT WINAPI MsiReinstallProductA(LPCSTR, DWORD);
|
||||||
UINT WINAPI MsiReinstallProductW(LPCWSTR, DWORD);
|
UINT WINAPI MsiReinstallProductW(LPCWSTR, DWORD);
|
||||||
#define MsiReinstallProduct WINELIB_NAME_AW(MsiReinstallProduct)
|
#define MsiReinstallProduct WINELIB_NAME_AW(MsiReinstallProduct)
|
||||||
|
|
||||||
|
UINT WINAPI MsiApplyPatchA(LPCSTR, LPCSTR, INSTALLTYPE, LPCSTR);
|
||||||
|
UINT WINAPI MsiApplyPatchW(LPCWSTR, LPCWSTR, INSTALLTYPE, LPCWSTR);
|
||||||
|
#define MsiApplyPatch WINELIB_NAME_AW(MsiApplyPatch)
|
||||||
|
|
||||||
UINT WINAPI MsiEnumProductsA(DWORD index, LPSTR lpguid);
|
UINT WINAPI MsiEnumProductsA(DWORD index, LPSTR lpguid);
|
||||||
UINT WINAPI MsiEnumProductsW(DWORD index, LPWSTR lpguid);
|
UINT WINAPI MsiEnumProductsW(DWORD index, LPWSTR lpguid);
|
||||||
#define MsiEnumProducts WINELIB_NAME_AW(MsiEnumProducts)
|
#define MsiEnumProducts WINELIB_NAME_AW(MsiEnumProducts)
|
||||||
|
|
|
@ -43,8 +43,8 @@ static const char UsageStr[] =
|
||||||
" msiexec /j[u|m] package [/t transform] [/g languageid]\n"
|
" msiexec /j[u|m] package [/t transform] [/g languageid]\n"
|
||||||
" msiexec {u|m} package [/t transform] [/g languageid]\n"
|
" msiexec {u|m} package [/t transform] [/g languageid]\n"
|
||||||
" Apply a patch:\n"
|
" Apply a patch:\n"
|
||||||
" msiexec /p patchpackage [property] (UNIMPLEMENTED)\n"
|
" msiexec /p patchpackage [property]\n"
|
||||||
" msiexec /p patchpackage /a package [property] (UNIMPLEMENTED)\n"
|
" msiexec /p patchpackage /a package [property]\n"
|
||||||
" Modifiers for above operations:\n"
|
" Modifiers for above operations:\n"
|
||||||
" msiexec /l[*][i|w|e|a|r|u|c|m|o|p|v|][+|!] logfile\n"
|
" msiexec /l[*][i|w|e|a|r|u|c|m|o|p|v|][+|!] logfile\n"
|
||||||
" msiexec /q{|n|b|r|f|n+|b+|b-}\n"
|
" msiexec /q{|n|b|r|f|n+|b+|b-}\n"
|
||||||
|
@ -149,8 +149,10 @@ int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
BOOL FunctionInstall = FALSE;
|
BOOL FunctionInstall = FALSE;
|
||||||
|
BOOL FunctionInstallAdmin = FALSE;
|
||||||
BOOL FunctionRepair = FALSE;
|
BOOL FunctionRepair = FALSE;
|
||||||
BOOL FunctionAdvertise = FALSE;
|
BOOL FunctionAdvertise = FALSE;
|
||||||
|
BOOL FunctionPatch = FALSE;
|
||||||
BOOL FunctionDllRegisterServer = FALSE;
|
BOOL FunctionDllRegisterServer = FALSE;
|
||||||
BOOL FunctionDllUnregisterServer = FALSE;
|
BOOL FunctionDllUnregisterServer = FALSE;
|
||||||
|
|
||||||
|
@ -170,6 +172,9 @@ int main(int argc, char *argv[])
|
||||||
LPSTR LogFileName = NULL;
|
LPSTR LogFileName = NULL;
|
||||||
DWORD LogAttributes = 0;
|
DWORD LogAttributes = 0;
|
||||||
|
|
||||||
|
LPSTR PatchFileName = NULL;
|
||||||
|
INSTALLTYPE InstallType = INSTALLTYPE_DEFAULT;
|
||||||
|
|
||||||
INSTALLUILEVEL InstallUILevel = 0, retInstallUILevel;
|
INSTALLUILEVEL InstallUILevel = 0, retInstallUILevel;
|
||||||
|
|
||||||
LPSTR DllName = NULL;
|
LPSTR DllName = NULL;
|
||||||
|
@ -199,6 +204,8 @@ int main(int argc, char *argv[])
|
||||||
else if(!strcasecmp(argv[i], "/a"))
|
else if(!strcasecmp(argv[i], "/a"))
|
||||||
{
|
{
|
||||||
FunctionInstall = TRUE;
|
FunctionInstall = TRUE;
|
||||||
|
FunctionInstallAdmin = TRUE;
|
||||||
|
InstallType = INSTALLTYPE_NETWORK_IMAGE;
|
||||||
i++;
|
i++;
|
||||||
if(i >= argc)
|
if(i >= argc)
|
||||||
ShowUsage(1);
|
ShowUsage(1);
|
||||||
|
@ -486,12 +493,12 @@ int main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
else if(!strcasecmp(argv[i], "/p"))
|
else if(!strcasecmp(argv[i], "/p"))
|
||||||
{
|
{
|
||||||
|
FunctionPatch = TRUE;
|
||||||
i++;
|
i++;
|
||||||
if(i >= argc)
|
if(i >= argc)
|
||||||
ShowUsage(1);
|
ShowUsage(1);
|
||||||
WINE_TRACE("argv[%d] = %s\n", i, argv[i]);
|
WINE_TRACE("argv[%d] = %s\n", i, argv[i]);
|
||||||
WINE_FIXME("Patching not yet implemented\n");
|
PatchFileName = argv[i];
|
||||||
ExitProcess(1);
|
|
||||||
}
|
}
|
||||||
else if(!strncasecmp(argv[i], "/q", 2))
|
else if(!strncasecmp(argv[i], "/q", 2))
|
||||||
{
|
{
|
||||||
|
@ -581,6 +588,9 @@ int main(int argc, char *argv[])
|
||||||
Transforms = TempStr;
|
Transforms = TempStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(FunctionInstallAdmin && FunctionPatch)
|
||||||
|
FunctionInstall = FALSE;
|
||||||
|
|
||||||
if(FunctionInstall)
|
if(FunctionInstall)
|
||||||
{
|
{
|
||||||
if(GotProductCode)
|
if(GotProductCode)
|
||||||
|
@ -621,6 +631,14 @@ int main(int argc, char *argv[])
|
||||||
ExitProcess(1);
|
ExitProcess(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if(FunctionPatch)
|
||||||
|
{
|
||||||
|
if(MsiApplyPatchA(PatchFileName, PackageName, InstallType, Properties) != ERROR_SUCCESS)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "Patching with %s (%s, %d, %s)\n", PatchFileName, PackageName, InstallType, Properties);
|
||||||
|
ExitProcess(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
else if(FunctionDllRegisterServer)
|
else if(FunctionDllRegisterServer)
|
||||||
{
|
{
|
||||||
DllRegisterServer(DllName);
|
DllRegisterServer(DllName);
|
||||||
|
|
Loading…
Reference in New Issue