Subversion Repositories SvarDOS

Rev

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

Rev 192 Rev 193
Line 705... Line 705...
705
  r.h.ah = 0; /* re-set video mode (to whatever is set in AL) */
705
  r.h.ah = 0; /* re-set video mode (to whatever is set in AL) */
706
  int86(0x10, &r, &r);
706
  int86(0x10, &r, &r);
707
  }
707
  }
708
}
708
}
709
 
709
 
710
/* checks CD drive drv for the presence of the SvarDOS install CD
710
/* checks that drive drv contains SvarDOS packages
711
 * returns 0 if found, non-zero otherwise */
711
 * returns 0 if found, non-zero otherwise */
712
static int checkcd(char drv) {
712
static int checkinstsrc(char drv) {
713
  FILE *fd;
713
  FILE *fd;
714
  char fname[32];
714
  char fname[16];
715
  snprintf(fname, sizeof(fname), "%c:\\MEM.ZIP", drv);
715
  snprintf(fname, sizeof(fname), "%c:\\ATTRIB.ZIP", drv);
716
  fd = fopen(fname, "rb");
716
  fd = fopen(fname, "rb");
717
  if (fd == NULL) return(-1);
717
  if (fd == NULL) return(-1);
718
  fclose(fd);
718
  fclose(fd);
719
  return(0);
719
  return(0);
720
}
720
}
721
 
721
 
722
 
722
 
723
int main(void) {
723
int main(void) {
724
  struct slocales locales;
724
  struct slocales locales;
725
  int targetdrv;
725
  int targetdrv;
726
  int cdromdrv;
726
  int sourcedrv;
727
  int action;
727
  int action;
728
 
728
 
-
 
729
  /* am I running in install-from-floppy mode? */
-
 
730
  if (checkinstsrc('A') == 0) {
-
 
731
    sourcedrv = 'A';
729
  /* find where the cdrom drive is */
732
  } else { /* otherwise find where the cdrom drive is */
730
  cdromdrv = cdrom_findfirst();
733
    sourcedrv = cdrom_findfirst();
731
  if (cdromdrv < 0) {
734
    if (sourcedrv < 0) {
732
    printf("ERROR: CD-ROM DRIVE NOT FOUND\r\n");
735
      printf("ERROR: CD-ROM DRIVE NOT FOUND\r\n");
733
    return(1);
736
      return(1);
734
  }
737
    }
735
  cdromdrv += 'A'; /* convert the cdrom 'id' (A=0) to an actual drive letter */
738
    sourcedrv += 'A'; /* convert the source drive 'id' (A=0) to an actual drive letter */
736
  if (checkcd(cdromdrv) != 0) {
739
    if (checkinstsrc(sourcedrv) != 0) {
737
    printf("ERROR: SVARDOS INSTALLATION CD NOT FOUND IN THE DRIVE.\r\n");
740
      printf("ERROR: SVARDOS INSTALLATION CD NOT FOUND IN THE DRIVE.\r\n");
738
    return(1);
741
      return(1);
-
 
742
    }
739
  }
743
  }
740
 
744
 
741
  /* init screen and detect mono status */
745
  /* init screen and detect mono status */
742
  mono = video_init();
746
  mono = video_init();
743
 
747
 
Line 760... Line 764...
760
  if (action == MENUPREV) goto SelectLang;
764
  if (action == MENUPREV) goto SelectLang;
761
  targetdrv = preparedrive(); /* what drive should we install to? check avail. space */
765
  targetdrv = preparedrive(); /* what drive should we install to? check avail. space */
762
  if (targetdrv == MENUQUIT) goto Quit;
766
  if (targetdrv == MENUQUIT) goto Quit;
763
  if (targetdrv == MENUPREV) goto WelcomeScreen;
767
  if (targetdrv == MENUPREV) goto WelcomeScreen;
764
  /*askaboutsources();*/ /* IF sources are available, ask if installing with them */
768
  /*askaboutsources();*/ /* IF sources are available, ask if installing with them */
765
  if (installpackages(targetdrv, cdromdrv) != 0) goto Quit;    /* install packages */
769
  if (installpackages(targetdrv, sourcedrv) != 0) goto Quit;    /* install packages */
766
  bootfilesgen(targetdrv, &locales, cdromdrv); /* generate boot files and other configurations */
770
  bootfilesgen(targetdrv, &locales, sourcedrv); /* generate boot files and other configurations */
767
  /*localcfg();*/ /* show local params (currency, etc), and propose to change them (based on localcfg) */
771
  /*localcfg();*/ /* show local params (currency, etc), and propose to change them (based on localcfg) */
768
  /*netcfg();*/ /* basic networking config */
772
  /*netcfg();*/ /* basic networking config */
769
  finalreboot(); /* remove the CD and reboot */
773
  finalreboot(); /* remove the CD and reboot */
770
 
774
 
771
 Quit:
775
 Quit: