Add DirectX-9 to inno-setup installer - directx

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.

Related

Create Windows 95, 98, 2000, XP NT, 7, 10

I come across the following link - https://github.com/felixrieseberg/windows95
Running windows 95 as Electron APP
Is it possible to create any existing application as portable or cross-platform using electron like above?
Can we use Windows 7 or 10 like above without Oracle Virtual Box or VM in an existing Windows 8 machine ?
Need more details on how it is possible to bring an application via electron
Thanks.
If I'm hearing you right, you're wondering if you can put a whole OS into a JS VM running in Electron - and then run your app on top of that.
Please don't do that. Electron is a fantastic cross-platform solution, but my project windows95 was mostly an educational experiment showcasing how powerful modern JavaScript and Electron can be.
This project uses another project called v86, which is capable of virtualising a x86 platform and display its output on a HTML element. Electron is browser-based so that is why this works.
But there are some limitations: It virtualises the x86 platform, which is pretty old by now, and when you have a look at the specification, it says it is at a Pentium-1 state. The demo links on the project's GitHub ReadMe also do not contain any "modern" OS because v86 does not support SSE(2). And since Microsoft requires its users to have a SSE2-compatible CPU* it is not possible to run anything like Windows 7 or newer (Linux may work, anyway).
OSses which support this kind of (deprecated) hardware, may work. As you can see from the "Compatibility" section of the project's ReadMe, some Linux versions and Windows XP "work" but older software, like OS/2, and even newer stuff, like Android, don't (really). So you can't say that everything will work as expected because the execution environment is really limited.
Now to answer your first point, no, I don't think that you can wrap every existing app into an Electron application and run it on new hardware. It may work with old software (which do not require SSE, if you use v86, and that would require a lot of hackery on the v86 side because it is designed to run OSses), but don't quote me on that.
* The section in question reads (at the time of writing) like this:
A Stop error occurs on computers that don't support Streaming Single Instructions Multiple Data (SIMD) Extensions 2 (SSE2).
Upgrade your machines with a processor that supports SSE2 or virtualize those machines.
(emphasis mine, source: https://support.microsoft.com/en-us/help/4088875/windows-7-update-kb4088875)

DirectX Install Directory

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.

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.

Target a commonly-available runtime version of Direct3D

I would like to add Direct3D as an optional graphics backend of a 2D game to get around DirectDraw's limitations (such as the horrid DirectDraw emulation in Windows 8).
Can I do this in such a way that the majority of users would not need to install anything? I noticed that Windows XP comes with some Direct3D files, can I target that version of the runtime?
According to John McCaskey, a software engineer on Steam:
Games which don't use the D3DX helpers (such as Source engine games) don't require running the annoying installer on first launch as they only depend on major d3d9/10/11 versions being installed. However, games that do use D3DX must run it as it's the only way Microsoft has allowed for distributing and checking the version info on the files.
Thus, using Direct3D 9 (d3d9.h) directly should be fine, assuming the user has some version of DirectX 9 installed.
Source: Why Steam Makes You Reinstall DirectX - Rock, Paper, Shotgun

Building cross-platform Delphi applications

I downloaded Lazarus, but have worked with Embarcadero Delphi IDE too. I have a question about building cross-platform Delphi applications.
How can I build them under win32 environment? I read the wiki from Lazarus site, that explains how to do it, but I still do not understand it. Is is possible to build and compile application under win32 environment for Linux and MacOS? If it is possible, can someone explain ste-by-step how to do it exactly.
EDIT:
Now is the time for talking about the new XE2 version of the Delphi IDE I think :)
Thanks
What you're asking for already exists in the lazarus wiki site, you need to read these articles.
Multiplatform Programming Guide
Cross compiling
Cross compiling for Win32 under Linux
How to Write Portable Code (nice doc from Marco van de Voort)
Buildfaq
While crosscompiling to a non windows target is possible (and not that hard), getting used to fpc/lazarus and crosscompiling in one first step is a bridge too far. This because Linux is not a very homogenous target and dealing with this variation requires some understanding how libraries and linking works on Linux. This defeats one-button downloadable cross-compile setups to "general" linux. I know, such one-button thingies that work out of the box for everyone would be great, but it is just not going to happen (or only forvery limited distribution-version combinations)
Crosscompiling with FPC is not extremely difficult or rocket science, but the amount of jargon and details can flabbergast uninitiated people, and without background knowledge it is hard to diagnose problems as a result of minor misconfigurations
I recommend to first familiarize yourself with Lazarus/FPC, and only then make the crosscompilation leap. (and the already mentioned buildfaq names some reasons).
Bottomline: install lazarus on Windows and start porting your app. If that succeeds, start using a linux install (or VM) to familiarize yourself with Linux, and Lazarus under it. You'll need a linux install anyway to test.
Only then start thinking about crosscompiling to speed up the process.
CodeTyphon is a powerful Lazarus/FPC one click easy installation package for cross platform native development. It already supports 4 CPU/OS hosts (Win32, Win64, Linux32, Linux64), and 16 CPU/OS targets (arm-Wince, arm-Linux, arm-Embedded, arm-gba, arm-nds, i386-Win32, i386-Linux, i386-FreeBSD, i386-Haiku, x86_64-Win64, x86_64-Linux, x86_64-FreeBSD, powerpc-Linux, powerpc64-Linux, sparc-Linux, sparc-Solaris). More are supported in Lazarus/FreePascal, but others are not yet integrated in CodeTyphon. Did I mention that it is free? One code to rule them all ;-)
The point is that you don't have to waste days for setting up your cross platform environment, since someone has already done the hard work for you.

Resources