msi/tests: Move some tests around to avoid timeouts on the testbot.
This commit is contained in:
parent
4df4339f8e
commit
b82a5ab27a
|
@ -38,8 +38,6 @@ static UINT (WINAPI *pMsiQueryComponentStateA)
|
|||
(LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPCSTR, INSTALLSTATE*);
|
||||
static UINT (WINAPI *pMsiSourceListEnumSourcesA)
|
||||
(LPCSTR, LPCSTR, MSIINSTALLCONTEXT, DWORD, DWORD, LPSTR, LPDWORD);
|
||||
static UINT (WINAPI *pMsiSourceListGetInfoA)
|
||||
(LPCSTR, LPCSTR, MSIINSTALLCONTEXT, DWORD, LPCSTR, LPSTR, LPDWORD);
|
||||
static INSTALLSTATE (WINAPI *pMsiGetComponentPathExA)
|
||||
(LPCSTR, LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPSTR, LPDWORD);
|
||||
|
||||
|
@ -496,11 +494,6 @@ static const CHAR rofc_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\
|
|||
"Media\tDiskId\n"
|
||||
"1\t1\t\ttest1.cab\tDISK1\t\n";
|
||||
|
||||
static const CHAR lus2_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
|
||||
"i2\ti4\tL64\tS255\tS32\tS72\n"
|
||||
"Media\tDiskId\n"
|
||||
"1\t1\t\t#test1.cab\tDISK1\t\n";
|
||||
|
||||
static const CHAR sdp_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
|
||||
"s72\tS255\tI2\n"
|
||||
"InstallExecuteSequence\tAction\n"
|
||||
|
@ -602,33 +595,6 @@ static const CHAR ci2_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersio
|
|||
"File\tFile\n"
|
||||
"augustus\taugustus\taugustus\t500\t\t\t8192\t1";
|
||||
|
||||
static const CHAR spf_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
|
||||
"s72\ti2\tS64\tS0\tS255\n"
|
||||
"CustomAction\tAction\n"
|
||||
"SetFolderProp\t51\tMSITESTDIR\t[ProgramFilesFolder]\\msitest\\added\t\n";
|
||||
|
||||
static const CHAR spf_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
|
||||
"s72\tS255\tI2\n"
|
||||
"InstallExecuteSequence\tAction\n"
|
||||
"CostFinalize\t\t1000\n"
|
||||
"CostInitialize\t\t800\n"
|
||||
"FileCost\t\t900\n"
|
||||
"SetFolderProp\t\t950\n"
|
||||
"InstallFiles\t\t4000\n"
|
||||
"InstallServices\t\t5000\n"
|
||||
"InstallFinalize\t\t6600\n"
|
||||
"InstallInitialize\t\t1500\n"
|
||||
"InstallValidate\t\t1400\n"
|
||||
"LaunchConditions\t\t100";
|
||||
|
||||
static const CHAR spf_install_ui_seq_dat[] = "Action\tCondition\tSequence\n"
|
||||
"s72\tS255\tI2\n"
|
||||
"InstallUISequence\tAction\n"
|
||||
"CostInitialize\t\t800\n"
|
||||
"FileCost\t\t900\n"
|
||||
"CostFinalize\t\t1000\n"
|
||||
"ExecuteAction\t\t1100\n";
|
||||
|
||||
static const CHAR pp_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
|
||||
"s72\tS255\tI2\n"
|
||||
"InstallExecuteSequence\tAction\n"
|
||||
|
@ -1042,140 +1008,6 @@ static const CHAR fo_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
|
|||
"PublishProduct\t\t5200\n"
|
||||
"InstallFinalize\t\t6000\n";
|
||||
|
||||
static const CHAR sd_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
|
||||
"s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
|
||||
"File\tFile\n"
|
||||
"sourcedir.txt\tsourcedir\tsourcedir.txt\t1000\t\t\t8192\t1\n";
|
||||
|
||||
static const CHAR sd_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
|
||||
"s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
|
||||
"Feature\tFeature\n"
|
||||
"sourcedir\t\t\tsourcedir feature\t1\t2\tMSITESTDIR\t0\n";
|
||||
|
||||
static const CHAR sd_feature_comp_dat[] = "Feature_\tComponent_\n"
|
||||
"s38\ts72\n"
|
||||
"FeatureComponents\tFeature_\tComponent_\n"
|
||||
"sourcedir\tsourcedir\n";
|
||||
|
||||
static const CHAR sd_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
|
||||
"s72\tS38\ts72\ti2\tS255\tS72\n"
|
||||
"Component\tComponent\n"
|
||||
"sourcedir\t{DD422F92-3ED8-49B5-A0B7-F266F98357DF}\tMSITESTDIR\t0\t\tsourcedir.txt\n";
|
||||
|
||||
static const CHAR sd_install_ui_seq_dat[] = "Action\tCondition\tSequence\n"
|
||||
"s72\tS255\tI2\n"
|
||||
"InstallUISequence\tAction\n"
|
||||
"TestSourceDirProp1\tnot SourceDir and not SOURCEDIR and not Installed\t99\n"
|
||||
"AppSearch\t\t100\n"
|
||||
"TestSourceDirProp2\tnot SourceDir and not SOURCEDIR and not Installed\t101\n"
|
||||
"LaunchConditions\tnot Installed \t110\n"
|
||||
"TestSourceDirProp3\tnot SourceDir and not SOURCEDIR and not Installed\t111\n"
|
||||
"FindRelatedProducts\t\t120\n"
|
||||
"TestSourceDirProp4\tnot SourceDir and not SOURCEDIR and not Installed\t121\n"
|
||||
"CCPSearch\t\t130\n"
|
||||
"TestSourceDirProp5\tnot SourceDir and not SOURCEDIR and not Installed\t131\n"
|
||||
"RMCCPSearch\t\t140\n"
|
||||
"TestSourceDirProp6\tnot SourceDir and not SOURCEDIR and not Installed\t141\n"
|
||||
"ValidateProductID\t\t150\n"
|
||||
"TestSourceDirProp7\tnot SourceDir and not SOURCEDIR and not Installed\t151\n"
|
||||
"CostInitialize\t\t800\n"
|
||||
"TestSourceDirProp8\tnot SourceDir and not SOURCEDIR and not Installed\t801\n"
|
||||
"FileCost\t\t900\n"
|
||||
"TestSourceDirProp9\tnot SourceDir and not SOURCEDIR and not Installed\t901\n"
|
||||
"IsolateComponents\t\t1000\n"
|
||||
"TestSourceDirProp10\tnot SourceDir and not SOURCEDIR and not Installed\t1001\n"
|
||||
"CostFinalize\t\t1100\n"
|
||||
"TestSourceDirProp11\tnot SourceDir and not SOURCEDIR and not Installed\t1101\n"
|
||||
"MigrateFeatureStates\t\t1200\n"
|
||||
"TestSourceDirProp12\tnot SourceDir and not SOURCEDIR and not Installed\t1201\n"
|
||||
"ExecuteAction\t\t1300\n"
|
||||
"TestSourceDirProp13\tnot SourceDir and not SOURCEDIR and not Installed\t1301\n";
|
||||
|
||||
static const CHAR sd_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
|
||||
"s72\tS255\tI2\n"
|
||||
"InstallExecuteSequence\tAction\n"
|
||||
"TestSourceDirProp14\tSourceDir and SOURCEDIR and not Installed\t99\n"
|
||||
"LaunchConditions\t\t100\n"
|
||||
"TestSourceDirProp15\tSourceDir and SOURCEDIR and not Installed\t101\n"
|
||||
"ValidateProductID\t\t700\n"
|
||||
"TestSourceDirProp16\tSourceDir and SOURCEDIR and not Installed\t701\n"
|
||||
"CostInitialize\t\t800\n"
|
||||
"TestSourceDirProp17\tSourceDir and SOURCEDIR and not Installed\t801\n"
|
||||
"ResolveSource\tResolveSource and not Installed\t850\n"
|
||||
"TestSourceDirProp18\tResolveSource and not SourceDir and not SOURCEDIR and not Installed\t851\n"
|
||||
"TestSourceDirProp19\tnot ResolveSource and SourceDir and SOURCEDIR and not Installed\t852\n"
|
||||
"FileCost\t\t900\n"
|
||||
"TestSourceDirProp20\tSourceDir and SOURCEDIR and not Installed\t901\n"
|
||||
"IsolateComponents\t\t1000\n"
|
||||
"TestSourceDirProp21\tSourceDir and SOURCEDIR and not Installed\t1001\n"
|
||||
"CostFinalize\t\t1100\n"
|
||||
"TestSourceDirProp22\tSourceDir and SOURCEDIR and not Installed\t1101\n"
|
||||
"MigrateFeatureStates\t\t1200\n"
|
||||
"TestSourceDirProp23\tSourceDir and SOURCEDIR and not Installed\t1201\n"
|
||||
"InstallValidate\t\t1400\n"
|
||||
"TestSourceDirProp24\tSourceDir and SOURCEDIR and not Installed\t1401\n"
|
||||
"InstallInitialize\t\t1500\n"
|
||||
"TestSourceDirProp25\tSourceDir and SOURCEDIR and not Installed\t1501\n"
|
||||
"ProcessComponents\t\t1600\n"
|
||||
"TestSourceDirProp26\tnot SourceDir and not SOURCEDIR and not Installed\t1601\n"
|
||||
"UnpublishFeatures\t\t1800\n"
|
||||
"TestSourceDirProp27\tnot SourceDir and not SOURCEDIR and not Installed\t1801\n"
|
||||
"RemoveFiles\t\t3500\n"
|
||||
"TestSourceDirProp28\tnot SourceDir and not SOURCEDIR and not Installed\t3501\n"
|
||||
"InstallFiles\t\t4000\n"
|
||||
"TestSourceDirProp29\tnot SourceDir and not SOURCEDIR and not Installed\t4001\n"
|
||||
"RegisterUser\t\t6000\n"
|
||||
"TestSourceDirProp30\tnot SourceDir and not SOURCEDIR and not Installed\t6001\n"
|
||||
"RegisterProduct\t\t6100\n"
|
||||
"TestSourceDirProp31\tnot SourceDir and not SOURCEDIR and not Installed\t6101\n"
|
||||
"PublishFeatures\t\t6300\n"
|
||||
"TestSourceDirProp32\tnot SourceDir and not SOURCEDIR and not Installed\t6301\n"
|
||||
"PublishProduct\t\t6400\n"
|
||||
"TestSourceDirProp33\tnot SourceDir and not SOURCEDIR and not Installed\t6401\n"
|
||||
"InstallExecute\t\t6500\n"
|
||||
"TestSourceDirProp34\tnot SourceDir and not SOURCEDIR and not Installed\t6501\n"
|
||||
"InstallFinalize\t\t6600\n"
|
||||
"TestSourceDirProp35\tnot SourceDir and not SOURCEDIR and not Installed\t6601\n";
|
||||
|
||||
static const CHAR sd_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
|
||||
"s72\ti2\tS64\tS0\tS255\n"
|
||||
"CustomAction\tAction\n"
|
||||
"TestSourceDirProp1\t19\t\tTest 1 failed\t\n"
|
||||
"TestSourceDirProp2\t19\t\tTest 2 failed\t\n"
|
||||
"TestSourceDirProp3\t19\t\tTest 3 failed\t\n"
|
||||
"TestSourceDirProp4\t19\t\tTest 4 failed\t\n"
|
||||
"TestSourceDirProp5\t19\t\tTest 5 failed\t\n"
|
||||
"TestSourceDirProp6\t19\t\tTest 6 failed\t\n"
|
||||
"TestSourceDirProp7\t19\t\tTest 7 failed\t\n"
|
||||
"TestSourceDirProp8\t19\t\tTest 8 failed\t\n"
|
||||
"TestSourceDirProp9\t19\t\tTest 9 failed\t\n"
|
||||
"TestSourceDirProp10\t19\t\tTest 10 failed\t\n"
|
||||
"TestSourceDirProp11\t19\t\tTest 11 failed\t\n"
|
||||
"TestSourceDirProp12\t19\t\tTest 12 failed\t\n"
|
||||
"TestSourceDirProp13\t19\t\tTest 13 failed\t\n"
|
||||
"TestSourceDirProp14\t19\t\tTest 14 failed\t\n"
|
||||
"TestSourceDirProp15\t19\t\tTest 15 failed\t\n"
|
||||
"TestSourceDirProp16\t19\t\tTest 16 failed\t\n"
|
||||
"TestSourceDirProp17\t19\t\tTest 17 failed\t\n"
|
||||
"TestSourceDirProp18\t19\t\tTest 18 failed\t\n"
|
||||
"TestSourceDirProp19\t19\t\tTest 19 failed\t\n"
|
||||
"TestSourceDirProp20\t19\t\tTest 20 failed\t\n"
|
||||
"TestSourceDirProp21\t19\t\tTest 21 failed\t\n"
|
||||
"TestSourceDirProp22\t19\t\tTest 22 failed\t\n"
|
||||
"TestSourceDirProp23\t19\t\tTest 23 failed\t\n"
|
||||
"TestSourceDirProp24\t19\t\tTest 24 failed\t\n"
|
||||
"TestSourceDirProp25\t19\t\tTest 25 failed\t\n"
|
||||
"TestSourceDirProp26\t19\t\tTest 26 failed\t\n"
|
||||
"TestSourceDirProp27\t19\t\tTest 27 failed\t\n"
|
||||
"TestSourceDirProp28\t19\t\tTest 28 failed\t\n"
|
||||
"TestSourceDirProp29\t19\t\tTest 29 failed\t\n"
|
||||
"TestSourceDirProp30\t19\t\tTest 30 failed\t\n"
|
||||
"TestSourceDirProp31\t19\t\tTest 31 failed\t\n"
|
||||
"TestSourceDirProp32\t19\t\tTest 32 failed\t\n"
|
||||
"TestSourceDirProp33\t19\t\tTest 33 failed\t\n"
|
||||
"TestSourceDirProp34\t19\t\tTest 34 failed\t\n"
|
||||
"TestSourceDirProp35\t19\t\tTest 35 failed\t\n";
|
||||
|
||||
static const CHAR cl_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
|
||||
"s72\ti2\tS64\tS0\tS255\n"
|
||||
"CustomAction\tAction\n"
|
||||
|
@ -1675,56 +1507,6 @@ static const msi_table ci2_tables[] =
|
|||
ADD_TABLE(property),
|
||||
};
|
||||
|
||||
static const msi_table spf_tables[] =
|
||||
{
|
||||
ADD_TABLE(ci_component),
|
||||
ADD_TABLE(directory),
|
||||
ADD_TABLE(rof_feature),
|
||||
ADD_TABLE(rof_feature_comp),
|
||||
ADD_TABLE(rof_file),
|
||||
ADD_TABLE(spf_install_exec_seq),
|
||||
ADD_TABLE(rof_media),
|
||||
ADD_TABLE(property),
|
||||
ADD_TABLE(spf_custom_action),
|
||||
ADD_TABLE(spf_install_ui_seq),
|
||||
};
|
||||
|
||||
static const msi_table lus0_tables[] =
|
||||
{
|
||||
ADD_TABLE(ci_component),
|
||||
ADD_TABLE(directory),
|
||||
ADD_TABLE(rof_feature),
|
||||
ADD_TABLE(rof_feature_comp),
|
||||
ADD_TABLE(rof_file),
|
||||
ADD_TABLE(pp_install_exec_seq),
|
||||
ADD_TABLE(rof_media),
|
||||
ADD_TABLE(property),
|
||||
};
|
||||
|
||||
static const msi_table lus1_tables[] =
|
||||
{
|
||||
ADD_TABLE(ci_component),
|
||||
ADD_TABLE(directory),
|
||||
ADD_TABLE(rof_feature),
|
||||
ADD_TABLE(rof_feature_comp),
|
||||
ADD_TABLE(rof_file),
|
||||
ADD_TABLE(pp_install_exec_seq),
|
||||
ADD_TABLE(rofc_media),
|
||||
ADD_TABLE(property),
|
||||
};
|
||||
|
||||
static const msi_table lus2_tables[] =
|
||||
{
|
||||
ADD_TABLE(ci_component),
|
||||
ADD_TABLE(directory),
|
||||
ADD_TABLE(rof_feature),
|
||||
ADD_TABLE(rof_feature_comp),
|
||||
ADD_TABLE(rof_file),
|
||||
ADD_TABLE(pp_install_exec_seq),
|
||||
ADD_TABLE(lus2_media),
|
||||
ADD_TABLE(property),
|
||||
};
|
||||
|
||||
static const msi_table tp_tables[] =
|
||||
{
|
||||
ADD_TABLE(tp_component),
|
||||
|
@ -1962,20 +1744,6 @@ static const msi_table fiuc_tables[] =
|
|||
ADD_TABLE(property),
|
||||
};
|
||||
|
||||
static const msi_table sd_tables[] =
|
||||
{
|
||||
ADD_TABLE(directory),
|
||||
ADD_TABLE(sd_component),
|
||||
ADD_TABLE(sd_feature),
|
||||
ADD_TABLE(sd_feature_comp),
|
||||
ADD_TABLE(sd_file),
|
||||
ADD_TABLE(sd_install_exec_seq),
|
||||
ADD_TABLE(sd_install_ui_seq),
|
||||
ADD_TABLE(sd_custom_action),
|
||||
ADD_TABLE(media),
|
||||
ADD_TABLE(property)
|
||||
};
|
||||
|
||||
static const msi_table fo_tables[] =
|
||||
{
|
||||
ADD_TABLE(directory),
|
||||
|
@ -2187,7 +1955,6 @@ static void init_functionpointers(void)
|
|||
|
||||
GET_PROC(hmsi, MsiQueryComponentStateA);
|
||||
GET_PROC(hmsi, MsiSourceListEnumSourcesA);
|
||||
GET_PROC(hmsi, MsiSourceListGetInfoA);
|
||||
GET_PROC(hmsi, MsiGetComponentPathExA);
|
||||
|
||||
GET_PROC(hadvapi32, ConvertSidToStringSidA);
|
||||
|
@ -3504,167 +3271,6 @@ error:
|
|||
DeleteFile(msifile);
|
||||
}
|
||||
|
||||
static BOOL add_cabinet_storage(LPCSTR db, LPCSTR cabinet)
|
||||
{
|
||||
WCHAR dbW[MAX_PATH], cabinetW[MAX_PATH];
|
||||
IStorage *stg;
|
||||
IStream *stm;
|
||||
HRESULT hr;
|
||||
HANDLE handle;
|
||||
|
||||
MultiByteToWideChar(CP_ACP, 0, db, -1, dbW, MAX_PATH);
|
||||
hr = StgOpenStorage(dbW, NULL, STGM_DIRECT|STGM_READWRITE|STGM_SHARE_EXCLUSIVE, NULL, 0, &stg);
|
||||
if (FAILED(hr))
|
||||
return FALSE;
|
||||
|
||||
MultiByteToWideChar(CP_ACP, 0, cabinet, -1, cabinetW, MAX_PATH);
|
||||
hr = IStorage_CreateStream(stg, cabinetW, STGM_WRITE|STGM_SHARE_EXCLUSIVE, 0, 0, &stm);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
IStorage_Release(stg);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
handle = CreateFileW(cabinetW, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);
|
||||
if (handle != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
DWORD count;
|
||||
char buffer[1024];
|
||||
if (ReadFile(handle, buffer, sizeof(buffer), &count, NULL))
|
||||
IStream_Write(stm, buffer, count, &count);
|
||||
CloseHandle(handle);
|
||||
}
|
||||
|
||||
IStream_Release(stm);
|
||||
IStorage_Release(stg);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void test_lastusedsource(void)
|
||||
{
|
||||
static char prodcode[] = "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
|
||||
|
||||
UINT r;
|
||||
char value[MAX_PATH], path[MAX_PATH];
|
||||
DWORD size;
|
||||
|
||||
if (!pMsiSourceListGetInfoA)
|
||||
{
|
||||
win_skip("MsiSourceListGetInfoA is not available\n");
|
||||
return;
|
||||
}
|
||||
|
||||
CreateDirectoryA("msitest", NULL);
|
||||
create_file("maximus", 500);
|
||||
create_cab_file("test1.cab", MEDIA_SIZE, "maximus\0");
|
||||
DeleteFile("maximus");
|
||||
|
||||
create_database("msifile0.msi", lus0_tables, sizeof(lus0_tables) / sizeof(msi_table));
|
||||
create_database("msifile1.msi", lus1_tables, sizeof(lus1_tables) / sizeof(msi_table));
|
||||
create_database("msifile2.msi", lus2_tables, sizeof(lus2_tables) / sizeof(msi_table));
|
||||
|
||||
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
|
||||
|
||||
/* no cabinet file */
|
||||
|
||||
size = MAX_PATH;
|
||||
lstrcpyA(value, "aaa");
|
||||
r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
|
||||
MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCE, value, &size);
|
||||
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %u\n", r);
|
||||
ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
|
||||
|
||||
r = MsiInstallProductA("msifile0.msi", "PUBLISH_PRODUCT=1");
|
||||
if (r == ERROR_INSTALL_PACKAGE_REJECTED)
|
||||
{
|
||||
skip("Not enough rights to perform tests\n");
|
||||
goto error;
|
||||
}
|
||||
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
|
||||
|
||||
lstrcpyA(path, CURR_DIR);
|
||||
lstrcatA(path, "\\");
|
||||
|
||||
size = MAX_PATH;
|
||||
lstrcpyA(value, "aaa");
|
||||
r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
|
||||
MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCE, value, &size);
|
||||
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
|
||||
ok(!lstrcmpA(value, path), "Expected \"%s\", got \"%s\"\n", path, value);
|
||||
ok(size == lstrlenA(path), "Expected %d, got %d\n", lstrlenA(path), size);
|
||||
|
||||
r = MsiInstallProductA("msifile0.msi", "REMOVE=ALL");
|
||||
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
|
||||
|
||||
/* separate cabinet file */
|
||||
|
||||
size = MAX_PATH;
|
||||
lstrcpyA(value, "aaa");
|
||||
r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
|
||||
MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCE, value, &size);
|
||||
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %u\n", r);
|
||||
ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
|
||||
|
||||
r = MsiInstallProductA("msifile1.msi", "PUBLISH_PRODUCT=1");
|
||||
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
|
||||
|
||||
lstrcpyA(path, CURR_DIR);
|
||||
lstrcatA(path, "\\");
|
||||
|
||||
size = MAX_PATH;
|
||||
lstrcpyA(value, "aaa");
|
||||
r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
|
||||
MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCE, value, &size);
|
||||
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
|
||||
ok(!lstrcmpA(value, path), "Expected \"%s\", got \"%s\"\n", path, value);
|
||||
ok(size == lstrlenA(path), "Expected %d, got %d\n", lstrlenA(path), size);
|
||||
|
||||
r = MsiInstallProductA("msifile1.msi", "REMOVE=ALL");
|
||||
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
|
||||
|
||||
size = MAX_PATH;
|
||||
lstrcpyA(value, "aaa");
|
||||
r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
|
||||
MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCE, value, &size);
|
||||
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %u\n", r);
|
||||
ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
|
||||
|
||||
/* embedded cabinet stream */
|
||||
|
||||
add_cabinet_storage("msifile2.msi", "test1.cab");
|
||||
|
||||
r = MsiInstallProductA("msifile2.msi", "PUBLISH_PRODUCT=1");
|
||||
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
|
||||
|
||||
size = MAX_PATH;
|
||||
lstrcpyA(value, "aaa");
|
||||
r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
|
||||
MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCE, value, &size);
|
||||
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
|
||||
ok(!lstrcmpA(value, path), "Expected \"%s\", got \"%s\"\n", path, value);
|
||||
ok(size == lstrlenA(path), "Expected %d, got %d\n", lstrlenA(path), size);
|
||||
|
||||
r = MsiInstallProductA("msifile2.msi", "REMOVE=ALL");
|
||||
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
|
||||
|
||||
size = MAX_PATH;
|
||||
lstrcpyA(value, "aaa");
|
||||
r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
|
||||
MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCE, value, &size);
|
||||
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %u\n", r);
|
||||
ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
|
||||
|
||||
error:
|
||||
/* Delete the files in the temp (current) folder */
|
||||
delete_cab_files();
|
||||
DeleteFile("msitest\\maximus");
|
||||
RemoveDirectory("msitest");
|
||||
DeleteFile("msifile0.msi");
|
||||
DeleteFile("msifile1.msi");
|
||||
DeleteFile("msifile2.msi");
|
||||
}
|
||||
|
||||
static void test_setdirproperty(void)
|
||||
{
|
||||
UINT r;
|
||||
|
@ -3746,109 +3352,6 @@ error:
|
|||
RemoveDirectory("msitest");
|
||||
}
|
||||
|
||||
static void test_concurrentinstall(void)
|
||||
{
|
||||
UINT r;
|
||||
CHAR path[MAX_PATH];
|
||||
|
||||
if (is_process_limited())
|
||||
{
|
||||
skip("process is limited\n");
|
||||
return;
|
||||
}
|
||||
|
||||
CreateDirectoryA("msitest", NULL);
|
||||
CreateDirectoryA("msitest\\msitest", NULL);
|
||||
create_file("msitest\\maximus", 500);
|
||||
create_file("msitest\\msitest\\augustus", 500);
|
||||
|
||||
create_database(msifile, ci_tables, sizeof(ci_tables) / sizeof(msi_table));
|
||||
|
||||
lstrcpyA(path, CURR_DIR);
|
||||
lstrcatA(path, "\\msitest\\concurrent.msi");
|
||||
create_database(path, ci2_tables, sizeof(ci2_tables) / sizeof(msi_table));
|
||||
|
||||
MsiSetInternalUI(INSTALLUILEVEL_FULL, NULL);
|
||||
|
||||
r = MsiInstallProductA(msifile, NULL);
|
||||
if (r == ERROR_INSTALL_PACKAGE_REJECTED)
|
||||
{
|
||||
skip("Not enough rights to perform tests\n");
|
||||
DeleteFile(path);
|
||||
goto error;
|
||||
}
|
||||
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
|
||||
if (!delete_pf("msitest\\augustus", TRUE))
|
||||
trace("concurrent installs not supported\n");
|
||||
ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
|
||||
ok(delete_pf("msitest", FALSE), "Directory not created\n");
|
||||
|
||||
DeleteFile(path);
|
||||
|
||||
r = MsiInstallProductA(msifile, NULL);
|
||||
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
|
||||
ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
|
||||
ok(!delete_pf("msitest\\augustus", TRUE), "File installed\n");
|
||||
ok(delete_pf("msitest", FALSE), "Directory not created\n");
|
||||
|
||||
error:
|
||||
DeleteFile(msifile);
|
||||
DeleteFile("msitest\\msitest\\augustus");
|
||||
DeleteFile("msitest\\maximus");
|
||||
RemoveDirectory("msitest\\msitest");
|
||||
RemoveDirectory("msitest");
|
||||
}
|
||||
|
||||
static void test_setpropertyfolder(void)
|
||||
{
|
||||
UINT r;
|
||||
CHAR path[MAX_PATH];
|
||||
DWORD attr;
|
||||
|
||||
if (is_process_limited())
|
||||
{
|
||||
skip("process is limited\n");
|
||||
return;
|
||||
}
|
||||
|
||||
lstrcpyA(path, PROG_FILES_DIR);
|
||||
lstrcatA(path, "\\msitest\\added");
|
||||
|
||||
CreateDirectoryA("msitest", NULL);
|
||||
create_file("msitest\\maximus", 500);
|
||||
|
||||
create_database(msifile, spf_tables, sizeof(spf_tables) / sizeof(msi_table));
|
||||
|
||||
MsiSetInternalUI(INSTALLUILEVEL_FULL, NULL);
|
||||
|
||||
r = MsiInstallProductA(msifile, NULL);
|
||||
if (r == ERROR_INSTALL_PACKAGE_REJECTED)
|
||||
{
|
||||
skip("Not enough rights to perform tests\n");
|
||||
goto error;
|
||||
}
|
||||
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
|
||||
attr = GetFileAttributesA(path);
|
||||
if (attr != INVALID_FILE_ATTRIBUTES && (attr & FILE_ATTRIBUTE_DIRECTORY))
|
||||
{
|
||||
ok(delete_pf("msitest\\added\\maximus", TRUE), "File not installed\n");
|
||||
ok(delete_pf("msitest\\added", FALSE), "Directory not created\n");
|
||||
ok(delete_pf("msitest", FALSE), "Directory not created\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
trace("changing folder property not supported\n");
|
||||
ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
|
||||
ok(delete_pf("msitest", FALSE), "Directory not created\n");
|
||||
}
|
||||
|
||||
error:
|
||||
/* Delete the files in the temp (current) folder */
|
||||
DeleteFile(msifile);
|
||||
DeleteFile("msitest\\maximus");
|
||||
RemoveDirectory("msitest");
|
||||
}
|
||||
|
||||
static BOOL file_exists(LPCSTR file)
|
||||
{
|
||||
return GetFileAttributes(file) != INVALID_FILE_ATTRIBUTES;
|
||||
|
@ -5844,68 +5347,6 @@ static void test_icon_table(void)
|
|||
DeleteFile(msifile);
|
||||
}
|
||||
|
||||
static void test_sourcedir_props(void)
|
||||
{
|
||||
UINT r;
|
||||
|
||||
if (is_process_limited())
|
||||
{
|
||||
skip("process is limited\n");
|
||||
return;
|
||||
}
|
||||
|
||||
create_test_files();
|
||||
create_file("msitest\\sourcedir.txt", 1000);
|
||||
create_database(msifile, sd_tables, sizeof(sd_tables) / sizeof(msi_table));
|
||||
|
||||
MsiSetInternalUI(INSTALLUILEVEL_FULL, NULL);
|
||||
|
||||
/* full UI, no ResolveSource action */
|
||||
r = MsiInstallProductA(msifile, NULL);
|
||||
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
|
||||
|
||||
r = MsiInstallProductA(msifile, "REMOVE=ALL");
|
||||
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
|
||||
|
||||
ok(!delete_pf("msitest\\sourcedir.txt", TRUE), "file not removed\n");
|
||||
ok(!delete_pf("msitest", FALSE), "directory not removed\n");
|
||||
|
||||
/* full UI, ResolveSource action */
|
||||
r = MsiInstallProductA(msifile, "ResolveSource=1");
|
||||
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
|
||||
|
||||
r = MsiInstallProductA(msifile, "REMOVE=ALL");
|
||||
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
|
||||
|
||||
ok(!delete_pf("msitest\\sourcedir.txt", TRUE), "file not removed\n");
|
||||
ok(!delete_pf("msitest", FALSE), "directory not removed\n");
|
||||
|
||||
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
|
||||
|
||||
/* no UI, no ResolveSource action */
|
||||
r = MsiInstallProductA(msifile, NULL);
|
||||
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
|
||||
|
||||
r = MsiInstallProductA(msifile, "REMOVE=ALL");
|
||||
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
|
||||
|
||||
ok(!delete_pf("msitest\\sourcedir.txt", TRUE), "file not removed\n");
|
||||
ok(!delete_pf("msitest", FALSE), "directory not removed\n");
|
||||
|
||||
/* no UI, ResolveSource action */
|
||||
r = MsiInstallProductA(msifile, "ResolveSource=1");
|
||||
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
|
||||
|
||||
r = MsiInstallProductA(msifile, "REMOVE=ALL");
|
||||
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
|
||||
|
||||
ok(!delete_pf("msitest\\sourcedir.txt", TRUE), "file not removed\n");
|
||||
ok(!delete_pf("msitest", FALSE), "directory not removed\n");
|
||||
|
||||
DeleteFileA("msitest\\sourcedir.txt");
|
||||
DeleteFile(msifile);
|
||||
}
|
||||
|
||||
static void test_package_validation(void)
|
||||
{
|
||||
UINT r;
|
||||
|
@ -6254,7 +5695,7 @@ static void test_command_line_parsing(void)
|
|||
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
|
||||
|
||||
DeleteFile(msifile);
|
||||
RemoveDirectory("msitest");
|
||||
delete_test_files();
|
||||
}
|
||||
|
||||
static void test_upgrade_code(void)
|
||||
|
@ -6452,8 +5893,6 @@ START_TEST(install)
|
|||
test_readonlyfile_cab();
|
||||
test_setdirproperty();
|
||||
test_cabisextracted();
|
||||
test_concurrentinstall();
|
||||
test_setpropertyfolder();
|
||||
test_transformprop();
|
||||
test_currentworkingdir();
|
||||
test_admin();
|
||||
|
@ -6469,7 +5908,6 @@ START_TEST(install)
|
|||
test_propcase();
|
||||
test_int_widths();
|
||||
test_shortcut();
|
||||
test_lastusedsource();
|
||||
test_preselected();
|
||||
test_installed_prop();
|
||||
test_file_in_use();
|
||||
|
@ -6477,7 +5915,6 @@ START_TEST(install)
|
|||
test_allusers_prop();
|
||||
test_feature_override();
|
||||
test_icon_table();
|
||||
test_sourcedir_props();
|
||||
test_package_validation();
|
||||
test_command_line_parsing();
|
||||
test_upgrade_code();
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue