# Deployment

## Dependencies

Windows Standalone

OPTIONAL: If using XInput or Direct Input, the DirectX End-user Runtimes (June 2010) from Microsoft may need to be installed. You should include this runtime in your game installer. This is not necessary if only using Raw Input or Unity input.

If XInput is enabled, Rewired can use any of these versions of XInput if they are installed on the system:

XInput_1_4.dll
XInput_1_3.dll
XInput_1_2.dll
XInput_1_1.dll
XInput_9_1_0.dll

Windows Vista, Windows 7, Windows 8, and Windows 10 all come with a version of XInput pre-installed.

SDL2

If you are using SDL2 as the input source (optional) on any platforms, you must include the appropriate SDL2 libraries in your build package, unless you know the target operating system already provides this library (eg: SteamOS). The library you include and the location in your package in which to place it depends on the target platform and architecture. Failure to include the SDL2 libraries will result in an error being logged and input falling back to Unity input as the source.

The latest libraries for Windows and OSX can be obtained at the SDL2 website.

Windows:

No special steps are required for Unity 5.x+.

Direct Input on Unity 4.x:
The free version of Unity 4.x does not support native plugins. A native plugin is required to use Direct Input (optional) as the primary input source on the Windows Standalone platform. If you want to use Direct Input, you will need to manually copy the DLL from Assets/Plugins/x86/Rewired_DirectInput.dll file into the root folder of your project (above the Assets folder). After you make a build, you will need to copy the appropriate Rewired_DirectInput.dll file for your chosen architecture (x86 or x64) into a folder called Plugins inside the build folder. This is a hack to get around the Unity 4.x native plugin limitation. Unity 5.x+ does not require this hack.

OSX: The SDL2 website does not include an SDL2 bundle, which is the format that Unity requires if you are to include a native OSX library in the Unity project's Plugins folder. You will either have to build the bundle manually, or use the bundle included with Rewired.

Linux: To include SDL in the game build, you must place the libSDL2-2.0.so.0 file in same location as the executable game file. Placing the library in the data folder in Plugins, Plugins/x86, Plugins/x86_64 or Mono or its sub-directories will not work. For 32-bit builds, you must copy the library in the Plugins/x86 folder and for 64-bit builds, copy the library in the Plugins/x86_64 folder.

Rewired includes pre-built SDL2 libraries for each platform, but they must be installed manually through the menu option:

- Window -> Rewired -> Setup -> Install Libraries -> SDL2

For Linux, after installing the libraries above, you can copy the libSDL2-2.0.so.0 file from the Assets/Plugins/x86 or Assets/Plugins/x86_64 folder. Unity will automatically copy the Windows and OSX libraries on build to the right locations.

NOTE: Unity 4.x free does not officially allow you to include native libraries while Unity 5+ does. There are workarounds available for Unity 4.x that involve placing the library in the root folder of your editor project and manually copying the library to your final game build. The exact procedure depends on your target platform. There are resources available by searching the Unity forums. Or contact support for more information.

Basic Usage Best Practices