[Tutor] Finding out if we can use a graphical environment or not

Jeff Shannon jeff@ccvcorp.com
Wed Jul 16 13:20:02 2003


Magnus Lycke wrote:

>
> Will you ever run your programs on a Microsoft platform with
> DOS prompt but no GUI available? What would that be? A toaster? 


While it's unlikely that a given MS platform will not have a GUI 
available, the user may have specific reasons for wanting to run 
something in console mode instead of GUI mode.

> Personally, I'd use different scripts to start up the GUI and console
> version of the application. Keep it simple.


This would be my preferred approach as well.  Write a GUI and a CLI 
version of the interface; both can wrap the same core libraries and 
business logic.  When installing, set the GUI menus and shortcuts to 
point to the GUI version, and put the CLI version somewhere that's easy 
to find (i.e. in a directory in $PATH, possibly modifying $PATH to 
arrange that) with a logical name.  This way, you're giving the user 
control over which version gets run, but in the 99% of the cases where 
the user doesn't care, it'll just do the right thing.  And you don't 
have to muck about with (possibly unreliable) code to try to guess the 
environment.

Jeff Shannon
Technician/Programmer
Credit International