'From Squeak3.6 of ''6 October 2003'' [latest update: #5424] on 26 February 2004 at 9:56:22 am'! "Change Set: SM2Install Date: 12 February 2004 Author: Gšran Krampe This changeset installs SM2 into the image if it has not been installed already, by contacting the SM2 server at map1.squeakfoundation.org and asking it for the URLs to the packages to download and install. It first installs VersionNumber and MCInstaller if needed." | repDir server stream installedMC installedVN map | (Smalltalk hasClassNamed: #SMPackage) ifFalse: [ installedVN _ false. "Install first versions of VersionNumber for SM2 if it is missing, we can't rely on using old SM because it is now removed." (Smalltalk hasClassNamed: #VersionNumber) ifFalse: [ ChangeSorter newChangesFromStream: ((('http://map1.squeakfoundation.org/sm/package/35e02e3a-48e2-4843-94ee-e86d651aeafe/autoversion/1/downloadurl') asUrl retrieveContents content) asUrl retrieveContents content unzipped readStream) named: (ChangeSet uniqueNameLike: 'VersionNumber'). installedVN _ true]. "Load the new SM base, using available Monticello or MCInstaller, and installing MCInstaller otherwise" stream _ HTTPClient httpGet: ('http://map1.squeakfoundation.org/sm/package/c4c13ea3-e376-42c7-8d9e-dc23b09f9f29/autoversion/6/downloadurl' asUrl retrieveContents content). installedMC _ false. (Smalltalk hasClassNamed: #MCMczReader) ifTrue: [(MCMczReader versionFromStream: stream) load "Using Monticello"] ifFalse: [ "No Monticello installed, will use MCInstaller and install it first if needed" (Smalltalk hasClassNamed: #MczInstaller) ifFalse: [ ChangeSorter newChangesFromStream: ((('http://map1.squeakfoundation.org/sm/package/af9d090d-2896-4a4e-82d0-c61cf2fdf40e/autoversion/2/downloadurl') asUrl retrieveContents content) asUrl retrieveContents content unzipped readStream) named: (ChangeSet uniqueNameLike: 'MCInstaller'). installedMC _ true]. MczInstaller installStream: stream]. "This clears the default map, but keeps info on installed packages if there where any" (Smalltalk hasClassNamed: #SMPackage) ifTrue: [ map _ (Smalltalk at: #SMSqueakMap) default. map installedPackagesDictionary: (Smalltalk at: #SM1InstalledPackagesDictionary ifAbsent: [nil]). Smalltalk removeKey: #SM1InstalledPackagesDictionary ifAbsent: [nil]. "Remove old SM Package Loader, if present" map clearInstalledPackageWithId: '047a3b12-7e52-4c5d-be8b-d06635fc4f1c'. "Remove old SqueakMap Base, if present" map clearInstalledPackageWithId: 'fffa45d3-2459-4b7d-b594-9cfae17c864d'. "Remove old SqueakMap loadscript, if present" map clearInstalledPackageWithId: '4f0b9db6-8add-43aa-8d6b-53e6a0ea8442'. "Add that we now have versions of SqueakMap2 base, VersionNumber and MCInstaller installed" map noteInstalledPackageWithId: 'c4c13ea3-e376-42c7-8d9e-dc23b09f9f29' autoVersion: '6'. installedVN ifTrue: [map noteInstalledPackageWithId: '35e02e3a-48e2-4843-94ee-e86d651aeafe' autoVersion: '1']. installedMC ifTrue: [map noteInstalledPackageWithId: 'af9d090d-2896-4a4e-82d0-c61cf2fdf40e' autoVersion: '2']. "Make sure map is updated" map loadUpdates] ifFalse: [self error: 'Installation of "SqueakMap base" failed']. "Install new SMLoader using SM2 itself." map installPackageWithId: '941c0108-4039-4071-9863-a8d7d2b3d4a3' autoVersion: '2']!