'From Squeak3.7beta of ''1 April 2004'' [latest update: #5969] on 13 July 2004 at 2:51:41 am'! "Change Set: SMBaseSilent-gk Date: 13 July 2004 Author: Gšran Krampe Modifies SqueakMap2 base so that it can do silent installs using SMSqueakMap default silentlyDo: [yadda]"! !SMInstaller methodsFor: 'private' stamp: 'gk 7/13/2004 02:43'! silent "Can we ask questions?" ^packageRelease ifNotNil: [packageRelease map silent] ifNil: [false]! ! !SMSimpleInstaller methodsFor: 'services' stamp: 'gk 7/13/2004 02:41'! fileIntoChangeSetNamed: aString fromStream: stream "We let the user confirm filing into an existing ChangeSet or specify another ChangeSet name if the name derived from the filename already exists." | changeSet newName oldChanges global | newName := aString. changeSet := SMInstaller changeSetNamed: newName. changeSet ifNotNil: [ newName := self silent ifNil: [FillInTheBlank request: 'ChangeSet already present, just confirm to overwrite or enter a new name:' initialAnswer: newName] ifNotNil: [newName]. newName isEmpty ifTrue:[self error: 'Cancelled by user']. changeSet := SMInstaller changeSetNamed: newName]. changeSet ifNil:[changeSet := SMInstaller basicNewChangeSet: newName]. changeSet ifNil:[self error: 'User did not specify a valid ChangeSet name']. oldChanges := (SystemVersion current highestUpdate < 5302) ifFalse: [global := ChangeSet. ChangeSet current] ifTrue: [global := Smalltalk. Smalltalk changes]. [global newChanges: changeSet. stream fileInAnnouncing: 'Loading ', newName, ' into change set ''', newName, ''''. stream close] ensure: [global newChanges: oldChanges]! ! !SMMcInstaller methodsFor: 'private' stamp: 'gk 7/13/2004 02:44'! installMcz "Install the package, we already know that either MCInstaller or Monticello is available." | installer monticello | installer := MczInstaller. (Smalltalk hasClassNamed: #MCMczReader) ifFalse: [ packageRelease package isInstalled ifTrue: [ (self silent ifFalse: [ (self confirm: 'A release of package ''', packageRelease package name, ''' is already installed. You only have MCInstaller and not Monticello installed and MCInstaller can not properly upgrade packages. Do you wish to install Monticello first and then proceed? If you answer no MCInstaller will be used - but at your own risk. Cancel cancels the installation.' orCancel: [self error: 'Installation cancelled.'])] ifTrue: [false]) ifTrue: [ monticello := packageRelease map packageWithName: 'Monticello'. monticello lastPublishedRelease ifNotNil: [monticello lastPublishedRelease install] ifNil: [monticello lastRelease install]. installer := (Smalltalk at: #MCMczReader)]] ] ifTrue: [installer := (Smalltalk at: #MCMczReader)]. installer loadVersionFile: self fullFileName! ! !SMSqueakMap methodsFor: 'public-installation' stamp: 'gk 7/13/2004 02:39'! silentlyDo: aBlock "Execute with the Silent flag set. This is a crude way of avoiding user interaction during batch operations, like loading updates." [silent _ true. aBlock value] ensure: [silent _ nil]! ! !SMSqueakMap methodsFor: 'accessing' stamp: 'gk 7/13/2004 02:51'! silent "Can installations ask questions or should they be silent and us good defaults?" ^ silent ifNil: [false] ifNotNil: [true]! ! !SMInstaller reorganize! ('services' download install upgrade) ('accessing' packageRelease:) ('private' silent) !