Implement patching in msiexec.

This commit is contained in:
Vincent Béron 2004-07-29 02:39:20 +00:00 committed by Alexandre Julliard
parent e720ac9a44
commit bbc3974aa5
4 changed files with 46 additions and 6 deletions

View File

@ -573,6 +573,18 @@ UINT WINAPI MsiReinstallProductW(LPCWSTR szProduct, DWORD dwReinstallMode)
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)
{
LPWSTR szwProduct = NULL;

View File

@ -171,8 +171,8 @@
171 stdcall MsiFormatRecordW(long long ptr ptr)
172 stdcall MsiGetComponentPathA(str str ptr ptr)
173 stdcall MsiGetComponentPathW(wstr wstr ptr ptr)
174 stub MsiApplyPatchA
175 stub MsiApplyPatchW
174 stdcall MsiApplyPatchA(str str long str)
175 stdcall MsiApplyPatchW(wstr wstr long wstr)
176 stub MsiAdvertiseScriptA
177 stub MsiAdvertiseScriptW
178 stub MsiGetPatchInfoA

View File

@ -129,6 +129,12 @@ typedef enum tagADVERTISEFLAGS
ADVERTISEFLAGS_USERASSIGN = 1
} ADVERTISEFLAGS;
typedef enum tagINSTALLTYPE
{
INSTALLTYPE_DEFAULT = 0,
INSTALLTYPE_NETWORK_IMAGE = 1
} INSTALLTYPE;
#define MAX_FEATURE_CHARS 38
typedef INT (CALLBACK *INSTALLUI_HANDLERA)(LPVOID pvContext, UINT iMessageType,
@ -148,6 +154,10 @@ UINT WINAPI MsiReinstallProductA(LPCSTR, DWORD);
UINT WINAPI MsiReinstallProductW(LPCWSTR, DWORD);
#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 MsiEnumProductsW(DWORD index, LPWSTR lpguid);
#define MsiEnumProducts WINELIB_NAME_AW(MsiEnumProducts)

View File

@ -43,8 +43,8 @@ static const char UsageStr[] =
" msiexec /j[u|m] package [/t transform] [/g languageid]\n"
" msiexec {u|m} package [/t transform] [/g languageid]\n"
" Apply a patch:\n"
" msiexec /p patchpackage [property] (UNIMPLEMENTED)\n"
" msiexec /p patchpackage /a package [property] (UNIMPLEMENTED)\n"
" msiexec /p patchpackage [property]\n"
" msiexec /p patchpackage /a package [property]\n"
" Modifiers for above operations:\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"
@ -149,8 +149,10 @@ int main(int argc, char *argv[])
{
int i;
BOOL FunctionInstall = FALSE;
BOOL FunctionInstallAdmin = FALSE;
BOOL FunctionRepair = FALSE;
BOOL FunctionAdvertise = FALSE;
BOOL FunctionPatch = FALSE;
BOOL FunctionDllRegisterServer = FALSE;
BOOL FunctionDllUnregisterServer = FALSE;
@ -170,6 +172,9 @@ int main(int argc, char *argv[])
LPSTR LogFileName = NULL;
DWORD LogAttributes = 0;
LPSTR PatchFileName = NULL;
INSTALLTYPE InstallType = INSTALLTYPE_DEFAULT;
INSTALLUILEVEL InstallUILevel = 0, retInstallUILevel;
LPSTR DllName = NULL;
@ -199,6 +204,8 @@ int main(int argc, char *argv[])
else if(!strcasecmp(argv[i], "/a"))
{
FunctionInstall = TRUE;
FunctionInstallAdmin = TRUE;
InstallType = INSTALLTYPE_NETWORK_IMAGE;
i++;
if(i >= argc)
ShowUsage(1);
@ -486,12 +493,12 @@ int main(int argc, char *argv[])
}
else if(!strcasecmp(argv[i], "/p"))
{
FunctionPatch = TRUE;
i++;
if(i >= argc)
ShowUsage(1);
WINE_TRACE("argv[%d] = %s\n", i, argv[i]);
WINE_FIXME("Patching not yet implemented\n");
ExitProcess(1);
PatchFileName = argv[i];
}
else if(!strncasecmp(argv[i], "/q", 2))
{
@ -581,6 +588,9 @@ int main(int argc, char *argv[])
Transforms = TempStr;
}
if(FunctionInstallAdmin && FunctionPatch)
FunctionInstall = FALSE;
if(FunctionInstall)
{
if(GotProductCode)
@ -621,6 +631,14 @@ int main(int argc, char *argv[])
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)
{
DllRegisterServer(DllName);