[comp.sys.amiga] FULLY INTERACTIVE SCRIPTS

papa@pollux.usc.edu (Marco Papa) (05/06/88)

		FULLY INTERATIVE SCRIPTS FOR XICON

			   A Tutorial
				by
			 Marco Papa 'Doc'

Now that I am putting the final touches on A-Talk III, the problem has come
up of how to create fully interactive scripts for its installation on a
Hard Disk and with foreign fonts. The requirement is that the install program
must be run from the workbench so that it will work for the non-CLI user as
well.

Various versions of XICON exist that allow execution of a "script" file 
from an icon. More than two are available on the Fish disks (Pete Goodeve's 
is on FF 102) and another version is included in WB 1.3.  Both work pretty
much the same in the sense that they use the DEFAULT TOOL to invoke XICON
and then execute a script with the same name as the icon (save the .info).

My requirement is that the user must be able to SELECT among a given set
of PREDEFINED options [in the case of fonts for foreign countries] and among
a NON-PREDEFINED set of options [ in the case of a hard disk partition name].

It turns out that there is NO command besides ASK that interprets user input.
The ASK command just allows one to answer "y" or "n" and returns an different 
error value in each case. This is OK for yes/no questions, but was no good 
for my case.  I looked at what others had done, and in all cases people have
written ad-hoc programs that ask a very specific set of questions. What I
wanted was a SIMPLE, SINGLE command that would allow me to use it in all
cases I needed.  Since I am writing this, you've probably guessed that I have 
found such a stupid, little program.

The program getline.c [appended at the end of this file in source and
MANX-compiled binary] gets input from the keyboard, using MANX built in
CLI-like line editing, stores the entered data in a buffer and sends the 
entire string to standard output when the carriage return is pressed.

Its use is as follows:

echo "where do you want to go [DF0:,DF1:,DF2:] ?"
;
getline >RAM:__DUMMY
;
cd <RAM:__DUMMY ?

That is, getline's output is redirected to a dummy file in RAM:. The contents
of the dummy file is then redirected as input to the CD command.  Note that the
? is required.  This technique [using < and ?] works with the CBM provided 
DOS commands and should also work with the ARP commands [though that exercise
is left to the reader.]

Note also that inteactive commands CANNOT be executed with the window initially
opened by XICON.  The standard way is to add a line of the type:

NEWCLI >NIL: con:x/y/w/h/name FROM Install

as the last line of the script executed by XICON and include the "interactive"
part in the "Install" script.

The solution is so simple that I am surprised that nobody came up with it
before.  Anyway, here is the code and binary for getline.c, plus the 
2 scripts files for installing fonts with A-Talk III.  The code seemed so small
and the problems with the moderated groups so large, that I don't feel bad
about posting this.

Enjoy.

-- Marco Papa 'Doc'

#!/bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #!/bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
#	getline.c
#	xicon-install
#	FD-Install
#	getline.uue
# This archive created: Thu May  5 22:23:16 1988
# By:	Marco Papa (Felsina Software, Los Angeles, CA)
export PATH; PATH=/bin:$PATH
echo shar: extracting "'getline.c'" '(804 characters)'
if test -f 'getline.c'
then
	echo shar: over-writing existing file "'getline.c'"
fi
sed 's/^X//' << \SHAR_EOF > 'getline.c'
X/*
X * getline.c -- get a line from stdin with "line editing" and send to stdout
X *
X * Copyright (C) 1988 Marco Papa 'Doc'
X * Permission is granted for ANY use of this code if the above notice
X * is left intact.
X */
X
X#include "ctype.h"
X#include "stdio.h"
X
Xstatic char chatbuf[80];
Xstatic short chatindex = 0;
X
Xmain(argc,argv)
X{
X	int ch;
X
X	for (;;) {
X		ch = getchar();
X		InputChat(ch);		
X	}
X}
X
XInputChat(ch)
Xint ch;
X{
X
Xchar c;
X
X	    c = ch & 0177;
X	    if (iscntrl(c)) {
X			switch (c) {
X			case '\n':
X				FlushChat();
X				break;
X			default:
X				/* **** throw it away */
X				break;
X			}
X	    } else { /* if not control */
X		chatbuf[chatindex++] = c;
X	    }
X	    if (chatindex == 80) FlushChat();
X}
X
XFlushChat()
X{
X	int i;
X
X	for (i=0;i<chatindex;i++)
X		putchar(chatbuf[i]); 
X	putchar('\n'); 
X	exit(0);
X}
X
X
X
X
X
SHAR_EOF
if test 804 -ne "`wc -c 'getline.c'`"
then
	echo shar: error transmitting "'getline.c'" '(should have been 804 characters)'
fi
echo shar: extracting "'xicon-install'" '(245 characters)'
if test -f 'xicon-install'
then
	echo shar: over-writing existing file "'xicon-install'"
fi
sed 's/^X//' << \SHAR_EOF > 'xicon-install'
XATInstall:HardDisk/failat 30
XATInstall:HardDisk/echo "*E[4mSetting up for first time floppy disk installation.*E[0m*N"
XATInstall:HardDisk/failat 10
XATInstall:HardDisk/cd ATInstall:HardDisk
Xnewcli >NIL: con:0/0/640/200/FloppyDisk from FD-Install
SHAR_EOF
if test 245 -ne "`wc -c 'xicon-install'`"
then
	echo shar: error transmitting "'xicon-install'" '(should have been 245 characters)'
fi
echo shar: extracting "'FD-Install'" '(1241 characters)'
if test -f 'FD-Install'
then
	echo shar: over-writing existing file "'FD-Install'"
fi
sed 's/^X//' << \SHAR_EOF > 'FD-Install'
Xcd ATInstall:HardDisk
Xecho "First time floppy disk installation.*N"
Xecho "Warning: this procedure will modify your A-Talk III floppy disk."
Xask  "Do you want to continue ? [Press RETURN to exit] "
X;
Xif NOT WARN
X  SKIP endit
XENDIF
X;
Xfailat 30
X;
Xecho "Which county-dependent fonts do you want to install in the"
Xecho "A-Talk III disk?"
Xecho "[u]     USA/UK"
Xecho "[s]     Swedish/Finnish"
Xecho "[d]     Danish/Norwegian"
Xecho "[g]     German"
Xecho "[f]     French"
Xecho "[i]     Italian"
Xecho "Enter country code [end with RETURN]: "
Xgetline >RAM:__ATF        <---------------------- [SETUP ***************]
X;
XIF not exists AT3:fonts
X  echo "Font directory on Disk 1 (AT3) not found."
X  echo "Exiting..."
X  SKIP endit
XENDIF
X;
XIF not exists ATInstall:fonts
X  echo "Font directory on Disk 2 (ATInstall) not found."
X  echo "Exiting..."
X  SKIP endit
XENDIF
X;
XCD ATInstall:fonts
XCD <RAM:__ATF ?        <---------------------- [USE ***************]
XIF WARN
X  echo "Invalid Country Code."
X  SKIP endit
XEndif
Xecho "*NCopying fonts to the A-Talk III disk."
Xcopy #? to AT3:fonts ALL
X;
XIf WARN
X  echo "Error occurred while copying fonts."
XElse
X  echo "All fonts have been copied."
X  echo "Installation is completed."
XEndif
X;
Xlab endit
XWait 5
Xendcli >nil:
SHAR_EOF
if test 1241 -ne "`wc -c 'FD-Install'`"
then
	echo shar: error transmitting "'FD-Install'" '(should have been 1241 characters)'
fi
echo shar: extracting "'getline.uue'" '(6282 characters)'
if test -f 'getline.uue'
then
	echo shar: over-writing existing file "'getline.uue'"
fi
sed 's/^X//' << \SHAR_EOF > 'getline.uue'
Xbegin 640 getline
XM   #\P         #          (   /'    O     $   /I   #QT[Z JA.
XM5?_\2&R ADZZ ,I83RM __PO+?_\80A83V#H3EU.=4Y5__X@+0 (P+P   !_
XM&T#__Q M__](@$C 0>R !0@P  4( &<<$"W__TB 2,!@!F$P8 Q@"I"\    
XM"F?R8/1@$C L@ )2;( "0>R"2A&M__\   QL %"  F8"801.74YU3E7__$*M
XM__Q@($AL@)P@+?_\0>R"2A(P" !(@4C!+P%.N@:.4$]2K?_\,"R  DC (BW_
XM_+* ;=)(;("<2'@ "DZZ!FY03T*G3KH+6%A/3EU.=4Y5  !(YP@@)&T ""\*
XM3KH ,B@ L+S_____6$]G(" $8!13D@CJ  , #'#_3-\$$$Y=3G5@UDJ 9_I9
XM@&?D( 1@ZDY5   O"B1M  @@4K'J  1E#"\*81I83R1?3EU.=2!24I(0$$B 
XM2,# O    /]@Z$Y5  !(YP@P)&T "! J  S /  89PIP_TS?#!!.74YU"*H 
XM @ ,2JH "&8(+PI.N@@<6$\0*@ ,2(!(P @   =G-D'L@(8F2! K  Q(@$C 
XMP+P   "$L+P   "$9@Q(>/__+PM.N@:\4$_7_    !9![((^M\AET# J !!(
XMP"\ +RH "! J  U(@$C +P!.N@!"* !*@$_O  QN%$J$9@1P"& "<!"!*@ ,
XM</]@ /]J)*H ""!J  C1Q"5(  0@4E*2$!!(@$C P+P   #_8 #_2$Y5  !(
XMYPP@*"T "$ZZ":1R!B $3KH+@"1 U>R"GDJ$;0XP+((^2,"X@&P$2I)F$BE\
XM     H*B</],WP0P3EU.=3 J  1(P,"\     ["\     68,*7P    %@J)P
XM_V#8+RT $"\M  PO$DZZ"Z(J +"\_____T_O  QF#$ZZ"V8I0(*B</]@L" %
XM8*QA<$/L@DI%[()*M<EF#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&H  0 0
XM9C ;;0 /__](>  !2&W__Q J  U(@$C +P!.N@(RL+P    !3^\ #&:8("T 
XM#&  _UXDJ@ (,"H $$C T*H ""5   0(Z@ "  P@4E*2$"T #Q" 2(!(P,"\
XM    _V  _RY.50  +PI![("&)$A**@ ,9QC5_    !9![((^M<AE"'  )%].
XM74YU8.)"DD*J  1"J@ (( I@ZDY5__PO"B1M  A(> 0 3KH PBM __Q83V88
XM-7P  0 0($K1_     XE2  ()%].74YU-7P$   0".H  0 ,)6W__  ($"H 
XM#4B 2, O $ZZ -Y*@%A/9P8 *@"   Q@S$Y5  !(YP P)&R"FF 4)E(@*@ $
XM4( O "\*3KH$D%!/)$L@"F;H0JR"FDS?# !.74YU3E4  "\*0?K_QBE(@M9"
XMIR M  A0@"\ 3KH$/B1 2H!03V8(<  D7TY=3G4DK(*:)6T "  $*4J"FB *
XM4(!@YDY5   O+0 (8;983TY=3G5.50  2.< ,)?+)&R"FF .(&T "%&(L<IG
XM$B9*)%(@"F;N</],WPP 3EU.=2 +9P0FDF $*5*"FB J  10@"\ +PI.N@/F
XM< !03V#83E4  "\*<@8@+0 (3KH"X"1 U>R"GDJM  AM$C L@CY(P"(M  BR
XM@&P$2I)F$"E\     H*B</\D7TY=3G5R!B M  A.N@*H(&R"GB\P" !.N@+T
XM2H!83V<$< %@ G  8-9.50  +RT "$ZZ KY*@%A/9@Y.N@+(*4""HG#_3EU.
XM=7  8/A.50  2.<,("@M  A.N@!V<@8@!$ZZ E(D0-7L@IY*A&T.,"R"/DC 
XMN(!L!$J29A(I?     *"HG#_3-\$,$Y=3G4P*@ $P'P  V8,*7P    %@J)P
XM_V#B+RT $"\M  PO$DZZ IPJ +"\_____T_O  QF#$ZZ D(I0(*B</]@NB %
XM8+9.5?_\2'@0 $*G3KH# "M __P(   ,4$]G$DJL@K9F"" M__Q.74YU3KH 
XM!G  8/1.50  2'@ !$AZ !Q.N@(8+P!.N@(X2'@  4ZZ  Y/[P 03EU.=5Y#
XM"@!.50  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" @(" @(" @(# P,# P(" @
XM(" @(" @(" @(" @(" @D$! 0$! 0$! 0$! 0$! 0 P,# P,# P,# Q 0$! 
XM0$! "0D)"0D) 0$! 0$! 0$! 0$! 0$! 0$! 0% 0$! 0$ *"@H*"@H" @("
XM @(" @(" @(" @(" @(" D! 0$ @                  $      0      
XM               ! 0    $                      0(    !        
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XH                 !0                #\@   ^L    !   #\@  
X 
Xend
SHAR_EOF
if test 6282 -ne "`wc -c 'getline.uue'`"
then
	echo shar: error transmitting "'getline.uue'" '(should have been 6282 characters)'
fi
#	End of shell archive
exit 0

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
uucp:...!pollux!papa       BIX:papa       ARPAnet:pollux!papa@oberon.usc.edu
 "There's Alpha, Beta, Gamma and Diga!" -- Leo Schwab [quoting Rick Unland]
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

UH2@PSUVM.BITNET (Lee Sailer) (05/07/88)

It occurs to me that there should be a standard for software installation,
following the usual arguments in favor of a standard user interface.

papa@pollux.usc.edu (Marco Papa) (05/08/88)

In article <41893UH2@PSUVM> UH2@PSUVM.BITNET (Lee Sailer) writes:
|It occurs to me that there should be a standard for software installation,
|following the usual arguments in favor of a standard user interface.

That's definitely a good point, and one of the reasons of my posting was to
have others comment on it.  So far the only thing that I have seen is one
article in AmigaMail (by Mike Colligon?) that indicated how to move A-Talk Plus
and DPaint to a hard disk, and promoted the use of XICON for building "install"
programs.  When I tried to implement such a scheme, I quickly found out that
with current tools I could NOT be able to build a "fully interactive" install
program.  With GETLINE now I can.  Any comments would be appreciated.
(and of course used in my owm products :-)

-- Marco Papa 'Doc'
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
uucp:...!pollux!papa       BIX:papa       ARPAnet:pollux!papa@oberon.usc.edu
 "There's Alpha, Beta, Gamma and Diga!" -- Leo Schwab [quoting Rick Unland]
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

david@ms.uky.edu (David Herron -- One of the vertebrae) (05/09/88)

YES!  It's a whole lot more convenient to have a simple standard way
for installing software.  (I'm speaking as a long time SA on Unix machines,
I'm very familiar with installing software by hand).

One of the nicer things on Unix PC's is the software installation.  An
"installable floppy" is a floppy(ies) that have a cpio archive on it/them,
with a few standard files in the cpio archive.  (Size, Install, and
Uninstall are the most important, there are others.)  Size is a simple
indication of how much space is required for the installation.  Install
is the script used to install all the files wherever they need to go,
Uninstall is stored away and used later when you want to remove the
software.

I've got a real long description of it available if anybody wants to
see it (or if you have access to The STORE!, it's INSTALL.DOC).

The point that I want to make is to think a little about the kinds
of things you want to do in relation to installing/removing software.
It's *real*convenient* to be able to do something like click on an
icon to do either of the tasks.  (installing/removing/installing updates).
Having such a standard would go a long way towards being able to
sell the machines to the less sophisticated.


-- 
<---- David Herron -- The E-Mail guy            <david@ms.uky.edu>
<---- or:                {rutgers,uunet,cbosgd}!ukma!david, david@UKMA.BITNET                                  
<---- Windowing... The Amiga has windowing. The Mac has windowing (echoes of
<---- Jonathan Livingston Seagull: "Just flying? A mosquito can do that much!").

pete@violet.berkeley.edu (Pete Goodeve) (05/13/88)

[Marco Papa writes (in <8922@oberon.USC.EDU>) about his program "getline"
to be used with XICON...]

Yeah!!  Many thanks, Marco!  I've been meaning to to write a "stupid little
program" like that since I first wrote xicon, but somehow I never got to
it.  As usual, the first person who REALLY needs it is the one who has
to write it...

Anyhow, it nicely fills the "Interaction Void" in that area.
BTW, for my own scripts at least, I find that the sort of place where pipes
can be very useful (rather than writing the input line to RAM:).  Of course
you DO have to have pipes installed first!  Which makes the idea not so
good for the installation scripts you were talking about.  (But when 1.3 is
released, EVERYONE will use pipes, won't they? (:-))

Marco also mentions the "various versions" of Xicon.  I think I can finally
clarify that a bit, after I wrote to Gail Wellington at C-A about it, and
got a friendly letter back.  Apparently both I and someone at C-A (unnamed)
had the same idea, and picked the same (perhaps obvious) name for it, quite
independently, so the program that is to be released on 1.3 is NOT mine.
(I'm not sure why they never released it before, though...)  To avoid
confusion, C-A has graciously decided to change the name of theirs to
"IconX".  As mine is more comprehensive, you may find it more use in the
sort of turnkey applications it was designed for.  It IS bigger though!

                                            -- Pete --

papa@pollux.usc.edu (Marco Papa) (05/13/88)

In article <9927@agate.BERKELEY.EDU> pete@violet.berkeley.edu.UUCP (Pete Goodeve) writes:
>[Marco Papa writes (in <8922@oberon.USC.EDU>) about his program "getline"
>to be used with XICON...]
>Yeah!!  Many thanks, Marco!  I've been meaning to to write a "stupid little
>program" like that since I first wrote xicon, but somehow I never got to
>it.  As usual, the first person who REALLY needs it is the one who has
>to write it...

You are welcome!  By the way, another problem that cropped up, and that
I have to deal with, is that people will have either 1 or 2 disk drives,
and that makes a difference if the installation program is on a different
disk from the programs to install, as it is the case for A-Talk III.
If you've looked at the scripts, the startups EXPLICITLY mentions the entire
path <disk>:<dir>/<file>.  But on a single drive system that can be a LOT
of disk swaps.  One solution is to copy your required "install" files and
DOS commands to RAM:, CD to it and then do everything with the second disk
with the programs to install.

>Anyhow, it nicely fills the "Interaction Void" in that area.

Feel free to use it any way you like.  It did fill my "void".

>BTW, for my own scripts at least, I find that the sort of place where pipes
>can be very useful (rather than writing the input line to RAM:).  Of course
>you DO have to have pipes installed first!  Which makes the idea not so
>good for the installation scripts you were talking about.  (But when 1.3 is
>released, EVERYONE will use pipes, won't they? (:-))

I thought about that, but had to find a place that IN EVERY case would be
available to store the temporary files.  T: is not good since it might not
be there.  PIPE: would be good in 1.3, except that it MUST be mounted to be
usable, and I cannot assume that. It turns out that RAM: is always available
and if it isn't, it will be MADE.

>Marco also mentions the "various versions" of Xicon.  I think I can finally
>clarify that a bit, after I wrote to Gail Wellington at C-A about it, and
>got a friendly letter back.  Apparently both I and someone at C-A (unnamed)
>had the same idea, and picked the same (perhaps obvious) name for it, quite
>independently, so the program that is to be released on 1.3 is NOT mine.
>(I'm not sure why they never released it before, though...)

It was released in the installation disk for the A2090 hard disk controller.

-- Marco Papa 'Doc'
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
uucp:...!pollux!papa       BIX:papa       ARPAnet:pollux!papa@oberon.usc.edu
 "There's Alpha, Beta, Gamma and Diga!" -- Leo Schwab [quoting Rick Unland]
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

erd@tut.cis.ohio-state.edu (Ethan R. Dicks) (05/14/88)

In article <9066@oberon.USC.EDU> papa@pollux.usc.edu (Marco Papa) writes:
>In article <9927@agate.BERKELEY.EDU> pete@violet.berkeley.edu.UUCP (Pete Goodeve) writes:

[ text about getline and explicit paths removed ]

>>BTW, for my own scripts at least, I find that the sort of place where pipes
>>can be very useful (rather than writing the input line to RAM:).  Of course
>>you DO have to have pipes installed first!  Which makes the idea not so
>>good for the installation scripts you were talking about.  (But when 1.3 is
>>released, EVERYONE will use pipes, won't they? (:-))
>
>I thought about that, but had to find a place that IN EVERY case would be
>available to store the temporary files.  T: is not good since it might not
>be there.  PIPE: would be good in 1.3, except that it MUST be mounted to be
>usable, and I cannot assume that. It turns out that RAM: is always available
>and if it isn't, it will be MADE.
>

RAM: is _almost_ always available; at least all Amigas come equipped to sue
and create RAM:.  I disovered meny moons ago, when I first began customizing
my workbench disks that the files in L: _were_ important.  My point is that
while RAM: will be created if it can be, due to the actions of the user, may
not be.  How hard is it to get an AmigaDOS redistribution license ($$$)?  If
you can provide bootable disks to do installation, the solution becomes
easier: mount PIPE:, use XIcon (or IconX ;-)  Just use the bootable disk to
configure the users WorkBench disk/Application disk, or better yet... use 
the bootable disk to format a blank disk and force the user to make a working
copy, which is appropriately customized.

-ethan


-- 
Ethan R. Dicks      | ######  This signifies that the poster is a member in
                    |   ##    good sitting of Inertia House: Bodies at rest.
This space for rent |   ##
                    | ######  "You get it, you're closer."

papa@pollux.usc.edu (Marco Papa) (05/15/88)

In article <13328@tut.cis.ohio-state.edu| erd@tut.cis.ohio-state.edu (Ethan R. Dicks) writes:
|In article <9066@oberon.USC.EDU| papa@pollux.usc.edu (Marco Papa) writes:
||In article <9927@agate.BERKELEY.EDU| pete@violet.berkeley.edu.UUCP (Pete Goodeve) writes:
|||BTW, for my own scripts at least, I find that the sort of place where pipes
|||can be very useful (rather than writing the input line to RAM:).  Of course
|||you DO have to have pipes installed first!  Which makes the idea not so
||
||I thought about that, but had to find a place that IN EVERY case would be
||available to store the temporary files.  T: is not good since it might not
||be there.  PIPE: would be good in 1.3, except that it MUST be mounted to be
||usable, and I cannot assume that. It turns out that RAM: is always available
||and if it isn't, it will be MADE.
||
|RAM: is _almost_ always available; at least all Amigas come equipped to sue
|and create RAM:.  I disovered meny moons ago, when I first began customizing
|my workbench disks that the files in L: _were_ important.  My point is that
|while RAM: will be created if it can be, due to the actions of the user, may
|not be.
 ^^^
My script will ASSUME that it is installed on an Amiga with at least 512K,
and booted with Workbench.  I would say that will cover 99% of the current 
Amigas (Who has an A1000 with 256K?).  In that case RAM: will be "made" and
will have sufficient space for my executanles and the temp files.  If they guy
multitasks and runs out of RAM: space during installation, he will get an error
and will have to do it again.  It happened to me when installing the A2090
software with an A2000 with 512K (I had disconnected my ASDB 8MI).

|How hard is it to get an AmigaDOS redistribution license ($$$)?  If
|you can provide bootable disks to do installation, the solution becomes
|easier: mount PIPE:, use XIcon (or IconX ;-)  Just use the bootable disk to
|configure the users WorkBench disk/Application disk, or better yet... use 
|the bootable disk to format a blank disk and force the user to make a working
|copy, which is appropriately customized.

The distribution license is not the point.  PIPE: requires the PIPE: entry to
be on the Mountlist, otherwise mount PIPE: will fail.  I cannot assume that
the user will have it, and changing a MountList MUST be done with an EDITOR.
That's TOO MUCH WORK for the "average" user. The point is that the installation
MUST be run from workbench, with click and answering questions ONLY.
Otherwise it is TOO COMPLEX.  Second point, as of today few people have
PIPE: and that may be for some more considering that 1.3 is not out yet.
I guess I have to manage with what I have TODAY.

-- Marco Papa 'Doc'
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
uucp:...!pollux!papa       BIX:papa       ARPAnet:pollux!papa@oberon.usc.edu
 "There's Alpha, Beta, Gamma and Diga!" -- Leo Schwab [quoting Rick Unland]
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

langz@athena.mit.edu (Lang Zerner) (05/15/88)

In article <9084@oberon.USC.EDU> papa@pollux.usc.edu (Marco Papa) writes:
>The distribution license is not the point.  PIPE: requires the PIPE: entry to
>be on the Mountlist, otherwise mount PIPE: will fail.  I cannot assume that
>the user will have it, and changing a MountList MUST be done with an EDITOR.

Why not have the mounlist entry on your installation disk and do something like
this in the INSTALL script:

	join devs:mountlist mymountentry as newmountlist
	rename newmountlist devs:mountlist
























Be seeing you...
 Lang Zerner      langz@athena.mit.edu     ihnp4!mit-eddie!athena.mit.edu!langz
"Many a good hanging prevents a bad marriage..." 
      -- Bill Shakespeare, Twelfth Night, I.v.19

discat@watdcsu.waterloo.edu (G. Strachan Elec. Eng.) (05/15/88)

In article <9927@agate.BERKELEY.EDU> pete@violet.berkeley.edu.UUCP (Pete Goodeve) writes:
>
>
>[Marco Papa writes (in <8922@oberon.USC.EDU>) about his program "getline"
>to be used with XICON...]
>
>Yeah!!  Many thanks, Marco!  I've been meaning to to write a "stupid little
>program" like that since I first wrote xicon, but somehow I never got to
>it.  As usual, the first person who REALLY needs it is the one who has
>to write it...
>
>Anyhow, it nicely fills the "Interaction Void" in that area.

I have never posted to the net before so I hope I am doing everything
correct...

A while back I discovered that you can in fact create interactive scripts
from the CLI without the need for little programs to print the message and
read in the input etc.  I figured that it was fairly obvious and everyone
else knew it too.  Now I am not so sure because people still seem to use
these input programs.  If this is obvious I apologize.  Anyway here is how
it works.  Ever wondered why Amigados scripts require you to specify the 
number and name of arguments the script needs?  It needs this so the 
Execute program can tell the user what the required parameters are if he
asks with the '?' command.  Now once the Execute has printed out the required
parameters it reads from standard input to get the parameters.  So this can
be used to build an interactive script.  For example here is my startup
sequence script.

path sys:system add
path sys:utilities add
path sys:my_commands add
BindDrivers
mount pipe:
Execute sys:s/loader ?

where the script file loader is:

.key "Load WorkBench (y/n)"
if <Load WorkBench (y/n)$y> eq "y"
LoadWb
endcli >nil:
else
echo "Workbench not loaded"
shell s:.login
endif

When the Amiga starts up it will print out the "Load Workbench (y/n)" prompt
on the screen.  If I type in y it will load the workbench any other responce
and it will not.  This method has the advantage over writing a simple program to
get the input in that it is faster (no program to load) and is much more
flexable.  The disadvantage is that only one input can be obtained per script.
If you need more than one responce from the user then you have to put it in
different scripts.

Hope this helps some people

Gordon Strachan

papa@pollux.usc.edu (Marco Papa) (05/15/88)

In article <5342@bloom-beacon.MIT.EDU| langz@athena.mit.edu (Lang Zerner) writes:
|In article <9084@oberon.USC.EDU| papa@pollux.usc.edu (Marco Papa) writes:
||The distribution license is not the point.  PIPE: requires the PIPE: entry to
||be on the Mountlist, otherwise mount PIPE: will fail.  I cannot assume that
||the user will have it, and changing a MountList MUST be done with an EDITOR.
|
|Why not have the mounlist entry on your installation disk and do something like
|this in the INSTALL script:
|
|	join devs:mountlist mymountentry as newmountlist
|	rename newmountlist devs:mountlist

That would ALMOST do it.  The entire sequence would go like this:

1. mount PIPE:
2. if 1. fails then
3.    copy pipe-handler to appropriate place
4.    if 3. fails forget it
5.    else join devs:mountlist with my PIPE mountlist entry
6.    (optionally rename as above)
7.    mount PIPE: [this hopefully will work]
8. endif

-- Marco Papa 'Doc'
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
uucp:...!pollux!papa       BIX:papa       ARPAnet:pollux!papa@oberon.usc.edu
 "There's Alpha, Beta, Gamma and Diga!" -- Leo Schwab [quoting Rick Unland]
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

schein@cbmvax.UUCP (Dan Schein CATS) (05/17/88)

In article <13328@tut.cis.ohio-state.edu> erd@tut.cis.ohio-state.edu (Ethan R. Dicks) writes:
>
>not be.  How hard is it to get an AmigaDOS redistribution license ($$$)?  If
	  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  A Workbench license is not hard to get, heck we don't even have a test :-)

>you can provide bootable disks to do installation, the solution becomes
>easier: mount PIPE:, use XIcon (or IconX ;-)  Just use the bootable disk to
					       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>configure the users WorkBench disk/Application disk, or better yet... use 
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>the bootable disk to format a blank disk and force the user to make a working
>copy, which is appropriately customized.
>
  One flaw here is that the user might not be working from floppy but rather
  hard drive. So if joe user wants to use your bootable install disk to 
  install to his/her hard drive, (im refering to installing an application)
  they have to first copy the expansion drawer, and in some cases - also copy
  or edit the mountlist, and maybe (just maybe) edit the startup-sequence. At
  this point your method is not as easy as before.
>-- 
>Ethan R. Dicks      | ######  This signifies that the poster is a member in

-- 
 Dan "Sneakers" Schein   uucp: {ihnp4|allegra|burdvax|rutgers}!cbmvax!schein
 Commodore AMIGA			ARPANET:  cbmvax!schein@uunet.uu.net
 1200 Wilson Drive			Bix: dschein	     Plink: Dan*CATS
 West Chester PA 19380			phone: (215) 431-9100	   ext. 9542
+----------------------------------------------------------------------------+
    Call BERKS AMIGA BBS - 24 Hrs - 3/12/2400 Baud - 40Meg - 215/678-7691
+----------------------------------------------------------------------------+
        I help Commodore by supporting the AMIGA. Commodore supports
         me by allowing me to form my own suggestions and comments.

doug-merritt@cup.portal.com (05/17/88)

Marco Papa writes:
>The distribution license is not the point.  PIPE: requires the PIPE: entry to
>be on the Mountlist, otherwise mount PIPE: will fail.  I cannot assume that
>the user will have it, and changing a MountList MUST be done with an EDITOR.
>That's TOO MUCH WORK for the "average" user. The point is that the installation
>MUST be run from workbench, with click and answering questions ONLY.

Actually, you can automate this. Write a program that does a quick scan
of Mountlist for "pipe", and if not found, append the appropriate entry
to it, and copy pipe.device to the appropriate disk (all with user prompts
to ask if it's ok to do this, of course).

	Doug Merritt

papa@pollux.usc.edu (Marco Papa) (05/18/88)

In article <4697@watdcsu.waterloo.edu| discat@watdcsu.waterloo.edu (G. Strachan Elec. Eng.) writes:
|In article <9927@agate.BERKELEY.EDU| pete@violet.berkeley.edu.UUCP (Pete Goodeve) writes:
||[Marco Papa writes (in <8922@oberon.USC.EDU|) about his program "getline"
||to be used with XICON...]
||Yeah!!  Many thanks, Marco!  I've been meaning to to write a "stupid little
||program" like that since I first wrote xicon, but somehow I never got to
||it.  As usual, the first person who REALLY needs it is the one who has
||to write it...
||Anyhow, it nicely fills the "Interaction Void" in that area.
|
|A while back I discovered that you can in fact create interactive scripts
|from the CLI without the need for little programs to print the message and
|read in the input etc.  I figured that it was fairly obvious and everyone
|else knew it too.  Now I am not so sure because people still seem to use
|these input programs.  If this is obvious I apologize.  Anyway here is how
|it works.  Ever wondered why Amigados scripts require you to specify the 
|number and name of arguments the script needs?  It needs this so the 
|Execute program can tell the user what the required parameters are if he
|asks with the '?' command.  Now once the Execute has printed out the required
|parameters it reads from standard input to get the parameters.  So this can
|be used to build an interactive script.  For example here is my startup
|sequence script.
|
|path sys:system add
|path sys:utilities add
|path sys:my_commands add
|BindDrivers
|mount pipe:
|Execute sys:s/loader ?
|
|where the script file loader is:
|
|.key "Load WorkBench (y/n)"
|if <Load WorkBench (y/n)$y| eq "y"
|LoadWb
|endcli |nil:
|else
|echo "Workbench not loaded"
|shell s:.login
|endif
|
|When the Amiga starts up it will print out the "Load Workbench (y/n)" prompt
|on the screen.  If I type in y it will load the workbench any other responce
|and it will not.  This method has the advantage over writing a simple program to
|get the input in that it is faster (no program to load) and is much more
|flexable.  The disadvantage is that only one input can be obtained per script.
|If you need more than one responce from the user then you have to put it in
|different scripts.

Nice try. Unfortunately it does NOT work with XICON (both versions from 
CBM or Pete), but only when executed by the CLI or through an Execute command.

In fact an article on "Execute file ?" was included in the last issue of 
Amazing Computing.  I don't know if it is a bug or feature of Execute or
AmigaDOS or what else but if you do an Execute name ? in the main XICON
script it will ask the question but it will NOT wait for the answer, and
in all my cases will go into an infinite loop on the next script instruction.

I had this bug report in my queue for sometime, but never got to send it
out.  Andy, consider this an official bug report.  Let me know if you need
any more details.

-- Marco Papa 'Doc'
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
uucp:...!pollux!papa       BIX:papa       ARPAnet:pollux!papa@oberon.usc.edu
 "There's Alpha, Beta, Gamma and Diga!" -- Leo Schwab [quoting Rick Unland]
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

mb@munnari.oz (Michael Bednarek) (05/18/88)

In article <4697@watdcsu.waterloo.edu> discat@watdcsu.waterloo.edu (G. Strachan Elec. Eng.) writes:
>In article <9927@agate.BERKELEY.EDU> pete@violet.berkeley.edu.UUCP (Pete Goodeve) writes:
>>[Marco Papa writes (in <8922@oberon.USC.EDU>) about his program "getline"
>>to be used with XICON...]
>>
>>Anyhow, it nicely fills the "Interaction Void" in that area.
>
> [description of EXECUTE using arguments and `.key']

Another crude way of input handling is the SKIP command:
[from my `Startup-Sequence')
echo "Environment: CLI, WB or shell?"
skip ?
lab CLI
Date ?
execute Make_RAM
quit
lab WB
loadwb
endcli >NIL:
quit
lab shell
c:/moreC/shell s:login.sh
quit

SKIP ? will cause a prompt "LABEL: " and jump.
Problem: If the usere enters something else.
--
Michael Bednarek, Institute of Applied Economic and Social Research (IAESR)
   //  Melbourne University,Parkville 3052, AUSTRALIA, Phone:+61 3 344 5744
 \X/   Domain:u3369429@{murdu.oz.au | ucsvc.dn.mu.oz.au} | mb@munnari.oz.au
       "bang":...UUNET!munnari!murdu!u3369429     PSI%23343000301::U3369429
"POST NO BILLS."

andy@cbmvax.UUCP (Andy Finkel) (05/20/88)

In article <2123@munnari.oz> mb@munnari.oz (Michael Bednarek) writes:
>SKIP ? will cause a prompt "LABEL: " and jump.
>Problem: If the usere enters something else.

1.3 has an ENDSKIP command for just this purpose...stops
the skip dead in its tracks, so lets you continue within
the script.
-- 
andy finkel		{ihnp4|seismo|allegra}!cbmvax!andy 
Commodore-Amiga, Inc.

"C combines the power of assembly language with the flexibility of
 assembly language."
		
Any expressed opinions are mine; but feel free to share.
I disclaim all responsibilities, all shapes, all sizes, all colors.