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>
This commit is contained in:
Zebediah Figura 2018-05-30 20:47:36 -05:00 committed by Alexandre Julliard
parent 1a78380e6f
commit 377d32c4fb
3 changed files with 48 additions and 0 deletions

View File

@ -1454,12 +1454,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"
@ -2257,6 +2270,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)