msi/tests: Run the package tests from a temporary directory.

Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Hans Leidekker 2019-10-29 10:58:43 +01:00 committed by Alexandre Julliard
parent 1b4b37cc7e
commit 8503ad1722
1 changed files with 13 additions and 1 deletions

View File

@ -9640,15 +9640,25 @@ static void test_top_level_action(void)
START_TEST(package)
{
char temp_path[MAX_PATH], prev_path[MAX_PATH];
STATEMGRSTATUS status;
BOOL ret = FALSE;
DWORD len;
init_functionpointers();
if (pIsWow64Process)
pIsWow64Process(GetCurrentProcess(), &is_wow64);
GetCurrentDirectoryA(MAX_PATH, CURR_DIR);
GetCurrentDirectoryA(MAX_PATH, prev_path);
GetTempPathA(MAX_PATH, temp_path);
SetCurrentDirectoryA(temp_path);
lstrcpyA(CURR_DIR, temp_path);
len = lstrlenA(CURR_DIR);
if (len && (CURR_DIR[len - 1] == '\\'))
CURR_DIR[len - 1] = 0;
/* Create a restore point ourselves so we circumvent the multitude of restore points
* that would have been created by all the installation and removal tests.
@ -9706,4 +9716,6 @@ START_TEST(package)
if (ret)
remove_restore_point(status.llSequenceNumber);
}
SetCurrentDirectoryA(prev_path);
}