msi/tests: Test deferral of MsiPublishAssemblies and MsiUnpublishAssemblies.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Hans Leidekker <hans@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
7b5668a6e7
commit
6eb7440914
|
@ -1733,12 +1733,25 @@ static const char pa_install_exec_seq_dat[] =
|
|||
"InstallInitialize\t\t1500\n"
|
||||
"ProcessComponents\t\t1600\n"
|
||||
"MsiPublishAssemblies\t\t3000\n"
|
||||
"pa_immediate\tNOT REMOVE AND NOT ALLUSERS\t3001\n"
|
||||
"pa_deferred\tNOT REMOVE AND NOT ALLUSERS\t3002\n"
|
||||
"MsiUnpublishAssemblies\t\t4000\n"
|
||||
"ua_immediate\tREMOVE AND NOT ALLUSERS\t4001\n"
|
||||
"ua_deferred\tREMOVE AND NOT ALLUSERS\t4002\n"
|
||||
"RegisterProduct\t\t5000\n"
|
||||
"PublishFeatures\t\t5100\n"
|
||||
"PublishProduct\t\t5200\n"
|
||||
"InstallFinalize\t\t6000\n";
|
||||
|
||||
static const char pa_custom_action_dat[] =
|
||||
"Action\tType\tSource\tTarget\n"
|
||||
"s72\ti2\tS64\tS0\n"
|
||||
"CustomAction\tAction\n"
|
||||
"pa_immediate\t1\tcustom.dll\tpa_absent\n"
|
||||
"pa_deferred\t1025\tcustom.dll\tpa_present\n"
|
||||
"ua_immediate\t1\tcustom.dll\tpa_present\n"
|
||||
"ua_deferred\t1025\tcustom.dll\tpa_absent\n";
|
||||
|
||||
static const char rep_file_dat[] =
|
||||
"File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
|
||||
"s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
|
||||
|
@ -2191,6 +2204,7 @@ static const msi_table pa_tables[] =
|
|||
ADD_TABLE(pa_msi_assembly),
|
||||
ADD_TABLE(pa_msi_assembly_name),
|
||||
ADD_TABLE(pa_install_exec_seq),
|
||||
ADD_TABLE(pa_custom_action),
|
||||
ADD_TABLE(media),
|
||||
ADD_TABLE(property)
|
||||
};
|
||||
|
|
|
@ -1379,3 +1379,58 @@ todo_wine {
|
|||
}
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
static void check_reg_str(MSIHANDLE hinst, HKEY key, const char *name, const char *expect)
|
||||
{
|
||||
char value[300];
|
||||
DWORD sz;
|
||||
LONG res;
|
||||
|
||||
sz = sizeof(value);
|
||||
res = RegQueryValueExA(key, name, NULL, NULL, (BYTE *)value, &sz);
|
||||
if (expect)
|
||||
{
|
||||
ok(hinst, !res, "failed to get value \"%s\": %d\n", name, res);
|
||||
ok(hinst, !strcmp(value, expect), "\"%s\": expected \"%s\", got \"%s\"\n",
|
||||
name, expect, value);
|
||||
}
|
||||
else
|
||||
ok(hinst, res == ERROR_FILE_NOT_FOUND, "\"%s\": expected missing, got %u\n",
|
||||
name, res);
|
||||
}
|
||||
|
||||
static const char path_dotnet[] = "Software\\Microsoft\\Installer\\Assemblies\\Global";
|
||||
static const char name_dotnet[] = "Wine.Dotnet.Assembly,processorArchitecture=\"MSIL\","
|
||||
"publicKeyToken=\"abcdef0123456789\",version=\"1.0.0.0\",culture=\"neutral\"";
|
||||
|
||||
UINT WINAPI pa_present(MSIHANDLE hinst)
|
||||
{
|
||||
HKEY key;
|
||||
LONG res;
|
||||
|
||||
res = RegOpenKeyA(HKEY_CURRENT_USER, path_dotnet, &key);
|
||||
ok(hinst, !res, "got %d\n", res);
|
||||
todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) {
|
||||
check_reg_str(hinst, key, name_dotnet, "rcHQPHq?CA@Uv-XqMI1e>Z'q,T*76M@=YEg6My?~]");
|
||||
}
|
||||
RegCloseKey(key);
|
||||
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
UINT WINAPI pa_absent(MSIHANDLE hinst)
|
||||
{
|
||||
HKEY key;
|
||||
LONG res;
|
||||
|
||||
res = RegOpenKeyA(HKEY_CURRENT_USER, path_dotnet, &key);
|
||||
ok(hinst, !res || res == ERROR_FILE_NOT_FOUND, "got %d\n", res);
|
||||
if (!res)
|
||||
{
|
||||
todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) {
|
||||
check_reg_str(hinst, key, name_dotnet, NULL);
|
||||
}
|
||||
RegCloseKey(key);
|
||||
}
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
@ stdcall mov_absent(long)
|
||||
@ stdcall odbc_present(long)
|
||||
@ stdcall odbc_absent(long)
|
||||
@ stdcall pa_present(long)
|
||||
@ stdcall pa_absent(long)
|
||||
@ stdcall rd_present(long)
|
||||
@ stdcall rd_absent(long)
|
||||
@ stdcall sds_present(long)
|
||||
|
|
Loading…
Reference in New Issue