Subversion Repositories SvarDOS

Rev

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

Rev 625 Rev 700
Line 754... Line 754...
754
    /* install the package */
754
    /* install the package */
755
    snprintf(buff, sizeof(buff), svarlang_strid(0x0400), i+1, pkglistlen, pkgptr); /* "Installing package %d/%d: %s" */
755
    snprintf(buff, sizeof(buff), svarlang_strid(0x0400), i+1, pkglistlen, pkgptr); /* "Installing package %d/%d: %s" */
756
    strcat(buff, "       ");
756
    strcat(buff, "       ");
757
    video_putstringfix(10, 1, COLOR_BODY[mono], buff, sizeof(buff));
757
    video_putstringfix(10, 1, COLOR_BODY[mono], buff, sizeof(buff));
758
    /* wait for new diskette if package not found */
758
    /* wait for new diskette if package not found */
759
    snprintf(buff, sizeof(buff), "%c:\\%s.zip", srcdrv, pkgptr);
759
    snprintf(buff, sizeof(buff), "%c:\\%s.svp", srcdrv, pkgptr);
760
    while (fileexists(buff) != 0) {
760
    while (fileexists(buff) != 0) {
761
      putstringnls(12, 1, COLOR_BODY[mono], 4, 1); /* "INSERT THE DISK THAT CONTAINS THE REQUIRED FILE AND PRESS ANY KEY" */
761
      putstringnls(12, 1, COLOR_BODY[mono], 4, 1); /* "INSERT THE DISK THAT CONTAINS THE REQUIRED FILE AND PRESS ANY KEY" */
762
      input_getkey();
762
      input_getkey();
763
      video_putstringfix(12, 1, COLOR_BODY[mono], "", 80); /* erase the 'insert disk' message */
763
      video_putstringfix(12, 1, COLOR_BODY[mono], "", 80); /* erase the 'insert disk' message */
764
    }
764
    }
765
    /* proceed with package copy (buff contains the src filename already) */
765
    /* proceed with package copy (buff contains the src filename already) */
766
    snprintf(buff + 32, sizeof(buff) - 32, "%c:\\temp\\%s.zip", targetdrv, pkgptr);
766
    snprintf(buff + 32, sizeof(buff) - 32, "%c:\\temp\\%s.svp", targetdrv, pkgptr);
767
    if (fcopy(buff + 32, buff, buff, sizeof(buff)) != 0) {
767
    if (fcopy(buff + 32, buff, buff, sizeof(buff)) != 0) {
768
      video_putstring(10, 30, COLOR_BODY[mono], "READ ERROR", -1);
768
      video_putstring(10, 30, COLOR_BODY[mono], "READ ERROR", -1);
769
      input_getkey();
769
      input_getkey();
770
      fclose(fd);
770
      fclose(fd);
771
      return(-1);
771
      return(-1);
772
    }
772
    }
773
    /* write install instruction to post-install script */
773
    /* write install instruction to post-install script */
774
    fprintf(fd, "pkg install %s.zip\r\ndel %s.zip\r\n", pkgptr, pkgptr);
774
    fprintf(fd, "pkg install %s.svp\r\ndel %s.svp\r\n", pkgptr, pkgptr);
775
    /* jump to next entry or end of list */
775
    /* jump to next entry or end of list */
776
    while ((*pkgptr != 0) && (*pkgptr != 0xff)) pkgptr++;
776
    while ((*pkgptr != 0) && (*pkgptr != 0xff)) pkgptr++;
777
    if (*pkgptr == 0xff) break;
777
    if (*pkgptr == 0xff) break;
778
  }
778
  }
779
  /* set up locales so the "installation over" message is nicely displayed */
779
  /* set up locales so the "installation over" message is nicely displayed */
Line 846... Line 846...
846
#ifdef DEADCODE
846
#ifdef DEADCODE
847
/* checks that drive drv contains SvarDOS packages
847
/* checks that drive drv contains SvarDOS packages
848
 * returns 0 if found, non-zero otherwise */
848
 * returns 0 if found, non-zero otherwise */
849
static int checkinstsrc(char drv) {
849
static int checkinstsrc(char drv) {
850
  char fname[16];
850
  char fname[16];
851
  snprintf(fname, sizeof(fname), "%c:\\ATTRIB.ZIP", drv);
851
  snprintf(fname, sizeof(fname), "%c:\\ATTRIB.SVP", drv);
852
  return(fileexists(fname));
852
  return(fileexists(fname));
853
}
853
}
854
#endif
854
#endif
855
 
855
 
856
 
856