# Updating Rewired

Recommended Updating Procedure

1. Back up your project.
2. Move the Rewired folder back to the Assets\ folder if you have moved it elsewhere.
3. Close and re-open the Unity Editor to ensure no files are locked or in use.
4. Install the Rewired update from the Unity Asset Store.
5. Close and re-open the Unity Editor.
6. Commit changes to source control (if you are using it).

Step 5 is necessary because Unity has problems updating serialized data when files have been changed while the Unity editor is running. Closing and re-opening the editor before doing any work will ensure any new serialized data is re-loaded from the new versions on disk instead of versions cached in memory.

IMPORTANT (for Unity 5.0 - 5.2.5 only)

For all versions of Unity 5.0 - 5.2.5, unity changed the way Unitypackages are extracted into the project. Because of these changes, it is extremely important that you always move the Rewired folder back to the root of your Assets folder in your project before updating Rewired with a new version. This applies to ALL assets in the Unity Asset Store and all Unitypackages downloaded and installed. This is not an issue with Rewired's design and it is not something that can be worked around.

Rewired itself will work if you move it into another folder in your project. However, before updating, you must always remember to move it back to the root of the project.

This change was reverted in Unity 5.3. Versions 5.3+ do not require this extra step when updating.

Details

In Unity 5.0 - 5.2.5, Unity changed the way the Unitypackage system works. In 4.x it used to find existing files that matched those being extracted by GUID and then replace those files even if they weren't in the same location as in the Unitypackage. Not anymore in U5. If you unpack a file that already exists in the project but it's not in the expected location, it will just unpack a copy into the root instead of replacing the one you moved and change all the GUIDs on these new files. You will be left with multiple copies of the scripts and DLLs which will interfere with each other and break script references on Monobehaviours. There is no way to work around this. Unitypackage is Unity's format and asset store developers cannot change the way it works.

Issues when Updating

If you experience issues when updating, you may find it easier just to delete the Rewired folder and reimport it. Rewired stores no data in its folder so you are safe to just delete it and reinstall it in any situation where problems occur. However, during this delete and reinstall process, be sure you DO NOT save your scene until after importing Rewired again and verifying the Rewired Input Manager works as expected.

For step-by-step instructions, see Troubleshooting - Doing a clean reinstall of Rewired

Possible Data Corruption in Imported Package Files

Due to a Unity bug in the Unitypackage importer, in certain cases Unity may corrupt serialized data in some of Rewired's necessary data files upon import. If after updating, Rewired suddenly stops working and you get exceptions thrown for no apparent reason, Please see Known Issues - Serialized data corruption after importing Rewired.

Documentation