From 2b92436d8299ded10cc07312888dfb2980f28389 Mon Sep 17 00:00:00 2001 From: winesync Date: Sun, 13 Mar 2022 19:04:59 +0100 Subject: [PATCH] [WINESYNC] msi/tests: Run the package tests from a temporary directory. Signed-off-by: Hans Leidekker Signed-off-by: Alexandre Julliard wine commit id 8503ad172229979e9929e8d54dac546c5b799a03 by Hans Leidekker --- modules/rostests/winetests/msi/package.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/modules/rostests/winetests/msi/package.c b/modules/rostests/winetests/msi/package.c index ba1b83a6fba..3c547bf04a0 100644 --- a/modules/rostests/winetests/msi/package.c +++ b/modules/rostests/winetests/msi/package.c @@ -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); }