FAQ : General Information : Q: How can I tell what Message Catalog Files are required to ship with my reduced runtime application?
Q: How can I tell what Message Catalog Files are required to ship with my reduced runtime application?
Problem
I have packaged my runtime application as a reduced runtime image, but I don’t know which message catalog files I need to deploy with the image.
Solution
The following script can be run to determine the .cat and .mpr message files that are needed by a reduced image at runtime. Because it reads the spusage.es file produced by packaging, you should run the script right after your packaging run so that you have the correct spusage.es file available.
The required runtime message files will be listed on the Transcript..
| spusageFile fileStream class classCollection appCollection catFiles
mprFiles work icxFileName |
 
classCollection := Set new.
appCollection := Set new.
catFiles := Set new.
mprFiles := Set new.
spusageFile := '..\image802\spusage.es' asFileSpec.
fileStream := spusageFile cfsStreamReadOnlyIfError:
[ :aCfsErr | ((ExAll newChild) description: 'Error opening ', spusageFile
printString, ' error: ', aCfsErr printString) signal].
(fileStream skipToAll: 'Output statistics for: ')
ifTrue: [icxFileName := (fileStream nextLine)].
(fileStream skipToAll: 'Class of Object') ifTrue: [
fileStream nextLine; nextLine.
[fileStream atEnd] whileFalse: [
class := fileStream upTo: Character space.
class isEmpty
ifTrue: [fileStream setToEnd]
ifFalse: [ class asClass isNil ifTrue: [ Transcript cr; show: 'No
class found for: ', class printString ].
classCollection add: (class asClass).
fileStream nextLine]]].
fileStream close.
classCollection do: [ :eachClass | | rootApp |
rootApp := eachClass controller rootApplication.
appCollection add: rootApp.
appCollection addAll: rootApp allPrerequisites ].
appCollection do: [ :eachApp | | poolNames mprName |
poolNames := eachApp definedPoolNames.
poolNames do: [ :eachPoolName | | pool catName |
(pool := (Smalltalk at: eachPoolName ifAbsent:[])) epIsPoolDictionary
ifTrue:[ (catName := (pool at: '!CATALOGNAME' ifAbsent: []) ) isNil
ifFalse: [ catFiles add: (catName,'.cat') ] ] ].
(mprName := eachApp abtNlsRawFilename) isEmpty
ifFalse: [ mprFiles add: (AbtNLSCoordinator
resolveLanguageMappingCharacter: mprName) ] ].
work := Transcript bringToFront.
work
cr; nextPutAll: '******* The required message files for ', icxFileName, '
*******';
cr;
cr; nextPutAll: 'Cat files:'.
catFiles isEmpty
ifTrue: [ work cr; tab; nextPutAll: 'No .cat files needed' ]
ifFalse: [ catFiles asSortedCollection do: [ :each | work cr; tab;
nextPutAll: each ] ].
work
cr;
cr; nextPutAll: 'Mpr files:'.
mprFiles isEmpty
ifTrue: [ work cr; tab; nextPutAll: 'No .mpr files needed' ]
ifFalse: [ mprFiles asSortedCollection do: [ :each | work cr; tab;
nextPutAll: each ] ]
Last modified date: 01/29/2015