"Installation script for Application '$APPID' (generated by $TIMESTAMP) select 'file in' from a file browser menu to execute the contents of this file" | ctx path apm applicationSpecs primload applications | "find out the path of this file" ctx := thisContext. [ctx == nil or: [ctx receiver isKindOf: ExternalStream]] whileFalse: [ctx := ctx sender]. path := ctx receiver name asFilename head asFilename. apm := Object messageNotUnderstoodSignal handle: [:ex | ex return] do: [self applicationManagement]. "optional: define further files to file in before main installation" #() do: [:string | (path construct: string) asFilename fileIn]. "specifiers for applications which are required to run this application" "specifier = #( String(appl. name), Integer(appl. major version), nil | String(appl. path), String(appl.platf.name) )" applicationSpecs := $APPLICATIONSPECS. "define proper source and structure loader block, execute it for each element of the array" primload := apm == nil ifTrue: [[:apName :major :apPath :apDir | (((apPath asFilename construct: apDir) construct: 'v', major printString) construct: 's.st') fileIn]] ifFalse: [[:apName :major :apPath :apDir | | app | ((app := apm applicationNamed: apName) == nil or: [app majorVersion < major]) ifTrue: [apm load: apDir path: apPath version: 'v', major printString binary: true] ifFalse: [app]]]. applications := applicationSpecs collect: [:spec | (spec at: 3) == nil ifTrue: [spec at: 3 put: path]. primload valueWithArguments: spec]. applications size. #done