Subversion Repositories SvarDOS

Rev

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

Rev 1930 Rev 1934
Line 850... Line 850...
850
  }
850
  }
851
 
851
 
852
  /*** CREATE DIRECTORY FOR CONFIGURATION FILES ***/
852
  /*** CREATE DIRECTORY FOR CONFIGURATION FILES ***/
853
  snprintf(buff, sizeof(buff), "%c:\\SVARDOS", bootdrv);
853
  snprintf(buff, sizeof(buff), "%c:\\SVARDOS", bootdrv);
854
  mkdir(buff);
854
  mkdir(buff);
855
  snprintf(buff, sizeof(buff), "%c:\\SVARDOS\\CFG", bootdrv);
-
 
856
  mkdir(buff);
-
 
857
 
855
 
858
  /****************
856
  /****************
859
   * PKG.CFG      *
857
   * PKG.CFG      *
860
   ****************/
858
   ****************/
861
  snprintf(buff, sizeof(buff), "%c:\\SVARDOS\\CFG\\PKG.CFG", bootdrv);
859
  snprintf(buff, sizeof(buff), "%c:\\SVARDOS\\CFG\\PKG.CFG", bootdrv);
Line 953... Line 951...
953
  snprintf(buff, sizeof(buff), "%c:\\TEMP\\INSTALL.COM", targetdrv);
951
  snprintf(buff, sizeof(buff), "%c:\\TEMP\\INSTALL.COM", targetdrv);
954
  fcopy(buff, buff + 8, buff, sizeof(buff));
952
  fcopy(buff, buff + 8, buff, sizeof(buff));
955
  snprintf(buff, sizeof(buff), "%c:\\TEMP\\INSTALL.LNG", targetdrv);
953
  snprintf(buff, sizeof(buff), "%c:\\TEMP\\INSTALL.LNG", targetdrv);
956
  fcopy(buff, buff + 8, buff, sizeof(buff));
954
  fcopy(buff, buff + 8, buff, sizeof(buff));
957
 
955
 
958
  /* open the post-install autoexec.bat and prepare initial instructions */
-
 
959
  snprintf(buff, sizeof(buff), "%c:\\TEMP\\POSTINST.BAT", targetdrv);
-
 
960
  fd = fopen(buff, "wb");
-
 
961
  if (fd == NULL) return(-1);
-
 
962
  fprintf(fd, "@ECHO OFF\r\n"
-
 
963
              "INSTALL"  /* installer will run in 2nd stage (generating pkg.cfg and stuff) */
-
 
964
              "ECHO INSTALLING SVARDOS BUILD %s\r\n", BUILDSTRING);
-
 
965
 
-
 
966
  /* move COMMAND.COM so it does not clashes with the installation of the SVARCOM package */
-
 
967
  fprintf(fd, "COPY \\COMMAND.COM \\CMD.COM\r\n");
-
 
968
  fprintf(fd, "SET COMSPEC=\\CMD.COM\r\n"); /* no drive letter because I do not know it */
-
 
969
  fprintf(fd, "DEL \\COMMAND.COM\r\n");
-
 
970
 
-
 
971
  /* delete the temporary KERNEL.SYS - it will be properly installed from the package in a short moment */
-
 
972
  fprintf(fd, "DEL \\KERNEL.SYS\r\n");
-
 
973
 
-
 
974
  /* copy packages */
956
  /* copy packages */
975
  for (i = 0;; i++) {
957
  for (i = 0;; i++) {
976
    RETRY_ENTIRE_LIST:
958
    RETRY_ENTIRE_LIST:
977
 
959
 
978
    /* move forward to nearest entry or end of list */
960
    /* move forward to nearest entry or end of list */
Line 1003... Line 985...
1003
    /* proceed with package copy */
985
    /* proceed with package copy */
1004
    sprintf(buff, "%c:\\TEMP\\%s.svp", targetdrv, pkgptr);
986
    sprintf(buff, "%c:\\TEMP\\%s.svp", targetdrv, pkgptr);
1005
    if (fcopy(buff, buff + 8, buff, sizeof(buff)) != 0) {
987
    if (fcopy(buff, buff + 8, buff, sizeof(buff)) != 0) {
1006
      mdr_cout_str(10, 30, "READ ERROR", COLOR_BODY, 80);
988
      mdr_cout_str(10, 30, "READ ERROR", COLOR_BODY, 80);
1007
      mdr_dos_getkey();
989
      mdr_dos_getkey();
1008
      fclose(fd);
-
 
1009
      return(-1);
990
      return(-1);
1010
    }
991
    }
1011
    /* write install instruction to post-install script */
-
 
1012
    fprintf(fd, "pkg install %s.svp\r\ndel %s.svp\r\n", pkgptr, pkgptr);
-
 
1013
    /* jump to next entry or end of list and zero out the pkg name in the process */
992
    /* jump to next entry or end of list and zero out the pkg name in the process */
1014
    while ((*pkgptr != 0) && (*pkgptr != 0xff)) {
993
    while ((*pkgptr != 0) && (*pkgptr != 0xff)) {
1015
      *pkgptr = 0;
994
      *pkgptr = 0;
1016
      pkgptr++;
995
      pkgptr++;
1017
    }
996
    }
1018
  }
997
  }
-
 
998
 
1019
  /* set up locales so the "installation over" message is nicely displayed */
999
  /* open the post-install autoexec.bat and prepare initial instructions */
-
 
1000
  snprintf(buff, sizeof(buff), "%c:\\TEMP\\POSTINST.BAT", targetdrv);
1020
  genlocalesconf(fd, locales);
1001
  fd = fopen(buff, "wb");
-
 
1002
  if (fd == NULL) return(-1);
-
 
1003
  fputs(
-
 
1004
    "@ECHO OFF\r\n"
-
 
1005
    "INSTALL\r\n"  /* installer will run in 2nd stage (generating pkg.cfg and stuff) */
-
 
1006
    "ECHO INSTALLING SVARDOS\r\n"
-
 
1007
    "COPY \\COMMAND.COM \\CMD.COM\r\n" /* move COMMAND.COM so it does not clashes with the installation of the SVARCOM package */
-
 
1008
    "SET COMSPEC=\\CMD.COM\r\n" /* no drive letter because I do not know it */
-
 
1009
    "DEL \\COMMAND.COM\r\n"
-
 
1010
    "DEL \\KERNEL.SYS\r\n" /* KERNEL.SYS will be installed from the package in a moment */
-
 
1011
    "FOR %%P IN (*.SVP) DO PKG INSTALL %%P\r\n" /* install packages */
-
 
1012
    "DEL *.SVP\r\n", fd);
-
 
1013
 
1021
  /* replace autoexec.bat and config.sys now and write some nice message on screen */
1014
  /* replace autoexec.bat and config.sys now and write some nice message on screen */
1022
  fprintf(fd, "DEL pkg.exe\r\n"
1015
  fprintf(fd, "DEL pkg.exe\r\n"
1023
              "DEL install.com\r\n"
1016
              "DEL install.com\r\n"
-
 
1017
              "DEL install.lng\r\n"
1024
              "COPY CONFIG.SYS \\\r\n"
1018
              "COPY CONFIG.SYS \\\r\n"
1025
              "DEL CONFIG.SYS\r\n"
1019
              "DEL CONFIG.SYS\r\n"
1026
              "DEL \\AUTOEXEC.BAT\r\n"
1020
              "DEL \\AUTOEXEC.BAT\r\n"
1027
              "COPY AUTOEXEC.BAT \\\r\n"
1021
              "COPY AUTOEXEC.BAT \\\r\n"
1028
              "DEL AUTOEXEC.BAT\r\n"
1022
              "DEL AUTOEXEC.BAT\r\n"
Line 1040... Line 1034...
1040
  snprintf(buff, sizeof(buff), "%c:\\autoexec.bat", targetdrv);
1034
  snprintf(buff, sizeof(buff), "%c:\\autoexec.bat", targetdrv);
1041
  fd = fopen(buff, "wb");
1035
  fd = fopen(buff, "wb");
1042
  if (fd == NULL) return(-1);
1036
  if (fd == NULL) return(-1);
1043
  fprintf(fd, "@ECHO OFF\r\n"
1037
  fprintf(fd, "@ECHO OFF\r\n"
1044
              "SET DOSDIR=\\SVARDOS\r\n"
1038
              "SET DOSDIR=\\SVARDOS\r\n"
1045
              "SET NLSPATH=%%DOSDIR%%\\NLS\r\n"
-
 
1046
              "PATH %%DOSDIR%%\r\n");
1039
              "PATH %%DOSDIR%%\r\n");
1047
  genlocalesconf(fd, locales);
1040
  genlocalesconf(fd, locales);
1048
  fprintf(fd, "CD TEMP\r\n"
1041
  fprintf(fd, "CD TEMP\r\n"
1049
              "postinst.bat\r\n");
1042
              "postinst.bat\r\n");
1050
  fclose(fd);
1043
  fclose(fd);