[WINESYNC] msi/tests: Test deferral of WriteIniValues and RemoveIniValues.

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 377d32c4fb6ea72c68436eb590541ec88d0c74f9 by Zebediah Figura <z.figura12@gmail.com>
This commit is contained in:
winesync 2022-03-12 16:34:03 +01:00 committed by Mark Jansen
parent 759a987243
commit 5239ed572c
No known key found for this signature in database
GPG key ID: B39240EE84BEAE8B
3 changed files with 48 additions and 0 deletions

View file

@ -1457,12 +1457,25 @@ static const char ini_install_exec_seq_dat[] =
"RemoveFiles\t\t1700\n"
"InstallFiles\t\t2000\n"
"RemoveIniValues\t\t3000\n"
"riv_immediate\tREMOVE\t3001\n"
"riv_deferred\tREMOVE\t3002\n"
"WriteIniValues\t\t3100\n"
"wiv_immediate\tNOT REMOVE\t3101\n"
"wiv_deferred\tNOT REMOVE\t3102\n"
"RegisterProduct\t\t5000\n"
"PublishFeatures\t\t5100\n"
"PublishProduct\t\t5200\n"
"InstallFinalize\t\t6000\n";
static const char ini_custom_action_dat[] =
"Action\tType\tSource\tTarget\n"
"s72\ti2\tS64\tS0\n"
"CustomAction\tAction\n"
"wiv_immediate\t1\tcustom.dll\tini_absent\n"
"wiv_deferred\t1025\tcustom.dll\tini_present\n"
"riv_immediate\t1\tcustom.dll\tini_present\n"
"riv_deferred\t1025\tcustom.dll\tini_absent\n";
static const char rci_file_dat[] =
"File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
"s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
@ -2260,6 +2273,7 @@ static const msi_table ini_tables[] =
ADD_TABLE(ini_ini_file),
ADD_TABLE(ini_remove_ini_file),
ADD_TABLE(ini_install_exec_seq),
ADD_TABLE(ini_custom_action),
ADD_TABLE(media),
ADD_TABLE(property)
};

View file

@ -1890,3 +1890,35 @@ todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) {
return ERROR_SUCCESS;
}
UINT WINAPI ini_present(MSIHANDLE hinst)
{
char path[MAX_PATH], buf[10];
DWORD len;
if (FAILED(SHGetFolderPathA(NULL, CSIDL_PROGRAM_FILESX86, NULL, 0, path)))
SHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES, NULL, 0, path);
strcat(path, "\\msitest\\test.ini");
len = GetPrivateProfileStringA("section1", "key1", NULL, buf, sizeof(buf), path);
todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED))
ok(hinst, len == 6, "got %u\n", len);
return ERROR_SUCCESS;
}
UINT WINAPI ini_absent(MSIHANDLE hinst)
{
char path[MAX_PATH], buf[10];
DWORD len;
if (FAILED(SHGetFolderPathA(NULL, CSIDL_PROGRAM_FILESX86, NULL, 0, path)))
SHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES, NULL, 0, path);
strcat(path, "\\msitest\\test.ini");
len = GetPrivateProfileStringA("section1", "key1", NULL, buf, sizeof(buf), path);
todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED))
ok(hinst, !len, "got %u\n", len);
return ERROR_SUCCESS;
}

View file

@ -13,6 +13,8 @@
@ stdcall file_absent(long)
@ stdcall font_present(long)
@ stdcall font_absent(long)
@ stdcall ini_present(long)
@ stdcall ini_absent(long)
@ stdcall mov_present(long)
@ stdcall mov_absent(long)
@ stdcall odbc_present(long)