Bug 13265 – Please detect the DXSDK when configuring sc.ini in the installer

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
installer
Product
D
Version
D2
Platform
x86_64
OS
Windows
Creation time
2014-08-06T04:26:00Z
Last change time
2016-01-17T22:20:57Z
Assigned to
nobody
Creator
turkeyman

Comments

Comment #0 by turkeyman — 2014-08-06T04:26:12Z
The DirectX SDK is a super common Microsoft library that will be present for most multimedia projects. I particularly feel it needs to be detected by the installer to make the experience seamless between different versions of Visual Studio. From VS2012, the DXSDK was rolled into the Windows SDK, which is detected by the installer. Prior to VS2012, the DXSDK was installed as a separate package. The result is, if a user uses VS2012 or higher, their multimedia apps will compile as expected. If they happen to use VS2010 or lower (I still use 2010), then their apps will fail to compile without user intervention in sc.ini. I'd like to see all versions of Visual Studio working reliably the same way out of the box, otherwise project build/setup instructions need to start having conditions and sub-sets of instructions throughout their wiki pages, ie, "If you're using VS2010 or below, follow these steps", etc. The DXSDK is located here by default: Include: C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include Lib (x86): C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Lib\x86 Lib (x64): C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Lib\x64 The SDK installer also sets the DXSDK_DIR environment variable, so it's probably better to use: Include: %DXSDK_DIR%\Include Lib (x86): %DXSDK_DIR%\Lib\x86 Lib (x64): %DXSDK_DIR%\Lib\x64
Comment #1 by eco — 2014-08-06T04:40:06Z
> The SDK installer also sets the DXSDK_DIR environment variable, so it's probably better to use: > Include: %DXSDK_DIR%\Include > Lib (x86): %DXSDK_DIR%\Lib\x86 > Lib (x64): %DXSDK_DIR%\Lib\x64 If that's all that is needed we should just put them in the distributed sc.ini: https://github.com/D-Programming-Language/dmd/blob/master/ini/windows/bin/sc.ini Under [Environment32] (could be useful if Rainer's 32-bit COFF support happens): LIB=%LIB%;"%DXSDK_DIR%\Lib\x86" Under [Environment64]: LIB=%LIB%;"%DXSDK_DIR%\Lib\x64" I'm not familiar enough with DirectX these days to test this but if you could test that doing that works, either you or I could make a quick pull request to implement this.
Comment #2 by turkeyman — 2014-08-06T04:57:22Z
(In reply to Brad Anderson from comment #1) > > The SDK installer also sets the DXSDK_DIR environment variable, so it's probably better to use: > > Include: %DXSDK_DIR%\Include > > Lib (x86): %DXSDK_DIR%\Lib\x86 > > Lib (x64): %DXSDK_DIR%\Lib\x64 > > If that's all that is needed we should just put them in the distributed > sc.ini: > https://github.com/D-Programming-Language/dmd/blob/master/ini/windows/bin/sc. > ini > > > Under [Environment32] (could be useful if Rainer's 32-bit COFF support > happens): > LIB=%LIB%;"%DXSDK_DIR%\Lib\x86" Yeah, here's hoping! It's a gigantic gaping hole in the D ecosystem! :) > Under [Environment64]: > LIB=%LIB%;"%DXSDK_DIR%\Lib\x64" > > > I'm not familiar enough with DirectX these days to test this but if you > could test that doing that works, either you or I could make a quick pull > request to implement this. Precisely, my sc.ini simply adds: ; DirectX SDK LIB=%LIB%;"%DXSDK_DIR%\Lib\x64" At the very end of the file, below the "Platform libraries (Windows SDK 7 and 6)". It works for me for years, and I'm sure this would work on anybodies machines. Do you reckon it's a good idea to add it, even if the SDK is not installed on the user's machine? Should we check to see if it's there, and add it at the same time as the various windows sdk's?
Comment #3 by eco — 2014-08-06T05:03:05Z
(In reply to Manu from comment #2) > Do you reckon it's a good idea to add it, even if the SDK is not installed > on the user's machine? Should we check to see if it's there, and add it at > the same time as the various windows sdk's? Adding it there is fine. You'll note that the last 3 entries in the file are for SDK paths for SDKs that may or may not exist. DirectX wouldn't be special. It causing problems seems very unlikely.
Comment #4 by turkeyman — 2014-08-06T05:16:02Z
(In reply to Brad Anderson from comment #3) > (In reply to Manu from comment #2) > > Do you reckon it's a good idea to add it, even if the SDK is not installed > > on the user's machine? Should we check to see if it's there, and add it at > > the same time as the various windows sdk's? > > Adding it there is fine. You'll note that the last 3 entries in the file are > for SDK paths for SDKs that may or may not exist. DirectX wouldn't be > special. It causing problems seems very unlikely. Okay cool. Do you want to just paste my 2 lines at the bottom then?
Comment #5 by turkeyman — 2014-08-06T05:17:48Z
(In reply to Manu from comment #4) > (In reply to Brad Anderson from comment #3) > > (In reply to Manu from comment #2) > > > Do you reckon it's a good idea to add it, even if the SDK is not installed > > > on the user's machine? Should we check to see if it's there, and add it at > > > the same time as the various windows sdk's? > > > > Adding it there is fine. You'll note that the last 3 entries in the file are > > for SDK paths for SDKs that may or may not exist. DirectX wouldn't be > > special. It causing problems seems very unlikely. > > Okay cool. Do you want to just paste my 2 lines at the bottom then? ... what actually happens if DXSDK_DIR is not set? Will the variable evaluate to an empty string? Will it effectively be: LIB=%LIB%;"\Lib\x64" ? That doesn't seem like a good thing... and won't that be the case for the windows sdk's too?
Comment #6 by blah38621 — 2014-08-06T14:15:05Z
Yes, environment variables do evaluate to an empty string if they aren't set. Also, while I don't have a problem with adding the DirectX SDK, as it is common enough, I just want to ask the question, what are the requirements to getting a path added?
Comment #7 by turkeyman — 2014-08-06T14:52:27Z
(In reply to Orvid King from comment #6) > Yes, environment variables do evaluate to an empty string if they aren't set. So, should we consider this a problem? The lib path looks like it will be filled with a bit of junk... although it's probably benign. > Also, while I don't have a problem with adding the DirectX SDK, as it is > common > enough, I just want to ask the question, what are the requirements to > getting a > path added? Well, I have only argued for the DXSDK, because it's an official Microsoft supplied lib with tight integration into their ecosystem, and it has since been merged into the Windows SDK, which created the disparity between new and old versions of Visual Studio. Did you have one in mind? I haven't come in contact with any others that I feel make such a strong case.
Comment #8 by eco — 2014-08-07T01:00:51Z
I don't foresee problems with the path. I just tested and it caused no problems on my DirectX SDK missing system. https://github.com/D-Programming-Language/dmd/pull/3852
Comment #9 by r.sagitario — 2016-01-17T22:20:57Z
The DXSDK_DIR lib paths have been added long time ago.