Fix to get Unreal Tournament-based installers to work from root of CD

Dustin Navea speeddymon at yahoo.com
Thu May 16 11:10:43 CDT 2002


Hi, see bug #685 for more info

http://bugs.winehq.com/show_bug.cgi?id=685

I created these 2 patches for it, 1 with a fixme
comment, 1 without, feel free to commit whichever one,
Alexnadre.

Apparently when you run any UT-based installer from
the root of the CD, it calls the real installer which
is in the System directory on the CD.  The problem
with this is that wine thinks that the root-of-CD
installer is trying to load a winelib app and
therefore calls open_winelib_app to handle it.  This
is incorrect...  im not sure what it should call, but
until that gets fixed, this patch fixes the problem by
checking for the filename that is called by the
root-of-CD installer and runs that instead of trying
to load it with .so extension.  This was tested with
UT v428 Installer, Deus Ex non-GOTY installer, winelib
notepad and winelib regedit both before and after
patch.

Before patch UT and Deus Ex installers returned error
that D:\System\Setup.exe.so could not be loaded as a
winelib application, file not found, which meant that
the only way to install was to run D:\System\setup.exe
directly...
winelib regedit/notepad ran just fine...

After patch all 4 programs ran just fine...

Hopefully this doesn't break anything.  If it does, I
will attempt to fix the open_winelib_app being called
problem...  I may need some help though...

-Dustin




__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com
-------------- next part --------------
Name: scheduler/process.c
ChangeLog: Check for .so extension in open_winelib_app to help unreal tournament-style
           installers to work.
License: Any (X11, LGPL, CodeWeavers, Lindows, AFPL)
Author: Dustin Navea
=================================================================================================
--- scheduler/process.c	Mon Apr 29 14:34:06 2002
+++ scheduler/process.c.new	Thu May 16 02:13:12 2002
@@ -464,12 +464,23 @@
             strcat( tmp, ".so" );
             /* search in PATH only if there was no '/' in argv[0] */
             ret = wine_dll_load_main_exe( tmp, (name == argv0), errStr, sizeof(errStr) );
-            if (!ret && !argv[1])
+            /* FIXME: if file attempting to be run exists without the .so extension,
+             * then we SHOULD skip past the next if to help certain installers work,
+             * this should fix it.  If you know of a better way to write it, please
+             * feel free to modify this patch and submit it, just give me credit for
+             * the original submission.
+             * --Dustin Navea
+             */
+            if (!SearchPathA( NULL, argv0, ".exe", sizeof(main_exe_name), main_exe_name, NULL) &&
+                !SearchPathA( NULL, argv0, NULL, sizeof(main_exe_name), main_exe_name, NULL))
             {
-                /* if no argv[1], this will be better than displaying usage */
-                MESSAGE( "%s: could not load library '%s' as Winelib application: %s\n",
-                         argv[0], tmp, errStr );
-                ExitProcess(1);
+                if (!ret && !argv[1])
+                {
+                    /* if no argv[1], this will be better than displaying usage */
+                    MESSAGE( "%s: could not load library '%s' as Winelib application: %s\n",
+                             argv[0], tmp, errStr );
+                    ExitProcess(1);
+                }
             }
             HeapFree( GetProcessHeap(), 0, tmp );
         }
-------------- next part --------------
Name: scheduler/process.c
ChangeLog: Check for .so extension in open_winelib_app to help unreal tournament-style
           installers to work.
License: Any (X11, LGPL, CodeWeavers, Lindows, AFPL)
Author: Dustin Navea
=================================================================================================
--- scheduler/process.c	Mon Apr 29 14:34:06 2002
+++ scheduler/process.c.new	Thu May 16 02:24:34 2002
@@ -464,12 +464,16 @@
             strcat( tmp, ".so" );
             /* search in PATH only if there was no '/' in argv[0] */
             ret = wine_dll_load_main_exe( tmp, (name == argv0), errStr, sizeof(errStr) );
-            if (!ret && !argv[1])
+            if (!SearchPathA( NULL, argv0, ".exe", sizeof(main_exe_name), main_exe_name, NULL) &&
+                !SearchPathA( NULL, argv0, NULL, sizeof(main_exe_name), main_exe_name, NULL))
             {
-                /* if no argv[1], this will be better than displaying usage */
-                MESSAGE( "%s: could not load library '%s' as Winelib application: %s\n",
-                         argv[0], tmp, errStr );
-                ExitProcess(1);
+                if (!ret && !argv[1])
+                {
+                    /* if no argv[1], this will be better than displaying usage */
+                    MESSAGE( "%s: could not load library '%s' as Winelib application: %s\n",
+                             argv[0], tmp, errStr );
+                    ExitProcess(1);
+                }
             }
             HeapFree( GetProcessHeap(), 0, tmp );
         }


More information about the wine-patches mailing list