Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
Installer
Last updated at 1:13 pm UTC on 28 September 2007
Installer provides a simple Domain Specific Language for installing packages from monticello, squeakmap, mantis, universes, and www pages.

One design decision is to be able to paste scripts a workspace and run and tested from there without any special editing.

Scripts using Installer In KernelImage

Using Kernel Load

Scripts using Installer


From Class Comment


also recommended: Launcher and Scripter.

Installer can also be used together with Launcher (from http://www.squeaksource/Installer ) as a squeak startup document with various commandline parameters which install packages and optionally save the image.

Scripter from http://www.squeaksource.com/Scripter can be used to tidy up extra windows that scripts open when preparing an image for publication.

==

Examples - Using SqueakMap


1) #squeakmap
squeakmap := Installer squeakmap.
squeakmap install: 'DynamicBindings'.
squeakmap open. "opens the squeak map loader gui"

2)
Installer squeakmap install: 'DynamicBindings'.

3) Alternatively using which uses http (similar usage api to squeakmap)
Very useful in images which do not have a working Squeakmap packageloader (3.7)

squeakmap := Installer websqueakmap.
squeakmap package: 'DynamicBindings'; install.

4) Abbreviated instanciation
squeakmap := Installer sm. "squeakmap"
squeakmap := Installer wsm. "web-squeakmap"

5) Finding Packages by Name
(Installer sm match: 'Labby') explore.

6) Obtaining List of Package Versions
(Installer sm package: 'Labby & Walker'; versions)  explore.  

7) Searching Packages
Installer sm search: 'seaside'.
Installer sm search: 'author:Smith'. 
"fields available for searching: author: name:, summary:,description:"

8) Specify specific version of a package for installation
Installer sm install: 'Labby(17)'.

Examples - Using #monticello (abbreviated form #mc)


Monticello repository options:

Installer monticello http: aUrl.
Installer monticello http: aUrl user: name password: secret.
Installer monticello ftp: host directory: dir user: name password: secret.
Installer monticello magma: host port: aport
Installer monticello goods: host port: aport.
Installer monticello directory: dir.

1)
squeaksource := Installer monticello http: 'http://www.squeaksource.com'.
seaside := squeaksource project: 'Seaside'.
seaside install: 'Comet-lr.8';
		install: 'Scriptaculous'.

2) Beign particular about which package versions/authors to load

squeaksource := Installer monticello http: 'http://www.squeaksource.com'		
squeaksource project: 'Seaside';
			  install: #('Comet-lr' 'Comet-pmm');  "either of these"
			  install: 'Scriptaculous-lr.148'. "specific version"

3) Supplying user/password.
squeaksource := Installer monticello http: 'http://www.squeaksource.com'.
squeaksource user: 'me'; password: 'asecret'.

4) Abbreviated instanciation for convenience.
squeaksource := Installer squeaksource.
or
squeaksource := Installer ss.

Examples - install straight from a url

1a)
(Installer url: 'http://minnow.cc.gatech.edu/squeak/uploads/5889/MakeTestsGreen39.cs') install.
1b)
Installer installUrl: 'http://minnow.cc.gatech.edu/squeak/uploads/5889/MakeTestsGreen39.cs'.

2) Install items from a web location
 | dir |
 dir := Installer url: 'http://minnow.cc.gatech.edu/squeak/uploads/5889/'.
 dir install: 'MakeTestsGreen39.cs'.

Embedded scripts

3)
Scripts embedded in html web pages are delimited by ...
 | page |
 page := Installer url: 'http://wiki.squeak.org/squeak/742'.
 page install.

4)
specify your own delimeters for an embedded script.
 | page |
 page := Installer url: 'http://wiki.squeak.org/742'.
 page markers: 'beginning of script...end of script'.
 page install.

Note: Scripts embedded in html or a swiki page may need to escape some entities.
Supported entities are & > < * " (see Installer-c-#entities)

Examples - Using Mantis


n.b. wherever a bug number is used below you
can use a string that begins with the bug number.
The remainder of the string is ignored, useful to annotate the purpose of the fix.

1 . Viewing a file uploaded to a mantis bug report

Installer mantis bug: 4874 view: 'Join.4.cs'.

2. Installing a file uploaded to a mantis bug report
Installer mantis bug: 4874 fix: 'Join.4.cs'.

3. as above, inform user if bug report has been updated since a given date
Installer mantix	bug: 4874 fix: 'JoinTest.1.cs' date: '12-18-06'. 

4. Install or view a fix for a given bug.

Installer mantis viewBug: 4874.
Installer mantis fixBug: 4874.

The fix script is published in a note added to the bug report page with the following syntax

 "fix begin"
  Installer mantis bug: 474 fix: 'Join.4.cs'.
 "fix test"
  Installer mantis bug: 474 fix: 'JoinTest.1.cs' date: '12-18-06'. 
 "fix end"

5. Install a fix for a given bug, ignoring all test code
(test code being delimeted by: "fix test" ... "fix end" )

 Installer mantis justFixBug: 474.
 or
 Installer mantis justFixBug: 474 date: '12-19-06'.

6. View the mantis report for a bug.

 Installer mantis bug: 474.

7. Open a ChangeList browser on the file attached to the bug.
Installer mantis bug: 474 cl: 'file.cs'.
7b Open a workspace on file contents.
Installer mantis bug: 474 retrieve: 'file.cs'.

8. Load bug fix if it has not already been loaded.
 Installer ensureFix: '474 Date and time improvements'.
 Installer ensureFixes: #(474 123).

Universes Support


Installer universe install: 'a pkg'; install: 'b pkg(1.1)'; install.

Additional features


A) Viewing files in monticello snapshot browser.

Where you can #install:/#install you can also #view:/#view.

(Installer ss project:'Installer') view: 'Installer-Core'.
(Installer url: 'http://installer.pbwiki.com/f/Installer.st') view.

Installer ss project: 'Installer'; view: 'Installer-Core'.
Installer ss project: 'Installer'; browse: 'Installer-Core'.

B) Debug

Installer debug "Open debugger on error"
Installer noDebug "Log errors"

C) Installer validationBlock: [ ]

If you have a long script which goes wrong, providing a validation block can be useful to track down the problem. If supplied it is executed after each installation. A debugger will be opened if the validation block returns false.

D) #rememberAs

Add your own favourite repositories.
Installer monticello http: 'http://gjallar.krampe.se'; rememberAs: #gjallar.

henceforth:
Installer gjallar install: 'Q2'.

E) Automate user interactions: #answer:with:

repo := Installer ss project: 'Seaside'.
repo answer: '*config*' with: 'seaside';
	answer: '*password*' with: 'admin';
	install: 'Seaside2.8a1'