Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
MCMcmUpdater updateFromServer
Last updated at 5:00 pm UTC on 14 January 2019
If you choose the Squeak menu 'Update Squeak' the following command is executed.

 MCMcmUpdater updateFromServer.

Note there is also
 MCMcmUpdater default doUpdateUpTo: versionNumber

Below is a walkthrough what happens during the update process.

The method #updateFromServer

 updateFromServer
	"Update the image by loading all pending updates from the server."
 ^self default doUpdate

The #default update object then is
 default
	"The default instance for system updates. Uses a default repository and update map
	name that may be set as preferences."

	^self updateMapNamed: self updateMapName repository: self defaultUpdateURL


The method #doUpdate
 doUpdate
	"Update the image by loading all pending updates from the server. If this is
	the default updater for the system, update the system version when complete.
	Flush all caches. If a previous download failed this is often helpful"

	^self doUpdate: true

And then

 doUpdate: interactive
	"Update the image by loading all pending updates from the server. If this is
	the default updater for the system, update the system version when complete.
	If interteractive use a modal notifier, otherwise only update the transcript.
	Flush all caches. If a previous download failed this is often helpful"

	| config previousUpdateLevel |
	previousUpdateLevel := SystemVersion current highestUpdate.
	MCFileBasedRepository flushAllCaches.
	config := self updateFromRepository.
	config ifNil: [
		interactive ifTrue: [ ^self inform: 'Unable to retrieve updates from remote repository.' translated ].
		Transcript cr; show: '==========  Unable to retrieve updates from remote repository. ==========' translated; cr.
		^ self ].
	MCMcmUpdater default == self
		ifTrue: [
			config setSystemVersion.
			interactive ifTrue: [ 
				self inform: ('Update completed.\\Version: {1}\Update: {3}{2}\\Url: {4}\Map: ''{5}''{6}' translated withCRs format: {
						SystemVersion current version.
						SystemVersion current highestUpdate.
						previousUpdateLevel = SystemVersion current highestUpdate
							ifTrue: ['']
							ifFalse: [previousUpdateLevel asString, ' -> '].
						self repository.
						MCMcmUpdater updateMapName.
						SystemVersion current description ifEmpty: [''] ifNotEmpty: [:d | String cr, String cr, d]})].
			Transcript cr;
				show: '==========  Update completed:  ' translated;
				show: previousUpdateLevel;
				show: ' -> ' ;
				show: SystemVersion current highestUpdate;
				show: ' =========='; cr ]
		ifFalse: [
			interactive
				ifTrue: [ self inform: 'Update completed.' ].
			Transcript cr; show: '==========  Update completed. ==========' translated; cr ]
	



To be continued....