Skip to content

Commit 39c835f

Browse files
winesynclearn-more
authored andcommitted
[WINESYNC] msi/tests: Test deferral of WriteEnvironmentStrings and RemoveEnvironmentStrings.
Signed-off-by: Zebediah Figura <[email protected]> Signed-off-by: Hans Leidekker <[email protected]> Signed-off-by: Alexandre Julliard <[email protected]> wine commit id aae3d6b5afaa67530ee62f922a301fce1967151a by Zebediah Figura <[email protected]>
1 parent 7b0084e commit 39c835f

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed

modules/rostests/winetests/msi/action.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,12 +199,25 @@ static const char env_install_exec_seq_dat[] =
199199
"InstallInitialize\t\t500\n"
200200
"ProcessComponents\t\t600\n"
201201
"WriteEnvironmentStrings\t\t700\n"
202+
"wes_immediate\tNOT REMOVE\t701\n"
203+
"wes_deferred\tNOT REMOVE\t702\n"
202204
"RemoveEnvironmentStrings\t\t800\n"
205+
"res_immediate\tREMOVE\t801\n"
206+
"res_deferred\tREMOVE\t802\n"
203207
"RegisterProduct\t\t900\n"
204208
"PublishFeatures\t\t1000\n"
205209
"PublishProduct\t\t1100\n"
206210
"InstallFinalize\t\t1200\n";
207211

212+
static const char env_custom_action_dat[] =
213+
"Action\tType\tSource\tTarget\n"
214+
"s72\ti2\tS64\tS0\n"
215+
"CustomAction\tAction\n"
216+
"wes_immediate\t1\tcustom.dll\tenv_absent\n"
217+
"wes_deferred\t1025\tcustom.dll\tenv_present\n"
218+
"res_immediate\t1\tcustom.dll\tenv_present\n"
219+
"res_deferred\t1025\tcustom.dll\tenv_absent\n";
220+
208221
static const char env_environment_dat[] =
209222
"Environment\tName\tValue\tComponent_\n"
210223
"s72\tl255\tL255\ts72\n"
@@ -1953,6 +1966,7 @@ static const msi_table env_tables[] =
19531966
ADD_TABLE(feature_comp),
19541967
ADD_TABLE(file),
19551968
ADD_TABLE(env_install_exec_seq),
1969+
ADD_TABLE(env_custom_action),
19561970
ADD_TABLE(media),
19571971
ADD_TABLE(property),
19581972
ADD_TABLE(env_environment)

modules/rostests/winetests/msi/custom.c

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1858,3 +1858,35 @@ todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED))
18581858

18591859
return ERROR_SUCCESS;
18601860
}
1861+
1862+
UINT WINAPI env_present(MSIHANDLE hinst)
1863+
{
1864+
HKEY key;
1865+
LONG res;
1866+
1867+
res = RegOpenKeyA(HKEY_CURRENT_USER, "Environment", &key);
1868+
ok(hinst, !res, "got %u\n", res);
1869+
todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) {
1870+
check_reg_str(hinst, key, "MSITESTVAR3", "1");
1871+
check_reg_str(hinst, key, "MSITESTVAR4", "1");
1872+
}
1873+
RegCloseKey(key);
1874+
1875+
return ERROR_SUCCESS;
1876+
}
1877+
1878+
UINT WINAPI env_absent(MSIHANDLE hinst)
1879+
{
1880+
HKEY key;
1881+
LONG res;
1882+
1883+
res = RegOpenKeyA(HKEY_CURRENT_USER, "Environment", &key);
1884+
ok(hinst, !res, "got %u\n", res);
1885+
todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) {
1886+
check_reg_str(hinst, key, "MSITESTVAR3", NULL);
1887+
check_reg_str(hinst, key, "MSITESTVAR4", NULL);
1888+
}
1889+
RegCloseKey(key);
1890+
1891+
return ERROR_SUCCESS;
1892+
}

modules/rostests/winetests/msi/custom.spec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
@ stdcall cf_absent(long)
88
@ stdcall crs_present(long)
99
@ stdcall crs_absent(long)
10+
@ stdcall env_present(long)
11+
@ stdcall env_absent(long)
1012
@ stdcall file_present(long)
1113
@ stdcall file_absent(long)
1214
@ stdcall font_present(long)

0 commit comments

Comments
 (0)