DirectX Install Directory - directx

So, I tried installing Microsoft DirectX 2010, when I was setting the directory of in the installer I put it to the wrong directory that I wanted it in. Now, every time I open the installer, it doesn't give me an option to change the directory, it just says continue and install. If anyone has a solution to this that would be really nice.
EDIT: Also forgot to note that when I installed it on my D: drive (its supposed to be on C: ) I get the error code S1023

The S1023 issue is detailed in this post. Because the setup just outright failed, and it's built on ancient pre-MSI technology, you need to clean out the old installation manually.
Delete the failed install directory
Using regedit to delete HKCU\Software\Microsoft\DirectX SDK, HKLM\Software\Microsoft\DirectX SDK. If you are on a x64 system (which I hope you are), also delete HKLM\SOFTWARE\WOW6432Node\Microsoft\DirectX SDK.
Edit your system environment variables and remove the entry for DXSDK_DIR.
The DirectX SDK is deprecated. If you are using VS 2012 or later -or- the Windows 8.0 SDK or later, and you are using DirectX 11 or DirectX 12, then you don't need it. See Microsoft Docs.
There are a few cases where it's still legitimate to use the legacy DirectX SDK as covered in The Zombie DirectX SDK, but for the most part you should avoid using it for new projects.
If you are trying to get an old game to work, try installing the latest DXSETUP/DXWSETUP but keep in mind that it doesn't actually install DirectX at all. See Not So Direct Setup
UPDATE: There are now really no reasons to use the legacy DirectX SDK at all. See Where is the DirectX SDK (2021 Edition)? for the overall status and details.
For legacy D3DX9/D3DX10/D3DX11, use the Microsoft.DXSDK.D3DX NuGet package per this blog post. No need for the legacy DirectX SDK or to use legacy DXSETUP for this solution.
For XAudio2 on Windows 7, use the Microsoft.XAudio2.Redist NuGet package per Microsoft Docs.

Related

VS2019+WDK10, missing Spectre-mitigated MSVC library for 16.11, why?

Some weird stuff here. I'm trying to build a KMDF sample driver with VS2019 16.11.5 and WDK 10.0.19041.685 (also called version 2004 Dec 2020 update).
First, I got compilation error saying that I need to download Spectre-mitigated MSVC library.
Well, I try it, but got a new problem. The VS2019(16.11.5) installer does not show MSVC Spectre-mitigated MSVC library version for exact 16.11. Looks like the latest one it provides is 16.10 (🙁).
Download the 16.10 one and resume trying, still compilation error.
I peek into my D:\VSIDE\VS2019\VC\Tools\MSVC folder, and see two versions of MSVC libs listed, 14.29.30133 and 14.29.30037 . The later is the one with spectre libs(so it's 600MB+ larger).
However, the KMDF build tool insists to find MSVC libs in the newer 14.29.30133 folder, so Spectre-mitigated libs still CANNOT be found.
I know I can manually copy the required files from 14.29.30037 to 14.29.30133 to make things go on. BUT is it the decent way to do so, or is it a Microsoft toolset bug?
I'd like to ask how other kernel driver developers solve this issue. Thank you.
Well, several days later, I find out two workarounds for this issue.
First, as Hans Passant stated, disable the Spectre lib in .vcxproj. This can be configured from UI.
Second, explicitly select a MSVC library version for current project. This can also be configured in project settings UI.
==== 2022.02.11 UPDATE ====
Finally got it,the Spectre-lib with version number 14.29.30133 is called "(Latest)", so it is listed above the oldest version, and this defeats the novice. Use this and problem solved.
Sure, it is stupid enough to mark it as merely "(Lastest)". He should have named it MSVC v142 - VS2019 C++ x64/x86 Spectre-mitigated libs (v14.29-16.11)(Latest)" .

Xamarin.Android.Support.V7.AppCompat vs Xamarin.Android.Support.Compat

Can someone please explain me the difference between Xamarin.Android.Support.V7.AppCompat and Xamarin.Android.Support.Compat?
I totally get why we have to use Xamarin.Android.Support.V7.AppCompat. This is basically to support old verison of Android OS.
I have this reference in my android project but after installing Xamarin.Essentials nuget package, I get the following error:
java.lang.IllegalArgumentException: already added : Landroid/support/annotation/AnimRes
Also after installing Xamarin.Essentials nuget package, my project references Xamarin.Android.Support.Compat library. I am not sure if both the libraries(V7Compat and Compat) needs to be there on my project or should I get rid of the V7Compat library.
Just not sure if I should remove V7AppCompat nuget package from my project?
The Xamarin.Android.AppCompat is just what it says. It is a library for App Compatibility for backward compatibility for previous versions of Android. AppCompat should add the functionality of the latest API to older APIs when needed. For instance, lollipop added the CardView class, which can be used in older Android APIs when AppCompat is used, with some minor differences (some of the Android L animations may not apply on older versions of Android for example).
And more specifically this version (v7) brings support for Action Bar support.
It is recommended to use AppCompat in most cases since more users will be able to run your app when you do (depending on your MinSdkVersion).
If you want to know what classes you can access in AppCompat, you can take a look at the features here:
https://developer.android.com/topic/libraries/support-library/features.html
Besides, after I installed Xamarin.Android.Support.V7.AppCompat,I could install Xamarin.Essentials nuget package normally.

Add DirectX-9 to inno-setup installer

I have an old software that uses DirectX 9. It's quite obsolete but there are still people using it.
Win10 does not come with DX9 preinstalled and I want to add it to my installer. So far I see that there's a large (100mb) DX package from Microsoft that contains all the versions and builds of DX9 and 10. (http://www.microsoft.com/downloads/en/details.aspx?FamilyID=2da43d38-db71-4c1b-bc6a-9b6652cd92a3&displaylang=en)
Among the many version, I see, for example, "Jun2010_d3dx9_43_x86.cab" that contains the .dll, .cat and .inf. I'd say that this is sufficient for what I need so I'd add this to my program's installer (inno-setup).
I am a bit outdated on DX and DLLs knowledge. Can someone give some pointers on how to proceed and if it's right installing only one of that dll?
Thanks!
DirectX 9.0c does in fact come with Windows 10. Starting with Windows XP Service Pack 2, the "DirectX End-user Runtime" never installs DirectX on any version of Windows. The only way to update "DirectX" is to install a Service Pack, a Windows Update, or move to a new version of Windows.
See Not So Direct Setup for the full story here.
Your old application, however, likely does rely on some optional side-by-side components like D3DX9, D3DX10, D3DX11, XAudio2_7, XInput1_3, D3DCompile #43, Managed DirectX 1.1, or other thing that is only deployed by the legacy DirectX End-User Runtime. In that case, you should download the latest DXSETUP package (the April 2011 refresh of the end-of-life DirectX SDK June 2010 release on MSDN).
You can then configure a minimal package that will deploy just the DLLs you actually use. For example, if you used the D3DX9 June 2010 DirectX SDK for a 32-bit application, but that's all you needed, you can get away with an install package of just:
dxsetup.exe
dsetup32.dll
dsetup.dll
dxupdate.cab
Jun2010_d3dx9_43_x86.cab
Of course, if your application is old enough to be using a previous version of D3DX9, then you need to figure that out and use the right .cab.
See Where is the DirectX SDK? as well.

Condition to Install DirectX End-User Runtime

I'm using InstallShield 2013 (Basic MSI Project) to create installation package for my product.
Product requires DirectX End-User-Runtime to be installed, so I created custom prerequisite for DirectX in my InstallShield solution.
I don't want install DirectX End-User-Runtime every time I install my product, so I want to add a condition for DirectX in Prerequisite Editor. My product is a 64-bit application and it requires some directX files in C:\Windows\System32 folder (At least I know that it won't work without D3DCompiler_43.dll and D3DX9_43.dll).
So, I'm adding conditions for my prerequisite:
Install DirectX End-User-Runtime if files
[WindowsFolder]system32\D3DCompiler_43.dll and
[WindowsFolder]system32\D3DX9_43.dll
are missed on target box.
I tested my installation package on two 64-bit Win7 boxes. DirectX Prerequisite condition works fine on the first box - it installs DirectX only if both D3DCompiler_43.dll and D3DX9_43.dll are missed in C:\Windows\System32. But problem appears when I install the same package on the second 64-bit box: for some reasons prerequisite condition doesn't work properly there - it tries to find D3DCompiler_43.dll and D3DX9_43.dll not in C:Windows\System32 but in C:Windows\SysWOW64 folder.
Can someone explain why it looks in SysWOW64 even if I hardcode path to C:\Windows\System32?
And one more question - probably someone knows a better way how to check if DirectX End-User-Runtime is installed on target box? I found similar topic here check registry for DirectX End-User Runtime, but I cannot understand how and where in Prerequisite Editor can I use LoadLibrary("d3dx9_43.dll") function...
In InstallShield 2013, there are 2 types of prerequisites:
- Setup Prerequisites install before the main install
- Feature Prerequisites install only if that feature is selected for
installation.
You can't call a DLL in a Setup Prerequisite, because a setup prerequisite runs before your MSI, and therefore before any of your custom actions.
If you create a Feature Prerequisite, you can set a custom action to call a DLL (such as d3dx9_43.dll that you mentioned). I am not familiar with this DLL, so I can't tell you what your custom action would look like. You can turn on or off this feature based on the result of your DLL call.

Using DirectX Effect11 with Visual Studio 2012

I recently updated to Visual Studio 2012 Ultimate. I was programming previously with DirectX 11 June 2010 SDK and want to continue to do so using Visual Studio 2012. However, I discovered that VS2012 comes with its own DirectX SDK (in Windows Kit 8.0) and I've been trying to migrate my code using the newer versions of d3d11. Everything went fine until I try to use effect files in my project (.fx files). I had to compile the Effects11 Sample in the DirectX SDK using VS2012 and link the lib file in my project. That went fine too. However, when I compile my project the function D3DX11CreateEffectFromMemory returns a E_NOINTERFACE error (no such interface is supported). Can anyone tell me why is that? Note that I'm using the d3d11.lib from the Windows Kit and the d3dx11.lib from the DirectX SDK. Perhaps I shouldn't mix them? However, everything else works fine when I mix them, except for the effect file creation.
Any help would be appreciated.
P.S. I don't know if this is helpful but just so you know, if I add an additional library directory in the project settings of "DirectXSDKInstallPath\lib\x86\" it works. Why is that? Does it mean I'm using the older version of the libraries? This will give a ton of warnings about redefined headers in winerror.h
D3DX Library has been deprecated for the newest version of DirectX 11 (Windows 8). See http://msdn.microsoft.com/en-us/library/windows/desktop/bb172965(v=vs.85).aspx
Effects are now handled a different way. You can program your own library to load effects or use DirectX Tool Kit (DirectXTK): http://directxtk.codeplex.com/
Microsoft has recommended this tool kit on their web site, see http://msdn.microsoft.com/en-us/library/windows/desktop/ee663275.aspx for more information.
Effect11 has moved to https://fx11.codeplex.com/, you need to compile it and link yourself.
DirectXTK does not provide the effect11 interface, but only simplified effects
This is probably caused by d3d library conflicts.
Make sure what d3d libraries you are using.Because there are 2 different d3d libraries.
One in DXSDK_DIR\Lib\x86 or \x64,and one in c:\program files(x86?)\Microsoft SDKs.
If you are using DXSDK, then pass $(DXSDK_DIR)Include $(DXSDK_DIR)Lib\x86 ahead of Microsoft SDKs' includes,libs directory in the Include directories and Library directories fields respectively.
In the previous version of Direct3D, the effects framework worked out of the box once you linked with the D3D10 library. In Direct3D 11, the effects framework has been moved to the D3DX library, and you have to include a separate header file (d3dx11Effect.h) and link with a separate library (D3DX11Effects.libfor release builds and D3DX11EffectsD.libfor debug builds).
Furthermore, in Direct3D 11, they give you the full source code for the effects library code (DirectX SDK\Samples\C++ \Effects11). Thus, you could modify the effects framework for your own needs. In this book, we will only be using the effects framework as is, without modification. In order to use the library, you need to first build the Effects11project in both release and debug mode to generate the D3DX11Effects.lib and D3DX11EffectsD.libfiles; you will only need to do this once unless the effects framework is updated (e.g., a new version of the DirectX SDK may update these files, so you may want to rebuild the .lib files to get the latest version). The d3dx11Effect.h header file can be found in DirectX SDK\Samples\C++\Effects11\Inc.
For our sample projects, we place the d3dx11Effect.h, D3DX11EffectsD.lib, and D3DX11Effects.libfiles in the Commondirectory that all of our projects share code from (see the “Introduction” for a description of the sample project organization).

Resources