Commit 9736fe49 authored by Damjan Jovanovic's avatar Damjan Jovanovic Committed by Alexandre Julliard

shell32: Pass the executable's full path from SHELL_execute() to CreateProcess().

Several older Microsoft installers, particularly those changing CDs during installation, break because they launch a child setup.exe, from a parent process also called setup.exe, which Wine finds in the wrong directory, as CreateProcess() first searches the parent executable's own directory, thus re-launching the parent itself instead of the child. Therefore CreateProcess() must be passed a full path from SHELL_execute(), so it launches the correct child. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=8439Signed-off-by: 's avatarDamjan Jovanovic <damjan.jov@gmail.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 06f1f53c
......@@ -1807,6 +1807,14 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
lpFile = sei_tmp.lpFile;
wcmd = wcmdBuffer;
strcpyW(wcmd, wszApplicationName);
if (sei_tmp.lpDirectory)
{
LPCWSTR searchPath[] = {
sei_tmp.lpDirectory,
NULL
};
PathFindOnPathW(wcmd, searchPath);
}
retval = SHELL_quote_and_execute( wcmd, wszParameters, wszEmpty,
wszApplicationName, NULL, &sei_tmp,
sei, execfunc );
......
......@@ -2842,7 +2842,7 @@ static void test_directory(void)
NULL, "test2.exe", params, tmpdir, NULL);
okShell(rc > 32, "returned %lu\n", rc);
okChildInt("argcA", 4);
todo_wine okChildString("argvA0", path);
okChildString("argvA0", path);
okChildString("argvA3", "Exec");
okChildPath("longPath", path);
......@@ -2855,7 +2855,7 @@ static void test_directory(void)
NULL, "test2.exe", params, "%TMPDIR%", NULL);
okShell(rc > 32, "returned %lu\n", rc);
okChildInt("argcA", 4);
todo_wine okChildString("argvA0", path);
okChildString("argvA0", path);
okChildString("argvA3", "Exec");
okChildPath("longPath", path);
......@@ -2872,9 +2872,9 @@ static void test_directory(void)
NULL, strrchr(argv0, '\\') + 1, params, tmpdir, NULL);
okShell(rc > 32, "returned %lu\n", rc);
okChildInt("argcA", 4);
todo_wine okChildString("argvA0", path);
okChildString("argvA0", path);
okChildString("argvA3", "Exec");
todo_wine okChildPath("longPath", path);
okChildPath("longPath", path);
DeleteFileA(path);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment