Line 279... |
Line 279... |
279 |
char *list[] = { "Create a partition automatically", "Run the FDISK partitioning tool", "Quit to DOS", NULL};
|
279 |
char *list[] = { "Create a partition automatically", "Run the FDISK partitioning tool", "Quit to DOS", NULL};
|
280 |
list[0] = kittengets(0, 3, list[0]);
|
280 |
list[0] = kittengets(0, 3, list[0]);
|
281 |
list[1] = kittengets(0, 4, list[1]);
|
281 |
list[1] = kittengets(0, 4, list[1]);
|
282 |
list[2] = kittengets(0, 2, list[2]);
|
282 |
list[2] = kittengets(0, 2, list[2]);
|
283 |
snprintf(buff, sizeof(buff), kittengets(3, 0, "ERROR: Drive %c: could not be found. Perhaps your hard disk needs to be partitioned first. Please create at least one partition on your hard disk, so Svarog386 can be installed on it. Note, that Svarog386 requires at least %d MiB of available disk space.\n\nYou can use the FDISK partitioning tool for creating the required partition manually, or you can let the installer partitioning your disk automatically. You can also abort the installation to use any other partition manager of your choice."), cselecteddrive, SVAROG_DISK_REQ);
|
283 |
snprintf(buff, sizeof(buff), kittengets(3, 0, "ERROR: Drive %c: could not be found. Perhaps your hard disk needs to be partitioned first. Please create at least one partition on your hard disk, so Svarog386 can be installed on it. Note, that Svarog386 requires at least %d MiB of available disk space.\n\nYou can use the FDISK partitioning tool for creating the required partition manually, or you can let the installer partitioning your disk automatically. You can also abort the installation to use any other partition manager of your choice."), cselecteddrive, SVAROG_DISK_REQ);
|
284 |
putstringwrap(4, 2, COLOR_BODY[mono], buff);
|
284 |
putstringwrap(4, 1, COLOR_BODY[mono], buff);
|
285 |
switch (menuselect(14, -1, 5, list)) {
|
285 |
switch (menuselect(14, -1, 5, list)) {
|
286 |
case 0:
|
286 |
case 0:
|
287 |
system("FDISK /AUTO");
|
287 |
system("FDISK /AUTO");
|
288 |
break;
|
288 |
break;
|
289 |
case 1:
|
289 |
case 1:
|
Line 293... |
Line 293... |
293 |
break;
|
293 |
break;
|
294 |
default:
|
294 |
default:
|
295 |
return(-1);
|
295 |
return(-1);
|
296 |
}
|
296 |
}
|
297 |
newscreen();
|
297 |
newscreen();
|
298 |
putstringnls(11, 10, COLOR_BODY[mono], 3, 1, "Your computer will reboot now.");
|
298 |
putstringnls(10, 10, COLOR_BODY[mono], 3, 1, "Your computer will reboot now.");
|
299 |
putstringnls(12, 10, COLOR_BODY[mono], 0, 5, "Press any key...");
|
299 |
putstringnls(12, 10, COLOR_BODY[mono], 0, 5, "Press any key...");
|
300 |
input_getkey();
|
300 |
input_getkey();
|
301 |
reboot();
|
301 |
reboot();
|
302 |
return(-1);
|
302 |
return(-1);
|
303 |
} else if (driveremovable > 0) {
|
303 |
} else if (driveremovable > 0) {
|
304 |
snprintf(buff, sizeof(buff), kittengets(3, 2, "ERROR: Drive %c: is a removable device. Installation aborted."), cselecteddrive);
|
304 |
snprintf(buff, sizeof(buff), kittengets(3, 2, "ERROR: Drive %c: is a removable device. Installation aborted."), cselecteddrive);
|
305 |
video_putstring(9, 2, COLOR_BODY[mono], buff, -1);
|
305 |
video_putstring(9, 1, COLOR_BODY[mono], buff, -1);
|
306 |
putstringnls(11, 2, COLOR_BODY[mono], 0, 5, "Press any key...");
|
306 |
putstringnls(11, 2, COLOR_BODY[mono], 0, 5, "Press any key...");
|
307 |
return(-1);
|
307 |
return(-1);
|
308 |
}
|
308 |
}
|
309 |
/* if not formatted, propose to format it right away (try to create a directory) */
|
309 |
/* if not formatted, propose to format it right away (try to create a directory) */
|
310 |
snprintf(buff, sizeof(buff), "%c:\\SVWRTEST.123", cselecteddrive);
|
310 |
snprintf(buff, sizeof(buff), "%c:\\SVWRTEST.123", cselecteddrive);
|
Line 313... |
Line 313... |
313 |
} else {
|
313 |
} else {
|
314 |
char *list[] = { "Proceed with formatting", "Quit to DOS", NULL};
|
314 |
char *list[] = { "Proceed with formatting", "Quit to DOS", NULL};
|
315 |
list[0] = kittengets(0, 6, list[0]);
|
315 |
list[0] = kittengets(0, 6, list[0]);
|
316 |
list[1] = kittengets(0, 2, list[1]);
|
316 |
list[1] = kittengets(0, 2, list[1]);
|
317 |
snprintf(buff, sizeof(buff), kittengets(3, 3, "ERROR: Drive %c: seems to be unformated. Do you wish to format it?"), cselecteddrive);
|
317 |
snprintf(buff, sizeof(buff), kittengets(3, 3, "ERROR: Drive %c: seems to be unformated. Do you wish to format it?"), cselecteddrive);
|
318 |
video_putstring(7, 2, COLOR_BODY[mono], buff, -1);
|
318 |
video_putstring(7, 1, COLOR_BODY[mono], buff, -1);
|
319 |
if (menuselect(12, -1, 4, list) != 0) return(-1);
|
319 |
if (menuselect(12, -1, 4, list) != 0) return(-1);
|
320 |
video_clear(0x0700, 0);
|
320 |
video_clear(0x0700, 0);
|
321 |
video_movecursor(0, 0);
|
321 |
video_movecursor(0, 0);
|
322 |
snprintf(buff, sizeof(buff), "FORMAT %c: /Q /U /Z:seriously /V:SVAROG386", cselecteddrive);
|
322 |
snprintf(buff, sizeof(buff), "FORMAT %c: /Q /U /Z:seriously /V:SVAROG386", cselecteddrive);
|
323 |
system(buff);
|
323 |
system(buff);
|
Line 326... |
Line 326... |
326 |
/* check total disk space */
|
326 |
/* check total disk space */
|
327 |
ds = disksize(selecteddrive);
|
327 |
ds = disksize(selecteddrive);
|
328 |
if (ds < SVAROG_DISK_REQ) {
|
328 |
if (ds < SVAROG_DISK_REQ) {
|
329 |
int y = 9;
|
329 |
int y = 9;
|
330 |
snprintf(buff, sizeof(buff), kittengets(3, 4, "ERROR: Drive %c: is not big enough! Svarog386 requires a disk of at least %d MiB."), cselecteddrive);
|
330 |
snprintf(buff, sizeof(buff), kittengets(3, 4, "ERROR: Drive %c: is not big enough! Svarog386 requires a disk of at least %d MiB."), cselecteddrive);
|
331 |
y += putstringwrap(y, 2, COLOR_BODY[mono], buff);
|
331 |
y += putstringwrap(y, 1, COLOR_BODY[mono], buff);
|
332 |
putstringnls(++y, 2, COLOR_BODY[mono], 0, 5, "Press any key...");
|
332 |
putstringnls(++y, 2, COLOR_BODY[mono], 0, 5, "Press any key...");
|
333 |
input_getkey();
|
333 |
input_getkey();
|
334 |
return(-1);
|
334 |
return(-1);
|
335 |
}
|
335 |
}
|
336 |
/* is the disk empty? */
|
336 |
/* is the disk empty? */
|
337 |
if (diskempty(selecteddrive) != 0) {
|
337 |
if (diskempty(selecteddrive) != 0) {
|
338 |
char *list[] = { "Proceed with formatting", "Quit to DOS", NULL};
|
338 |
char *list[] = { "Proceed with formatting", "Quit to DOS", NULL};
|
339 |
list[0] = kittengets(0, 6, list[0]);
|
339 |
list[0] = kittengets(0, 6, list[0]);
|
340 |
list[1] = kittengets(0, 2, list[1]);
|
340 |
list[1] = kittengets(0, 2, list[1]);
|
341 |
snprintf(buff, sizeof(buff), kittengets(3, 5, "ERROR: Drive %c: is not empty. Svarog386 must be installed on an empty disk.\n\nYou can format the disk now, to make it empty. Note however, that this will ERASE ALL CURRENT DATA on your disk."), cselecteddrive);
|
341 |
snprintf(buff, sizeof(buff), kittengets(3, 5, "ERROR: Drive %c: is not empty. Svarog386 must be installed on an empty disk.\n\nYou can format the disk now, to make it empty. Note however, that this will ERASE ALL CURRENT DATA on your disk."), cselecteddrive);
|
342 |
putstringwrap(7, 2, COLOR_BODY[mono], buff);
|
342 |
putstringwrap(7, 1, COLOR_BODY[mono], buff);
|
343 |
if (menuselect(12, -1, 4, list) != 0) return(-1);
|
343 |
if (menuselect(12, -1, 4, list) != 0) return(-1);
|
344 |
video_clear(0x0700, 0);
|
344 |
video_clear(0x0700, 0);
|
345 |
video_movecursor(0, 0);
|
345 |
video_movecursor(0, 0);
|
346 |
snprintf(buff, sizeof(buff), "FORMAT %c: /Q /U /Z:seriously /V:SVAROG386", cselecteddrive);
|
346 |
snprintf(buff, sizeof(buff), "FORMAT %c: /Q /U /Z:seriously /V:SVAROG386", cselecteddrive);
|
347 |
system(buff);
|
347 |
system(buff);
|
Line 520... |
Line 520... |
520 |
/* install packages */
|
520 |
/* install packages */
|
521 |
for (i = 0; pkglist[i] != NULL; i++) {
|
521 |
for (i = 0; pkglist[i] != NULL; i++) {
|
522 |
char buff[128];
|
522 |
char buff[128];
|
523 |
snprintf(buff, sizeof(buff), kittengets(4, 0, "Installing package %d/%d: %s"), i+1, pkglistlen, pkglist[i]);
|
523 |
snprintf(buff, sizeof(buff), kittengets(4, 0, "Installing package %d/%d: %s"), i+1, pkglistlen, pkglist[i]);
|
524 |
strcat(buff, " ");
|
524 |
strcat(buff, " ");
|
525 |
video_putstring(10, 2, COLOR_BODY[mono], buff, -1);
|
525 |
video_putstring(10, 1, COLOR_BODY[mono], buff, -1);
|
526 |
if (pkglist[i][1] == ':') {
|
526 |
if (pkglist[i][1] == ':') {
|
527 |
snprintf(buff, sizeof(buff), "FDINST INSTALL %s.ZIP > NUL", pkglist[i]);
|
527 |
snprintf(buff, sizeof(buff), "FDINST INSTALL %s.ZIP > NUL", pkglist[i]);
|
528 |
} else {
|
528 |
} else {
|
529 |
snprintf(buff, sizeof(buff), "FDINST INSTALL %c:\\CORE\\%s.ZIP > NUL", cdromdrv, pkglist[i]);
|
529 |
snprintf(buff, sizeof(buff), "FDINST INSTALL %c:\\CORE\\%s.ZIP > NUL", cdromdrv, pkglist[i]);
|
530 |
}
|
530 |
}
|
Line 535... |
Line 535... |
535 |
|
535 |
|
536 |
static void finalreboot(void) {
|
536 |
static void finalreboot(void) {
|
537 |
int y = 9;
|
537 |
int y = 9;
|
538 |
newscreen();
|
538 |
newscreen();
|
539 |
y += putstringnls(y, 2, COLOR_BODY[mono], 5, 0, "Svarog386 installation is over. Your computer will reboot now.\nPlease remove the installation disk from your drive.");
|
539 |
y += putstringnls(y, 2, COLOR_BODY[mono], 5, 0, "Svarog386 installation is over. Your computer will reboot now.\nPlease remove the installation disk from your drive.");
|
540 |
putstringnls(++y, 2, COLOR_BODY[mono], 0, 5, "Press any key...");
|
540 |
putstringnls(++y, 1, COLOR_BODY[mono], 0, 5, "Press any key...");
|
541 |
input_getkey();
|
541 |
input_getkey();
|
542 |
reboot();
|
542 |
reboot();
|
543 |
}
|
543 |
}
|
544 |
|
544 |
|
545 |
|
545 |
|
Line 585... |
Line 585... |
585 |
|
585 |
|
586 |
/* init screen and detect mono status */
|
586 |
/* init screen and detect mono status */
|
587 |
mono = video_init();
|
587 |
mono = video_init();
|
588 |
|
588 |
|
589 |
for (;;) { /* fake loop, it's here just to break out easily */
|
589 |
for (;;) { /* fake loop, it's here just to break out easily */
|
- |
|
590 |
kittenopen("INSTALL"); /* NLS support */
|
590 |
if (selectlang(lang) < 0) break; /* welcome to svarog, select your language */
|
591 |
if (selectlang(lang) < 0) break; /* welcome to svarog, select your language */
|
591 |
setenv("LANG", lang, 1);
|
592 |
setenv("LANG", lang, 1);
|
592 |
loadcp(lang);
|
593 |
loadcp(lang);
|
- |
|
594 |
kittenclose(); /* reload NLS with new language */
|
593 |
kittenopen("INSTALL"); /* NLS support */
|
595 |
kittenopen("INSTALL"); /* NLS support */
|
594 |
/*selectkeyb();*/ /* what keyb layout should we use? */
|
596 |
/*selectkeyb();*/ /* what keyb layout should we use? */
|
595 |
if (welcomescreen() != 0) break; /* what svarog386 is, ask whether to run live dos or install */
|
597 |
if (welcomescreen() != 0) break; /* what svarog386 is, ask whether to run live dos or install */
|
596 |
targetdrv = preparedrive(); /* what drive should we install to? check avail. space */
|
598 |
targetdrv = preparedrive(); /* what drive should we install to? check avail. space */
|
597 |
if (targetdrv < 0) break;
|
599 |
if (targetdrv < 0) break;
|