diff --git a/dlls/ntdll/server.c b/dlls/ntdll/server.c index aff0b8a5fdd..b6473522e7a 100644 --- a/dlls/ntdll/server.c +++ b/dlls/ntdll/server.c @@ -598,7 +598,7 @@ static void start_server(void) if (pid == -1) fatal_perror( "fork" ); if (!pid) { - argv[0] = "wineserver"; + argv[0] = "server/wineserver"; argv[1] = TRACE_ON(server) ? "-d" : NULL; argv[2] = NULL; wine_exec_wine_binary( argv[0], argv, getenv("WINESERVER") ); @@ -797,7 +797,7 @@ static void create_config_dir(void) { const char *argv[6]; - argv[0] = "wineprefixcreate"; + argv[0] = "tools/wineprefixcreate"; argv[1] = "--quiet"; argv[2] = "--wait"; argv[3] = "--prefix"; diff --git a/libs/wine/config.c b/libs/wine/config.c index 1c2a3254203..79146d3db9c 100644 --- a/libs/wine/config.c +++ b/libs/wine/config.c @@ -427,6 +427,18 @@ void wine_exec_wine_binary( const char *name, char **argv, const char *env_var ) use_preloader = 1; } + if ((ptr = strrchr( name, '/' ))) + { + /* if we are in build dir and name contains a path, try that */ + if (build_dir) + { + argv[0] = build_path( build_dir, name ); + preloader_exec( argv, use_preloader ); + free( argv[0] ); + } + name = ptr + 1; /* get rid of path */ + } + /* first, bin directory from the current libdir or argv0 */ if (bindir) {