Hi Jim,

>> is (and would be) to make the installer all in batch language...

Another "light" scripting language like (Regina)
Rexx or bash might also be an idea...

> isn't very powerful in itself, and it would be very difficult
> to build a suitable installer using DOS batch. I've previously

Remember that FreeCOM command.com includes some
extra features, although not as many as Win CMD.

> The core logic of an installer first prompts the user for a few things
> (path, do you want everything or just BASE, do you want source?) then
> the installer needs to iterate through an appropriate list of ZIP...

That should be possible with some SET /P, CHOICE,
FOR variable IN (*.zip) DO ... and similar :-)

> example, based on if the user asked for source, the installer
> ... UNZIP ... include/exclude the SOURCE directory.

That should also be easy enough: Set a variable to
either the empty string or a suitable -x option for
(info-zip's) UNZIP. However, I actually doubt that
it makes sense to INSTALL ALL sources. Instead, at
least in Linux, people tend to install INDIVIDUALLY
the sources only of those packages that they want
to look at or work with at a given moment. In DOS,
it would be an option to copy all package ZIP files
to some location on the install target drive, as a
repository for the user where sources can be fetched
from, using UNZIP on individual package files :-)

Also it does not hurt to tell the user that sources
are already in the zips on the install medium, so
even if NOT installed to the target drive, they are
still available to unzip at any moment from the CD.

> If you assume installing to C:\FDOS,

You can use SET /P to prompt for another place.

However, there are many optional steps BEFORE you
even reach that point - check for partitions and
formats, check for possibly editable boot configs
of Windows or Linux boot loaders, and so on. I do
prefer to either assume those to be given or give
the user a prompt so they can FDISK and FORMAT at
their own risk: There are just too many cases to
consider to make it both automatic and foolproof.

> then the user prompts become binary:

Select-one-out-of-N would also work...

> - Install all packages in all disk sets? Y/N
> - Install source code, too? Y/N
> 
> That's easy enough to do in DOS batch, using CHOICE.

Indeed :-)

>>From there, you just need a way to display progress

That could be as easy as ECHO with messages and a few
empty lines or a frame around them. Bernd would maybe
prefer to suppress output of the tools which do the
actual work and show ONLY the status messages on an
otherwise empty screen, but showing the user what is
going on can also be useful, e.g. if problems occur.

> A simple program that drew a progress bar...

In FreeDOS 1.0, we had a quite flickering bar here ;-)

If the FOR ... IN ... DO of FreeCOM uses a predictable
order, e.g. "as on disk" or "alphabetic", showing the
currently unzipped filename in some highlighted way is
giving enough indication of progress for my taste even
if various unzipper messages scroll through at the same
time. Also, you can use -q or -qq options for UNZIP :-)

> But tracking the logic is more challenging:
> 
> ... a way to store the Y/N prompts, but that's fairly easy.

Indeed. Environment variables will be enough :-)

> Adapting the logic to (not) install everything, and to (not) install
> source code is more challenging, however. Especially the source code,
> if you assume a "combined" ZIP package that includes source along with

As said, that should be no big problem - dynamically
set environment variables then used to build UNZIP
command line options, for example, or jump to labels
which do or do not skip "non-base" repositories (the
repositories can be simply directories) depending on
whether you want a base or full install... :-)

Eric

PS: You could even internationalize things with my 2003
LOCALIZE tool (localize-2003nov04 on my site? or, if it
is, as often, down, a mirror, or somewhere on ibiblio?)
which reads KITTEN (light CATGETS) style files, NLSPATH
and LANG environment variables. 6kB (UPX: 4kB) Turbo C.



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user

Reply via email to