From: nishi Date: Tue, 18 Jun 2024 00:14:37 +0000 (+0000) Subject: fix for linux X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=7d7607dba1b0def288439f4cbe1aa7173c65d20b;p=dataworks.git fix for linux git-svn-id: file:///raid/svn-main/nishi-dataworks/trunk@324 d4a5a174-5a4a-5b4b-b672-37683c10d7d5 --- diff --git a/Installer/install.c b/Installer/install.c index 44a6046..d7c0b3c 100644 --- a/Installer/install.c +++ b/Installer/install.c @@ -29,7 +29,14 @@ /* -------------------------------------------------------------------------- */ /* --- END LICENSE --- */ +#ifdef __WATCOMC__ #include +#else +#include +#include +#include +#include +#endif #include #include #include @@ -85,9 +92,15 @@ do_so: free(tmp); } } +#ifdef __WATCOM__ FILE* in = fopen("extract.exe", "rb"); struct stat s; stat("extract.exe", &s); +#else + FILE* in = fopen("extract", "rb"); + struct stat s; + stat("extract", &s); +#endif if(in == NULL) { printf("%s: ", INSTALLER_ERROR); printf("%s\n", strerror(errno)); @@ -103,7 +116,11 @@ do_so: free(str); return 1; } else { +#ifdef __WATCOMC__ char* to = __util_strcat(str, "\\_extract.exe"); +#else + char* to = __util_strcat(str, "/_extract"); +#endif FILE* out = fopen(to, "wb"); if(out == NULL) { fclose(in); @@ -136,6 +153,7 @@ do_so: fclose(out); printf("\n"); int i; +#ifdef __WATCOMC__ for(i = 0; to[i] != 0; i++) { if(to[i] == ':') { unsigned total; @@ -147,10 +165,14 @@ do_so: break; } } +#endif remove("dw.exe"); remove("dwserv.exe"); remove("dwrcli.exe"); remove("readme.doc"); +#ifndef __WATCOMC__ + chmod(to, 0755); +#endif system(to); remove(to); free(to);