10-30-2017, 02:45 PM
Here's what we do in our plugins to handle versions of Illustrator outside the supported range:
- In our Plugin wrapper class, keep a flag to indicate whether the startup() method successfully finished (default of false, of course).
- At the beginning of our startup() method, check if the major version of Illustrator is outside the range of versions supported by the plugin.
- If the above condition is false, continue starting up. If the above condition is true, show an error dialog stating "This version of $pluginName was designed for Illustrator $aiVersionList only. Please visit $productURL for additional information." and exit the startup() method.
- Additionally check if the major version of Illustrator does not match the version for which the binary was built.
- If the above condition is false, continue starting up. If the above condition is true, show an error dialog stating "This version of $pluginName was designed for a different version of Illustrator. Please reinstall using the original $pluginName installer." and exit the startup() method.
- Finally perform any needed startup tasks, because the versions all match up at this point. Set the successful startup flag to true.
- In the shutdown() method, check the successful startup flag, and if false perform no shutdown tasks.