I have MAC and Windows version of the plugin.
I just realised, that it should be the same Plugin Code (property in ProJucer) for both versions. Is this possible to change this code somehow without problems for users who have the previous version? If I change this code, old projects will be crashed. Is it any workaround?
The short answer is that it’ll be impossible to change the code without causing problems for some users.
What plugin format do you need to convert? Presumably it’s VST2 or VST3 on both platforms.
If you need compatibility between two VST2 plugins with different codes, this isn’t easily achievable.
For VST3, you could look at AudioProcessor::getVST3ClientExtensions() and VST3ClientExtensions::getCompatibleClasses(). The idea here is that a plugin can provide a list of ‘compatible’ plugin codes. The host can use this list to check whether a given plugin is capable of replacing another plugin.
This functionality is implemented using the IPluginCompatibility interface, which was only added to the VST3 format in v3.7.5, May 2022. As a result, only a small number of modern hosts support this feature. Users of older hosts, or hosts that don’t provide this optional functionality, will still run into problems.
I’m no expert in AAX details but among the properties there is AAX_eProperty_Deprecated_Native_Plugin_List (and other properties similarly named) which may be worth checking for the case of OP.
properties->AddPropertyWithIDArray and AAX_eProperty_Related_Native_Plugin_List
Heads up - with the latest version of Pro Tools the plugin cache is run out of process so getting the code must not use PluginHostType to detect if the current process isProTools() in getPluginIDForMainBusConfig().