Subversion Repositories SvarDOS

Rev

Rev 29 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 29 Rev 30
Line 2... Line 2...
2
 * SVAROG386 INSTALL
2
 * SVAROG386 INSTALL
3
 * COPYRIGHT (C) 2016 MATEUSZ VISTE
3
 * COPYRIGHT (C) 2016 MATEUSZ VISTE
4
 */
4
 */
5
 
5
 
6
#include <dos.h>
6
#include <dos.h>
-
 
7
#include <direct.h>  /* mkdir() */
7
#include <stdio.h>   /* printf() and friends */
8
#include <stdio.h>   /* printf() and friends */
8
#include <stdlib.h>  /* system() */
9
#include <stdlib.h>  /* system() */
9
#include <string.h>  /* memcpy() */
10
#include <string.h>  /* memcpy() */
10
#include <unistd.h>
11
#include <unistd.h>
11
#include "input.h"
12
#include "input.h"
Line 226... Line 227...
226
      /* final confirmation */
227
      /* final confirmation */
227
      char *list[] = { "Install Svarog386", "Quit to DOS", NULL};
228
      char *list[] = { "Install Svarog386", "Quit to DOS", NULL};
228
      video_putstring(8, 2, COLOR_BODY[mono], "The installation of Svarog386 to your C: disk is about to begin.");
229
      video_putstring(8, 2, COLOR_BODY[mono], "The installation of Svarog386 to your C: disk is about to begin.");
229
      if (menuselect(10, -1, 4, list) != 0) return(-1);
230
      if (menuselect(10, -1, 4, list) != 0) return(-1);
230
      system("SYS A: C:");
231
      system("SYS A: C:");
-
 
232
      mkdir("C:\\TEMP");
231
      return(0);
233
      return(0);
232
    }
234
    }
233
  }
235
  }
234
}
236
}
235
 
237
 
Line 260... Line 262...
260
  fprintf(fd, "SET DIRCMD=/OGNE/P\r\n");
262
  fprintf(fd, "SET DIRCMD=/OGNE/P\r\n");
261
  fprintf(fd, "SET FDNPKG.CFG=%c:\\SYSTEM\\CFG\\FDNPKG.CFG\r\n");
263
  fprintf(fd, "SET FDNPKG.CFG=%c:\\SYSTEM\\CFG\\FDNPKG.CFG\r\n");
262
  fprintf(fd, "SET WATTCP.CFG=%c:\\SYSTEM\\CFG\\WATTCP.CFG\r\n");
264
  fprintf(fd, "SET WATTCP.CFG=%c:\\SYSTEM\\CFG\\WATTCP.CFG\r\n");
263
  fprintf(fd, "PATH %%DOSDIR%%\\BIN;%%DOSDIR%%\\LINKS\r\n");
265
  fprintf(fd, "PATH %%DOSDIR%%\\BIN;%%DOSDIR%%\\LINKS\r\n");
264
  fprintf(fd, "PROMPT $P$G\r\n");
266
  fprintf(fd, "PROMPT $P$G\r\n");
-
 
267
  fprintf(fd, "ALIAS REBOOT=FDAPM COLDBOOT\r\n");
-
 
268
  fprintf(fd, "ALIAS HALT=FDAPM POWEROFF\r\n");
265
  fprintf(fd, "\r\n\r\n");
269
  fprintf(fd, "\r\n\r\n");
266
  fprintf(fd, "MODE CON CP PREPARE=((991) %c:\\SYSTEM\\SVAROG.386\\CPI\\EGA10.CPX\r\n");
270
  fprintf(fd, "MODE CON CP PREPARE=((991) %c:\\SYSTEM\\SVAROG.386\\CPI\\EGA10.CPX\r\n");
267
  fprintf(fd, "MODE CON CP SELECT=991\r\n");
271
  fprintf(fd, "MODE CON CP SELECT=991\r\n");
268
  fprintf(fd, "\r\n");
272
  fprintf(fd, "\r\n");
269
  fprintf(fd, "SHSUCDX /d:FDCD0001\r\n");
273
  fprintf(fd, "SHSUCDX /d:FDCD0001\r\n");
Line 334... Line 338...
334
    "TREE",
338
    "TREE",
335
    "UNDELETE",
339
    "UNDELETE",
336
    "XCOPY",
340
    "XCOPY",
337
    NULL
341
    NULL
338
  };
342
  };
339
  int i;
343
  int i, pkglistlen;
340
  newscreen();
344
  newscreen();
-
 
345
  /* count how long the pkg list is */
341
  video_putstring(10, 2, COLOR_BODY[mono], "Installing packages...");
346
  for (pkglistlen = 0; pkglist[pkglistlen] != NULL; pkglistlen++);
-
 
347
  /* install packages */
342
  for (i = 0; pkglist[i] != NULL; i++) {
348
  for (i = 0; pkglist[i] != NULL; i++) {
343
    char buff[32];
349
    char buff[16];
-
 
350
    sprintf(buff, "Installing package %d/%d: %s", i, pkglistlen, pkglist[i]);
-
 
351
    video_putstring(10, 2, COLOR_BODY[mono], buff);
344
    sprintf(buff, "FDINST %s.ZIP > NULL");
352
    sprintf(buff, "FDNPKG INSTALL %s > NULL");
345
    system(buff);
353
    system(buff);
346
  }
354
  }
347
}
355
}
348
 
356
 
349
 
357
 
Line 354... Line 362...
354
  /* init screen and detect mono status */
362
  /* init screen and detect mono status */
355
  mono = video_init();
363
  mono = video_init();
356
 
364
 
357
  for (;;) { /* fake loop, it's here just to break out easily */
365
  for (;;) { /* fake loop, it's here just to break out easily */
358
    if (selectlang(lang) < 0) break; /* welcome to svarog, select your language */
366
    if (selectlang(lang) < 0) break; /* welcome to svarog, select your language */
359
    /*selectkeyb();*/ /* if non-english, what keyb layout should we use? */
367
    /*selectkeyb();*/ /* what keyb layout should we use? */
360
    if (welcomescreen() != 0) break; /* what svarog386 is, ask whether to run live dos or install */
368
    if (welcomescreen() != 0) break; /* what svarog386 is, ask whether to run live dos or install */
361
    targetdrv = preparedrive(); /* what drive should we install to? check avail. space */
369
    targetdrv = preparedrive(); /* what drive should we install to? check avail. space */
362
    if (targetdrv < 0) break;
370
    if (targetdrv < 0) break;
363
    /*askaboutsources();*/ /* IF sources are available, ask if installing with them */
371
    /*askaboutsources();*/ /* IF sources are available, ask if installing with them */
364
    installpackages();   /* install packages */
372
    installpackages();   /* install packages */