nvda icon indicating copy to clipboard operation
nvda copied to clipboard

Could not locate vc redistributables when VS2017 is installed on a custom path

Open jiangtiandao opened this issue 8 years ago • 8 comments

Steps to reproduce:

  1. Install VS2017 in a custom path such as E:\2017
  2. git clone nvda code
  3. Run scons source in cmd
  4. An error occured

Expected behavior:

scon config source correctly

Actual behavior:

RuntimeError: Could not locate vc redistributables. Perhaps the Universal Windows Platform component in visual Studio is not installed: File "D:\Users\John\Documents\GitHub\nvda\SConstruct", line 178: env32.SConscript('nvdaHelper/archBuild_sconscript',exports={'env':env32,'clientInstallDir':clientDir.Dir('x86'),'libInstallDir':sourceLibDir},vari ant_dir='build/x86') File "D:\Users\John\Documents\GitHub\nvda\include\scons\src\engine\SCons\Script\SConscript.py", line 544: return _SConscript(self.fs, *files, **subst_kw) File "D:\Users\John\Documents\GitHub\nvda\include\scons\src\engine\SCons\Script\SConscript.py", line 253: call_stack[-1].globals) File "D:\Users\John\Documents\GitHub\nvda\build\x86\archBuild_sconscript", line 177: win10localLib=env.SConscript('localWin10/sconscript',) File "D:\Users\John\Documents\GitHub\nvda\include\scons\src\engine\SCons\Script\SConscript.py", line 544: return _SConscript(self.fs, *files, **subst_kw) File "D:\Users\John\Documents\GitHub\nvda\include\scons\src\engine\SCons\Script\SConscript.py", line 253: call_stack[-1].globals) File "D:\Users\John\Documents\GitHub\nvda\build\x86\localWin10\sconscript", line 49: raise RuntimeError("Could not locate vc redistributables. Perhaps the Universal Windows Platform component in visual Studio is not installed")

System configuration:

NVDA version: master branch code Windows version: Windows 8.1 Enterprise

Possible fix

Get actual install path for Visual Studio 2017 from Windows Registry or something else in nvda/nvdaHelper/localWin10/sconscript

https://blogs.msdn.microsoft.com/heaths/2017/02/25/vswhere-available/

jiangtiandao avatar Mar 10 '18 09:03 jiangtiandao

How much of the MSVC install path can be configured?

E.g. if it were e:\2017, in that directory, would there still be community\2017\vc\tools and community\2017\vc\redist? or does that dir simply contain vc\tools and vc\redist?

Annoyingly although SCons did use  the registry via vswhere.exe, it drops some of the information we need after it sets its own variables it needs.

We will be able to rebuild the path by looking at its path, include or lib variables, but I need to know how much of those paths is truly static.

michaelDCurran avatar Mar 12 '18 00:03 michaelDCurran

Default path is C:\Program Files (x86)\Microsoft Visual Studio\2017\Community After changing to E:\2017 Path of tools would be E:\2017\VC\Redist E:\2017\VC\Tools @michaelDCurran

jiangtiandao avatar Mar 15 '18 07:03 jiangtiandao

@jiangtiandao Is this still happening for your with latest master?

lukaszgo1 avatar Mar 21 '19 19:03 lukaszgo1

Happening with current master 6d4b11212272decc99cdf60e9177eb8c84269ff3. Different line numbers, but same message.

grimmohe avatar Apr 30 '19 10:04 grimmohe

Unfortunately, Visual Studio does not offer us a reliable way to find out where these files are located.

LeonarddeR avatar Sep 19 '19 06:09 LeonarddeR

@grimmohe @jiangtiandao I've tried to reproduce this issue with VS 2019 installed to i:\vs2019 but for me it works. Can you confirm?

lukaszgo1 avatar Jul 24 '20 19:07 lukaszgo1

@Adriani90 As I was unable to reproduce this issue and none of the people affected by this seems to be available anymore it might be worth closing this as works for me. We can always reopen if it is reproducible for someone else.

lukaszgo1 avatar Jul 29 '20 18:07 lukaszgo1

As described above I'm unable to reproduce this on two machines on which VS 2019 is installed into a custom path and original reporters seems not to be available. I suggest to close this issue.

lukaszgo1 avatar Aug 23 '21 11:08 lukaszgo1