Skip to content

Commit 2b92436

Browse files
winesynclearn-more
authored andcommitted
[WINESYNC] msi/tests: Run the package tests from a temporary directory.
Signed-off-by: Hans Leidekker <[email protected]> Signed-off-by: Alexandre Julliard <[email protected]> wine commit id 8503ad172229979e9929e8d54dac546c5b799a03 by Hans Leidekker <[email protected]>
1 parent 427d8af commit 2b92436

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

modules/rostests/winetests/msi/package.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9640,15 +9640,25 @@ static void test_top_level_action(void)
96409640

96419641
START_TEST(package)
96429642
{
9643+
char temp_path[MAX_PATH], prev_path[MAX_PATH];
96439644
STATEMGRSTATUS status;
96449645
BOOL ret = FALSE;
9646+
DWORD len;
96459647

96469648
init_functionpointers();
96479649

96489650
if (pIsWow64Process)
96499651
pIsWow64Process(GetCurrentProcess(), &is_wow64);
96509652

9651-
GetCurrentDirectoryA(MAX_PATH, CURR_DIR);
9653+
GetCurrentDirectoryA(MAX_PATH, prev_path);
9654+
GetTempPathA(MAX_PATH, temp_path);
9655+
SetCurrentDirectoryA(temp_path);
9656+
9657+
lstrcpyA(CURR_DIR, temp_path);
9658+
len = lstrlenA(CURR_DIR);
9659+
9660+
if (len && (CURR_DIR[len - 1] == '\\'))
9661+
CURR_DIR[len - 1] = 0;
96529662

96539663
/* Create a restore point ourselves so we circumvent the multitude of restore points
96549664
* that would have been created by all the installation and removal tests.
@@ -9706,4 +9716,6 @@ START_TEST(package)
97069716
if (ret)
97079717
remove_restore_point(status.llSequenceNumber);
97089718
}
9719+
9720+
SetCurrentDirectoryA(prev_path);
97099721
}

0 commit comments

Comments
 (0)