Lines 77-83
Link Here
|
77 |
#ifdef LINUX |
77 |
#ifdef LINUX |
78 |
# include <sys/vfs.h> |
78 |
# include <sys/vfs.h> |
79 |
# define statvfs statfs |
79 |
# define statvfs statfs |
80 |
#elif defined(NETBSD) || defined(FREEBSD) |
80 |
#elif defined(NETBSD) || defined(FREEBSD) || defined(MACOSX) |
81 |
# include <sys/param.h> |
81 |
# include <sys/param.h> |
82 |
# include <sys/mount.h> |
82 |
# include <sys/mount.h> |
83 |
# define statvfs statfs |
83 |
# define statvfs statfs |
Lines 91-96
Link Here
|
91 |
#endif |
91 |
#endif |
92 |
#endif |
92 |
#endif |
93 |
|
93 |
|
|
|
94 |
#ifdef MACOSX |
95 |
#include <unistd.h> |
96 |
#define iswspace(c) ((c)==' ' || (c)=='\t' || (c)=='\n') |
97 |
#define MAX_FILES_IN_DIR 1024 |
98 |
#endif |
99 |
|
94 |
#include "bitmap" |
100 |
#include "bitmap" |
95 |
#include "logo.xpm" |
101 |
#include "logo.xpm" |
96 |
|
102 |
|
Lines 121-127
Link Here
|
121 |
|
127 |
|
122 |
#include <rtl/ustring.h> |
128 |
#include <rtl/ustring.h> |
123 |
|
129 |
|
124 |
#include <stdio.h> |
130 |
#include <errno.h> |
125 |
|
131 |
|
126 |
#ifdef UNX |
132 |
#ifdef UNX |
127 |
#define stricmp strcasecmp |
133 |
#define stricmp strcasecmp |
Lines 580-586
Link Here
|
580 |
#define MAX_LINEBUF 1024 |
586 |
#define MAX_LINEBUF 1024 |
581 |
|
587 |
|
582 |
#define KBYTE 1024 |
588 |
#define KBYTE 1024 |
583 |
#define LD_LIBRARY_PATH "LD_LIBRARY_PATH" |
589 |
/* define LD_LIBRARY_PATH "LD_LIBRARY_PATH" */ |
584 |
|
590 |
|
585 |
#define SETUP_EVENT_TIME_TO_START 1L |
591 |
#define SETUP_EVENT_TIME_TO_START 1L |
586 |
#define SETUP_EVENT_INSTALL_SETUP 2L |
592 |
#define SETUP_EVENT_INSTALL_SETUP 2L |
Lines 589-594
Link Here
|
589 |
#define SETUP_EVENT_EXIT_LOADER 5L |
595 |
#define SETUP_EVENT_EXIT_LOADER 5L |
590 |
#define SETUP_EVENT_EXPOSE 6L |
596 |
#define SETUP_EVENT_EXPOSE 6L |
591 |
|
597 |
|
|
|
598 |
#ifdef MACOSX |
599 |
#define SAL_FILE_PATTERN "libsal.dylib*" |
600 |
#define STL_FILE_PATTERN "libstlport_gcc.dylib.4.5" |
601 |
#else |
592 |
#define SAL_FILE_PATTERN "libsal.so*" |
602 |
#define SAL_FILE_PATTERN "libsal.so*" |
593 |
#ifdef LINUX |
603 |
#ifdef LINUX |
594 |
#define GCC_FILE_PATTERN "libgcc_s.so.1" |
604 |
#define GCC_FILE_PATTERN "libgcc_s.so.1" |
Lines 599-604
Link Here
|
599 |
#else |
609 |
#else |
600 |
#define STL_FILE_PATTERN "libstlport_sunpro.so" |
610 |
#define STL_FILE_PATTERN "libstlport_sunpro.so" |
601 |
#endif |
611 |
#endif |
|
|
612 |
#endif |
602 |
|
613 |
|
603 |
Display* gpDisplay; |
614 |
Display* gpDisplay; |
604 |
Window gaWin; |
615 |
Window gaWin; |
Lines 677-682
Link Here
|
677 |
" LD_LIBRARY_PATH=.:./lib:$LD_LIBRARY_PATH\n" \ |
688 |
" LD_LIBRARY_PATH=.:./lib:$LD_LIBRARY_PATH\n" \ |
678 |
" export LD_LIBRARY_PATH\n" \ |
689 |
" export LD_LIBRARY_PATH\n" \ |
679 |
" ;;\n" \ |
690 |
" ;;\n" \ |
|
|
691 |
" Darwin)\n" \ |
692 |
" DYLD_LIBRARY_PATH=.:./lib:${DYLD_LIBRARY_PATH}\n" \ |
693 |
" export DYLD_LIBRARY_PATH\n" \ |
694 |
" ;;\n" \ |
680 |
" FreeBSD)\n" \ |
695 |
" FreeBSD)\n" \ |
681 |
" LD_LIBRARY_PATH=.:./lib:$LD_LIBRARY_PATH\n" \ |
696 |
" LD_LIBRARY_PATH=.:./lib:$LD_LIBRARY_PATH\n" \ |
682 |
" export LD_LIBRARY_PATH\n" \ |
697 |
" export LD_LIBRARY_PATH\n" \ |
Lines 774-781
Link Here
|
774 |
} |
789 |
} |
775 |
} |
790 |
} |
776 |
fclose( pOut ); |
791 |
fclose( pOut ); |
777 |
|
792 |
#ifdef MACOSX |
778 |
pLDPath = getenv( LD_LIBRARY_PATH ); |
793 |
pLDPath = getenv( "DYLD_LIBRARY_PATH" ); |
|
|
794 |
#else |
795 |
pLDPath = getenv( "LD_LIBRARY_PATH" ); |
796 |
#endif |
779 |
if( pLDPath ) |
797 |
if( pLDPath ) |
780 |
{ |
798 |
{ |
781 |
char* pToken = strtok( pLDPath, ":" ); |
799 |
char* pToken = strtok( pLDPath, ":" ); |
Lines 1095-1100
Link Here
|
1095 |
char pFile[__MAX_PATH]; |
1113 |
char pFile[__MAX_PATH]; |
1096 |
char * ptr; |
1114 |
char * ptr; |
1097 |
int i = 0; |
1115 |
int i = 0; |
|
|
1116 |
int rv = 0; |
1098 |
char tmp[2]; |
1117 |
char tmp[2]; |
1099 |
char dest[__MAX_PATH]; |
1118 |
char dest[__MAX_PATH]; |
1100 |
char src[__MAX_PATH]; |
1119 |
char src[__MAX_PATH]; |
Lines 1279-1292
Link Here
|
1279 |
SVUnzip( pEntry->pName, "*", (const char*)"qq", NULL ); |
1298 |
SVUnzip( pEntry->pName, "*", (const char*)"qq", NULL ); |
1280 |
|
1299 |
|
1281 |
unlink( pEntry->pName ); |
1300 |
unlink( pEntry->pName ); |
1282 |
} |
1301 |
} |
1283 |
else |
1302 |
else |
1284 |
{ |
1303 |
{ |
1285 |
ArchDirectory_GetFile( pBigDir, pEntry->pName, strTmpPath ); |
1304 |
ArchDirectory_GetFile( pBigDir, pEntry->pName, strTmpPath ); |
1286 |
SVUnzipEnumFiles( pEntry->pName, "*", (UnzipEnumFilesCallBack*) __EnumFilesCallBack, NULL ); |
1305 |
SVUnzipEnumFiles( pEntry->pName, "*", (UnzipEnumFilesCallBack*) __EnumFilesCallBack, NULL ); |
1287 |
|
1306 |
|
1288 |
if ( !bIsSalLib && !bUnpackLib ) |
1307 |
if ( !bIsSalLib && !bUnpackLib ) |
1289 |
SVUnzip( pEntry->pName, "*", (const char*)"qq", (UnzipCallBack*) __UnzipCallback ); |
1308 |
SVUnzip( pEntry->pName, "*", (const char*)"qq", (UnzipCallBack*) __UnzipCallback ); |
1290 |
|
1309 |
|
1291 |
unlink( pEntry->pName ); |
1310 |
unlink( pEntry->pName ); |
1292 |
} |
1311 |
} |
Lines 1322-1337
Link Here
|
1322 |
SVUnzipEnumFiles( file, "*", (UnzipEnumFilesCallBack*) __EnumFilesCallBack, NULL ); |
1341 |
SVUnzipEnumFiles( file, "*", (UnzipEnumFilesCallBack*) __EnumFilesCallBack, NULL ); |
1323 |
|
1342 |
|
1324 |
if ( !bIsSalLib && !bUnpackLib ) |
1343 |
if ( !bIsSalLib && !bUnpackLib ) |
1325 |
SVUnzip( file, "*", (const char*)"qq", (UnzipCallBack*) __UnzipCallback ); |
1344 |
SVUnzip( file, "*", (const char*)"qq", (UnzipCallBack*) __UnzipCallback ); |
1326 |
} |
1345 |
} |
|
|
1346 |
} |
1327 |
} |
1347 |
} |
1328 |
} |
|
|
1329 |
closedir( pDir ); |
1348 |
closedir( pDir ); |
1330 |
} |
1349 |
} |
1331 |
|
1350 |
|
|
|
1351 |
|
1332 |
void InstallSetupFile( ArchDirectory* pBigDir ) |
1352 |
void InstallSetupFile( ArchDirectory* pBigDir ) |
1333 |
{ |
1353 |
{ |
1334 |
int nErr = 0; |
1354 |
int nErr = 0; |
|
|
1355 |
int dfd = 0; |
1335 |
char strSetupOrgZIP[__MAX_PATH]; |
1356 |
char strSetupOrgZIP[__MAX_PATH]; |
1336 |
char strSetupZIP[__MAX_PATH]; |
1357 |
char strSetupZIP[__MAX_PATH]; |
1337 |
char strSetupINI[__MAX_PATH]; |
1358 |
char strSetupINI[__MAX_PATH]; |
Lines 1382-1387
Link Here
|
1382 |
} |
1403 |
} |
1383 |
gbSize = FALSE; |
1404 |
gbSize = FALSE; |
1384 |
|
1405 |
|
|
|
1406 |
#ifdef MACOSX |
1407 |
|
1408 |
/* MacOSX readdir will incorrrectly return NULL if enough */ |
1409 |
/* symlinks are added to to the directory readdir is accessing */ |
1410 |
/* So this builds a list of all files first */ |
1411 |
/* and then creates the symlinks to avoid any problems */ |
1412 |
{ |
1413 |
char * fnamelist[MAX_FILES_IN_DIR]; |
1414 |
int nfiles = 0; |
1415 |
int j; |
1416 |
pDir = opendir( strTmpPath ); |
1417 |
while( (pDirFile = readdir(pDir)) != NULL ) |
1418 |
if( strcmp(pDirFile->d_name, ".") != 0 && |
1419 |
strcmp(pDirFile->d_name, "..") != 0 ) |
1420 |
fnamelist[nfiles++] = strdup(pDirFile->d_name); |
1421 |
closedir(pDir); |
1422 |
for (j = 0; j < nfiles; j++) { |
1423 |
makeSymLink(fnamelist[j]); |
1424 |
free(fnamelist[j]); |
1425 |
fnamelist[j] = NULL; |
1426 |
} |
1427 |
nfiles = 0; |
1428 |
} |
1429 |
|
1430 |
#else |
1431 |
|
1385 |
pDir = opendir( strTmpPath ); |
1432 |
pDir = opendir( strTmpPath ); |
1386 |
if( pDir ) |
1433 |
if( pDir ) |
1387 |
{ |
1434 |
{ |
Lines 1392-1397
Link Here
|
1392 |
closedir( pDir ); |
1439 |
closedir( pDir ); |
1393 |
} |
1440 |
} |
1394 |
|
1441 |
|
|
|
1442 |
#endif |
1443 |
|
1395 |
gbSize = TRUE; |
1444 |
gbSize = TRUE; |
1396 |
if ( !HandlePatch( pBigDir, &bIsPatchMode, TRUE ) && bIsPatchMode ) |
1445 |
if ( !HandlePatch( pBigDir, &bIsPatchMode, TRUE ) && bIsPatchMode ) |
1397 |
exit( -1 ); |
1446 |
exit( -1 ); |
Lines 1400-1406
Link Here
|
1400 |
nMinTempSize /= KBYTE; |
1449 |
nMinTempSize /= KBYTE; |
1401 |
|
1450 |
|
1402 |
statvfs( strTmpPath, &buf); |
1451 |
statvfs( strTmpPath, &buf); |
1403 |
#if defined(LINUX) || defined(NETBSD) || defined(FREEBSD) |
1452 |
#if defined(LINUX) || defined(NETBSD) || defined(FREEBSD) || defined(MACOSX) |
1404 |
nSize = buf.f_bsize; |
1453 |
nSize = buf.f_bsize; |
1405 |
#else |
1454 |
#else |
1406 |
nSize = (buf.f_frsize ? buf.f_frsize : buf.f_bsize); |
1455 |
nSize = (buf.f_frsize ? buf.f_frsize : buf.f_bsize); |
Lines 1424-1429
Link Here
|
1424 |
else |
1473 |
else |
1425 |
UnpackBIG2Temp( pBigDir, FALSE ); |
1474 |
UnpackBIG2Temp( pBigDir, FALSE ); |
1426 |
|
1475 |
|
|
|
1476 |
|
1427 |
if ( !HandlePatch( pBigDir, &bIsPatchMode, FALSE ) ) |
1477 |
if ( !HandlePatch( pBigDir, &bIsPatchMode, FALSE ) ) |
1428 |
exit( -1 ); |
1478 |
exit( -1 ); |
1429 |
|
1479 |
|
Lines 1498-1513
Link Here
|
1498 |
STRNCAT( strSetupBIN, "/setup", sizeof(strSetupBIN) ); |
1548 |
STRNCAT( strSetupBIN, "/setup", sizeof(strSetupBIN) ); |
1499 |
chmod( strSetupBIN, S_IRWXU ); |
1549 |
chmod( strSetupBIN, S_IRWXU ); |
1500 |
|
1550 |
|
|
|
1551 |
#ifdef MACOSX |
1552 |
|
1553 |
/* MacOSX readdir will incorrrectly return NULL if enough */ |
1554 |
/* symlinks are added to to the directory readdir is accessing */ |
1555 |
/* So this builds a list of all files first */ |
1556 |
/* and then creates the symlinks to avoid any problems */ |
1557 |
{ |
1558 |
char * fnamelist[MAX_FILES_IN_DIR]; |
1559 |
int nfiles = 0; |
1560 |
int j; |
1561 |
pDir = opendir( strTmpPath ); |
1562 |
while( (pDirFile = readdir(pDir)) != NULL ) |
1563 |
if( strcmp(pDirFile->d_name, ".") != 0 && |
1564 |
strcmp(pDirFile->d_name, "..") != 0 ) |
1565 |
fnamelist[nfiles++] = strdup(pDirFile->d_name); |
1566 |
closedir(pDir); |
1567 |
for (j = 0; j < nfiles; j++) { |
1568 |
makeSymLink(fnamelist[j]); |
1569 |
free(fnamelist[j]); |
1570 |
fnamelist[j] = NULL; |
1571 |
} |
1572 |
nfiles = 0; |
1573 |
} |
1574 |
|
1575 |
#else |
1576 |
|
1501 |
pDir = opendir( strTmpPath ); |
1577 |
pDir = opendir( strTmpPath ); |
1502 |
if( pDir ) |
1578 |
if( pDir ) |
1503 |
{ |
1579 |
{ |
1504 |
while( (pDirFile = readdir(pDir)) != NULL ) |
1580 |
while( (pDirFile = readdir(pDir)) != NULL ) |
1505 |
if( strcmp(pDirFile->d_name, ".") != 0 && |
1581 |
if( strcmp(pDirFile->d_name, ".") != 0 && |
1506 |
strcmp(pDirFile->d_name, "..") != 0 ) |
1582 |
strcmp(pDirFile->d_name, "..") != 0 ) |
1507 |
makeSymLink( pDirFile->d_name ); |
1583 |
makeSymLink( pDirFile->d_name ); |
1508 |
closedir( pDir ); |
1584 |
closedir( pDir ); |
1509 |
} |
1585 |
} |
1510 |
|
1586 |
|
|
|
1587 |
#endif |
1588 |
|
1511 |
SendEvent( SETUP_EVENT_KILL_LOADER_WINDOW ); |
1589 |
SendEvent( SETUP_EVENT_KILL_LOADER_WINDOW ); |
1512 |
} |
1590 |
} |
1513 |
|
1591 |
|
Lines 1735-1757
Link Here
|
1735 |
|
1813 |
|
1736 |
// we need a LD_LIBRARY_PATH with a current directory in it so we can |
1814 |
// we need a LD_LIBRARY_PATH with a current directory in it so we can |
1737 |
// dynamicly load a library ( needed for patching! ) |
1815 |
// dynamicly load a library ( needed for patching! ) |
|
|
1816 |
#ifdef MACOSX |
1817 |
pLibPath = getenv("DYLD_LIBRARY_PATH"); |
1818 |
#else |
1738 |
pLibPath = getenv("LD_LIBRARY_PATH"); |
1819 |
pLibPath = getenv("LD_LIBRARY_PATH"); |
|
|
1820 |
#endif |
1739 |
if ( ! pLibPath || ( strcmp( pLibPath, "." ) != 0 ) && |
1821 |
if ( ! pLibPath || ( strcmp( pLibPath, "." ) != 0 ) && |
1740 |
( strncmp( pLibPath, ".:", 2 ) != 0 ) ) |
1822 |
( strncmp( pLibPath, ".:", 2 ) != 0 ) ) |
1741 |
{ |
1823 |
{ |
1742 |
char * pNewPath; |
1824 |
char * pNewPath; |
1743 |
if ( pLibPath ) |
1825 |
if ( pLibPath ) |
1744 |
{ |
1826 |
{ |
|
|
1827 |
#ifdef MACOSX |
1828 |
pNewPath = malloc( strlen( "DYLD_LIBRARY_PATH=" ) + strlen( pLibPath ) + 3 ); |
1829 |
strcpy( pNewPath, "DYLD_LIBRARY_PATH=" ); // #100211# - checked |
1830 |
#else |
1745 |
pNewPath = malloc( strlen( "LD_LIBRARY_PATH=" ) + strlen( pLibPath ) + 3 ); |
1831 |
pNewPath = malloc( strlen( "LD_LIBRARY_PATH=" ) + strlen( pLibPath ) + 3 ); |
1746 |
strcpy( pNewPath, "LD_LIBRARY_PATH=" ); // #100211# - checked |
1832 |
strcpy( pNewPath, "LD_LIBRARY_PATH=" ); // #100211# - checked |
|
|
1833 |
#endif |
1747 |
strcat( pNewPath, ".:" ); // #100211# - checked |
1834 |
strcat( pNewPath, ".:" ); // #100211# - checked |
1748 |
strcat( pNewPath, pLibPath ); // #100211# - checked |
1835 |
strcat( pNewPath, pLibPath ); // #100211# - checked |
1749 |
putenv( pNewPath ); |
1836 |
putenv( pNewPath ); |
1750 |
} |
1837 |
} |
1751 |
else |
1838 |
else |
1752 |
{ |
1839 |
{ |
|
|
1840 |
#ifdef MACOSX |
1841 |
pNewPath = malloc( strlen( "DYLD_LIBRARY_PATH=" ) + 2 ); |
1842 |
strcpy( pNewPath, "DYLD_LIBRARY_PATH=" ); // #100211# - checked |
1843 |
#else |
1753 |
pNewPath = malloc( strlen( "LD_LIBRARY_PATH=" ) + 2 ); |
1844 |
pNewPath = malloc( strlen( "LD_LIBRARY_PATH=" ) + 2 ); |
1754 |
strcpy( pNewPath, "LD_LIBRARY_PATH=" ); // #100211# - checked |
1845 |
strcpy( pNewPath, "LD_LIBRARY_PATH=" ); // #100211# - checked |
|
|
1846 |
#endif |
1755 |
strcat( pNewPath, "." ); // #100211# - checked |
1847 |
strcat( pNewPath, "." ); // #100211# - checked |
1756 |
putenv( pNewPath ); |
1848 |
putenv( pNewPath ); |
1757 |
} |
1849 |
} |