msi/tests: Test deferral of WriteEnvironmentStrings and RemoveEnvironmentStrings.

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:
Zebediah Figura 2018-05-30 20:47:34 -05:00 committed by Alexandre Julliard
parent 2765b47780
commit aae3d6b5af
3 changed files with 48 additions and 0 deletions

View File

@ -196,12 +196,25 @@ static const char env_install_exec_seq_dat[] =
"InstallInitialize\t\t500\n"
"ProcessComponents\t\t600\n"
"WriteEnvironmentStrings\t\t700\n"
"wes_immediate\tNOT REMOVE\t701\n"
"wes_deferred\tNOT REMOVE\t702\n"
"RemoveEnvironmentStrings\t\t800\n"
"res_immediate\tREMOVE\t801\n"
"res_deferred\tREMOVE\t802\n"
"RegisterProduct\t\t900\n"
"PublishFeatures\t\t1000\n"
"PublishProduct\t\t1100\n"
"InstallFinalize\t\t1200\n";
static const char env_custom_action_dat[] =
"Action\tType\tSource\tTarget\n"
"s72\ti2\tS64\tS0\n"
"CustomAction\tAction\n"
"wes_immediate\t1\tcustom.dll\tenv_absent\n"
"wes_deferred\t1025\tcustom.dll\tenv_present\n"
"res_immediate\t1\tcustom.dll\tenv_present\n"
"res_deferred\t1025\tcustom.dll\tenv_absent\n";
static const char env_environment_dat[] =
"Environment\tName\tValue\tComponent_\n"
"s72\tl255\tL255\ts72\n"
@ -1950,6 +1963,7 @@ static const msi_table env_tables[] =
ADD_TABLE(feature_comp),
ADD_TABLE(file),
ADD_TABLE(env_install_exec_seq),
ADD_TABLE(env_custom_action),
ADD_TABLE(media),
ADD_TABLE(property),
ADD_TABLE(env_environment)

View File

@ -1858,3 +1858,35 @@ todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED))
return ERROR_SUCCESS;
}
UINT WINAPI env_present(MSIHANDLE hinst)
{
HKEY key;
LONG res;
res = RegOpenKeyA(HKEY_CURRENT_USER, "Environment", &key);
ok(hinst, !res, "got %u\n", res);
todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) {
check_reg_str(hinst, key, "MSITESTVAR3", "1");
check_reg_str(hinst, key, "MSITESTVAR4", "1");
}
RegCloseKey(key);
return ERROR_SUCCESS;
}
UINT WINAPI env_absent(MSIHANDLE hinst)
{
HKEY key;
LONG res;
res = RegOpenKeyA(HKEY_CURRENT_USER, "Environment", &key);
ok(hinst, !res, "got %u\n", res);
todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) {
check_reg_str(hinst, key, "MSITESTVAR3", NULL);
check_reg_str(hinst, key, "MSITESTVAR4", NULL);
}
RegCloseKey(key);
return ERROR_SUCCESS;
}

View File

@ -7,6 +7,8 @@
@ stdcall cf_absent(long)
@ stdcall crs_present(long)
@ stdcall crs_absent(long)
@ stdcall env_present(long)
@ stdcall env_absent(long)
@ stdcall file_present(long)
@ stdcall file_absent(long)
@ stdcall font_present(long)