mmahesh_k wrote:I am trying to set a value to the new global variable at the time of packaging the runtime image but it is not getting set in Smalltalk pool dictionary.
I have tried this by initiating the global variable in the method packagingRulesFor: which is a class method of the application where the global variable is used.packagingRulesFor: aPackagedImage Smalltalk at: #MyGlobalVariable put: #value.
The above approach doesn't work for me.
The approach you're using definitely won't work if you are using the XD packager. It's been too many years since I used the packager in a non-XD image for me to say.
While I have never used it, you can try using:
- Code: Select all
packagingRulesFor: aPackagedImage
aPackagedImage
initializeGlobalVariable: #MyGlobalVariable
to: #value
Another option is to define a class variable to hold the object you want in the packaged image. If you do that, then you can use
- Code: Select all
aPackagedImage
initializeClassVariable: 'MyGlobalVariable'
to: #value
inClassNamed: #MyGlobalHolderClass.
Doug Swartz