I thought to try something new with the updated installer. Rather than have
one big program that does everything, why not create a few simple tools
that can be used in an INSTALL.BAT to install FreeDOS? Enhanced Batch File
tools already exist, I suppose, but I wanted free software tools. And of
course, I prefer to stamp "FreeDOS 1.2" at the top of the screen. :-)
(If you want to point me to such Enhanced Batch File tools, with source
code under some free license like the GNU GPL, please let me know.)
Before I go much further, I wanted to see what people thought.
Let's say we have a small utility that checks whether or not the C:
partition exists - and if it does, it also checks if the C: drive is
formatted (i.e. writable). This utility might be called CHECKC.EXE and
return these errorlevels:
0 - C: partition exists and drive is writable
1 - C: partition does not exist
2 - C: partition exists but drive is *not* writable
So the first step of the INSTALL.BAT would simply run CHECKC.EXE and then
run FORMAT if errorlevel 2, or run FDISK if errorlevel 1, or proceed
normally if errorlevel 0.
@ECHO OFF
CLS
CHECKC.EXE
IF ERRORLEVEL 2 GOTO *FORMAT*
IF ERRORLEVEL 1 GOTO *FDISK*
GOTO *CONTINUE*
:*FORMAT*
ECHO Ready to format the C: drive and make it bootable!
PAUSE
FORMAT C:
SYS C:
GOTO *CONTINUE*
:*FDISK*
ECHO The C: drive does not exist yet. Please run FDISK to set it up, then
reboot.
PAUSE
FDISK
GOTO *REBOOT*
:*CONTINUE*
(and so on)
To make things look prettier as the INSTALL.BAT prompts the user, we might
use a few enhanced batch file tools such as these:
- VCLS (a "visual" CLS program, which clears the screen with a "FreeDOS
1.2" header on a standard, colorful background)
example: VCLS
- VECHO (a "visual" ECHO program, which displays some text in a "window" on
the screen)
example: VECHO "Please wait ... installing packages"
- VPAUSE (a "visual" PAUSE program, which displays a prompt, and waits for
the user to press a key)
example: VPAUSE "Press any key to begin the install ..."
- VCHOICE (a "visual" CHOICE program, which lets the user select an item
from a list of options)
example: VCHOICE "Do you want to include source code?" "Yes" "No"
I wrote the first three programs using conio. I could write the fourth
(VCHOICE) but I figured it would be easier to manage a long list of options
(for example: selecting a default language) if I used a TUI toolkit
instead. So I'm looking into txwin.
Here's a quick screenshot of the VPAUSE program:
(attached PNG, 2.6kb)
------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel