Hi,

While testing the Sims I came across the following:

Setup.exe does:

        GetCurrentDirectory() -> returns E:\, my CD ROM drive.
        GetPrivateProfileStringA("SKU","SKU","MISSING",buf,buflen,"MAXIS.INI")

MAXIS.INI is only in E:\, the program fails if it returns "MISSING".

=> the profile code also checks the current directory.

I am not sure whether:
- Does it check the current directory first and then %windir% ? 
- If it does not find a file, does it create the .ini file in the current
  directory or in %windir% ? 

Could someone please check this under real windows?

Meanwhile, the following patch only changes small part of the current
behaviour and makes The Sims Setup.Exe start up.

Ciao, Marcus

Changelog:
        Also look for presence of .INI file in the current directory.


Index: files/profile.c
===================================================================
RCS file: /home/wine/wine/files/profile.c,v
retrieving revision 1.35
diff -u -r1.35 profile.c
--- files/profile.c     2000/06/20 20:48:46     1.35
+++ files/profile.c     2000/06/24 13:21:07
@@ -592,10 +592,21 @@
     }
     else
     {
-        GetWindowsDirectoryA( buffer, sizeof(buffer) );
-        strcat( buffer, "\\" );
-        strcat( buffer, filename );
-        if (!DOSFS_GetFullName( buffer, FALSE, &full_name )) return FALSE;
+       /* FIXME: unclear if windows looks into %WINDIR% first or in current
+        * directory. -MM
+        */
+       /* Try current directory first, but ONLY if .ini file exists. */
+       GetCurrentDirectoryA( sizeof(buffer), buffer );
+       strcat( buffer, "\\" );
+       strcat( buffer, filename );
+        if (!DOSFS_GetFullName( buffer, TRUE, &full_name )) {
+           /* Try %WINDIR% next, even if .ini file does not exists. */
+           GetWindowsDirectoryA( buffer, sizeof(buffer) );
+           strcat( buffer, "\\" );
+           strcat( buffer, filename );
+           if (!DOSFS_GetFullName( buffer, FALSE, &full_name ))
+               return FALSE;
+       }
     }
 
     for(i=0;i<N_CACHED_PROFILES;i++)

Reply via email to