[WINESYNC] 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>

wine commit id aae3d6b5afaa67530ee62f922a301fce1967151a by Zebediah Figura <z.figura12@gmail.com>
This commit is contained in:
winesync 2022-03-12 16:34:02 +01:00 committed by Mark Jansen
parent 7b0084e68a
commit 39c835f2a3
No known key found for this signature in database
GPG key ID: B39240EE84BEAE8B
3 changed files with 48 additions and 0 deletions

View file

@ -199,12 +199,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"
@ -1953,6 +1966,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)