Skip to content

Commit 5239ed5

Browse files
winesynclearn-more
authored andcommitted
[WINESYNC] msi/tests: Test deferral of WriteIniValues and RemoveIniValues.
Signed-off-by: Zebediah Figura <[email protected]> Signed-off-by: Hans Leidekker <[email protected]> Signed-off-by: Alexandre Julliard <[email protected]> wine commit id 377d32c4fb6ea72c68436eb590541ec88d0c74f9 by Zebediah Figura <[email protected]>
1 parent 759a987 commit 5239ed5

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
@@ -1457,12 +1457,25 @@ static const char ini_install_exec_seq_dat[] =
14571457
"RemoveFiles\t\t1700\n"
14581458
"InstallFiles\t\t2000\n"
14591459
"RemoveIniValues\t\t3000\n"
1460+
"riv_immediate\tREMOVE\t3001\n"
1461+
"riv_deferred\tREMOVE\t3002\n"
14601462
"WriteIniValues\t\t3100\n"
1463+
"wiv_immediate\tNOT REMOVE\t3101\n"
1464+
"wiv_deferred\tNOT REMOVE\t3102\n"
14611465
"RegisterProduct\t\t5000\n"
14621466
"PublishFeatures\t\t5100\n"
14631467
"PublishProduct\t\t5200\n"
14641468
"InstallFinalize\t\t6000\n";
14651469

1470+
static const char ini_custom_action_dat[] =
1471+
"Action\tType\tSource\tTarget\n"
1472+
"s72\ti2\tS64\tS0\n"
1473+
"CustomAction\tAction\n"
1474+
"wiv_immediate\t1\tcustom.dll\tini_absent\n"
1475+
"wiv_deferred\t1025\tcustom.dll\tini_present\n"
1476+
"riv_immediate\t1\tcustom.dll\tini_present\n"
1477+
"riv_deferred\t1025\tcustom.dll\tini_absent\n";
1478+
14661479
static const char rci_file_dat[] =
14671480
"File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
14681481
"s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
@@ -2260,6 +2273,7 @@ static const msi_table ini_tables[] =
22602273
ADD_TABLE(ini_ini_file),
22612274
ADD_TABLE(ini_remove_ini_file),
22622275
ADD_TABLE(ini_install_exec_seq),
2276+
ADD_TABLE(ini_custom_action),
22632277
ADD_TABLE(media),
22642278
ADD_TABLE(property)
22652279
};

modules/rostests/winetests/msi/custom.c

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

18911891
return ERROR_SUCCESS;
18921892
}
1893+
1894+
UINT WINAPI ini_present(MSIHANDLE hinst)
1895+
{
1896+
char path[MAX_PATH], buf[10];
1897+
DWORD len;
1898+
1899+
if (FAILED(SHGetFolderPathA(NULL, CSIDL_PROGRAM_FILESX86, NULL, 0, path)))
1900+
SHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES, NULL, 0, path);
1901+
strcat(path, "\\msitest\\test.ini");
1902+
1903+
len = GetPrivateProfileStringA("section1", "key1", NULL, buf, sizeof(buf), path);
1904+
todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED))
1905+
ok(hinst, len == 6, "got %u\n", len);
1906+
1907+
return ERROR_SUCCESS;
1908+
}
1909+
1910+
UINT WINAPI ini_absent(MSIHANDLE hinst)
1911+
{
1912+
char path[MAX_PATH], buf[10];
1913+
DWORD len;
1914+
1915+
if (FAILED(SHGetFolderPathA(NULL, CSIDL_PROGRAM_FILESX86, NULL, 0, path)))
1916+
SHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES, NULL, 0, path);
1917+
strcat(path, "\\msitest\\test.ini");
1918+
1919+
len = GetPrivateProfileStringA("section1", "key1", NULL, buf, sizeof(buf), path);
1920+
todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED))
1921+
ok(hinst, !len, "got %u\n", len);
1922+
1923+
return ERROR_SUCCESS;
1924+
}

modules/rostests/winetests/msi/custom.spec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
@ stdcall file_absent(long)
1414
@ stdcall font_present(long)
1515
@ stdcall font_absent(long)
16+
@ stdcall ini_present(long)
17+
@ stdcall ini_absent(long)
1618
@ stdcall mov_present(long)
1719
@ stdcall mov_absent(long)
1820
@ stdcall odbc_present(long)

0 commit comments

Comments
 (0)