Re: Applying changesets to selected images only
Posted by
Ricardo Moran on
Jun 24, 2013; 7:58pm
URL: https://forum.world.st/Applying-changesets-to-selected-images-only-tp4694588p4694903.html
Hi,
I've done something similar for Physical Etoys that lets us add new source code and/or new files to a published release. This has been very useful for us and the implementation is very simple, so maybe if there is enough interest we could adapt it and include it in Etoys.
I'm attaching an *.st file if you want to check it out. It consists on just two classes: PEInstaller and PEModule. PEInstaller takes care of the startup behavior and registering which PEModules have been installed already (so that we don't install something twice). PEModule includes the logic to install (and rollback if something fails) a given module. On each startup the behavior is the following:
- PEInstaller looks on the default directory for *.pem files that hasn't been installed before. These *.pem files are just renamed zip files.
- For each *.pem file found, PEInstaller creates a PEModule and installs it, which involves the following steps:
- Since the *.pem file is just a zip, the PEModule first extracts all its files on the default directory. This allows us to add arbitrary files, not just source code.
- Then it looks for source code files (*.st, *.cs, or *.mcz) on the extracted files, and it loads them in the image.
- After installing all modules found, PEInstaller registers them on the "installedModules" class inst var, and saves the image. If an error occured while installing a module, it will rollback all modules installed on this startup (so that we don't leave any file hanging there) and it quits the image.
Cheers,
Richo
_______________________________________________
etoys-dev mailing list
[hidden email]
http://lists.squeakland.org/mailman/listinfo/etoys-dev