Plugin.PrepareForUpdate
-----------------------

Prepares plugin for an update.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Plugin](component_Plugin.md) | [11.1](newinversion111.md) | ✅ Yes | ❌ No | ❌ No | ✅ Yes, on macOS | ❌ No |

### Deprecated

This function was [deprecated](deprecated.md).

MBS( "Plugin.PrepareForUpdate" ) ### Parameters

none

### Result

Returns OK or error.

### Description

Prepares plugin for an update.  
MBS Plugin prevents FileMaker from unloading itself to avoid crashes with Cocoa runtime system.  
e.g. one plugin loads, registers a class. Then it may get deactivated and unloads. Later a newer plugin in a different version loads, and tries to use the class registered before. Since the first plugin is unload, all pointers are invalid and the application crashes.  
This function disables this feature, so a newer plugin may load.  
### Release notes

- **Version 11.1**
    - Added [Plugin.PrepareForUpdate](https://www.mbsplugins.eu/PluginPrepareForUpdate.shtml) function.

### Example Databases

- [Utility functions/Install Plugin Update if needed](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Utility%20functions/Install%20Plugin%20Update%20if%20needed.shtml#1ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin 11.1](https://www.mbsplugins.de/archive/2021-03-16/MBS_FileMaker_Plugin_111/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 11.1pr5](https://www.mbsplugins.de/archive/2021-02-20/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function is free to use.

Created 16th February 2021 , last changed 27th March 2023

  
[Plugin.Path](PluginPath.md) - [Plugin.RegisterFunction](PluginRegisterFunction.md)

[HTML Version](PluginPrepareForUpdate.shtml)