I have developed a windows application to read gamepad using SharpDx (XInput) and C# (VS 2008). The application is running smoothly in my development environment. But when i move to some other machine (Windows 7), its giving me error "Unable to load dll 'xinput1_3.dll' ". My question is is it mandatory to have directx runtime environment in clint machine also to run the exe ? Because i was thinking it will make use of dll "XInput9_1_0.dll" which is a part of windows 7.
|
Yes. SharpDX is simply a wrapper over the DirectX DLLs. The SharpDX files do not include the DirectX DLLs, and therefore you must redistribute them with your application if you want it to run on other computers. Note that some DLLs are included in some versions of Windows, but apart from the very basic files, like d3d9.dll, you should not suppose that any DirectX DLLs are going to be available in the target computer. This is especially true for the newer DirectX components, such as XInput, XACT or XAudio2. That said, simply copying the DLLs with your application won't work in most cases (the d3dx9 files being an important exception). DirectX components are based on COM, and therefore must be registered. Microsoft recommends you use the redistributable package installer to install the DirectX components required by your application. If you use this approach (which I recommend as well), you don't have to distribute every DirectX file. You just need to include:
as well as the specific DLLs required by your application. These files can be found in If you do this, you can then call This can all be automatically performed by a Visual Studio Setup project. You just have to include these files, and have To test your setup, I recommend you setup a virtual machine (I prefer VirtualBox), save the disk image as soon as the base OS is installed, and try your installer. If you have a problem, you can revert to the freshly installed disk image, and try again with a new installer. Note that since you're writing your program in C#, you also need the .NET framework to be installed in the target machine for your program to run. More information on how to do this can be found here. |
|||||
|
This really depends on which DirectX SDK was used to build the binaries. If someone uses for example the SDK released in month X of year Y, you'll most likely also need the DirectX version that has been up to date at that time. Unfortunately Microsoft ditched most versioning stuff starting with DirectX 9.0c. There are tons and tons of hidden subversions, all being backwards compatible, but adding additional support libraries. In a similar way there are different "sub versions" of DirectX 10 and 11 as well. Easiest way to ensure your programs works, would be either bundling (or providing a download URL) to Microsoft's DirectX Runtime Web Installer. It's essentially a downloader that will always install the correct and latest runtime files for the system it's run on. |
|||||||||||||||||||||
|
The target machine is missing the .dll files, either you install the redistributable or just copy the needed .dll files to the executable folder. The first option is the one that most professional in my opinion. |
|||||
|