installer icon indicating copy to clipboard operation
installer copied to clipboard

DMD Windows installer doesn't detect recent release of VisualStudio

Open TurkeyMan opened this issue 6 months ago • 7 comments

I just ran the DMD installer, and it complained that no VS installation (either the main IDE, or the tools distribution) was installed, so it couldn't find the libs and linker. I have the latest version of VS installed.

TurkeyMan avatar Jun 29 '25 06:06 TurkeyMan

moved to dlang/installer.

Presumably https://github.com/dlang/installer/blob/master/windows/d2-installer.nsi is the file that the installer is created from. What is the exact version of VS you have installed? What is the exact error message you receive trying to install it (for grepping the above linked file)?

thewilsonator avatar Jun 29 '25 08:06 thewilsonator

Image

Image

The operational binaries seem to be hiding generally under C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\bin\...

TurkeyMan avatar Jun 29 '25 10:06 TurkeyMan

Thanks, offending code seems to be at https://github.com/dlang/installer/blob/master/windows/d2-installer.nsi#L384 (and also a suggestion to download version of VS2022 https://github.com/dlang/installer/blob/master/windows/d2-installer.nsi#L341). I don't speak NSIS, but I don't think that should be too hard to fix, but I don't have a windows box.

More than happy to merge a fix though.

thewilsonator avatar Jun 29 '25 11:06 thewilsonator

Rikki linked me to https://github.com/microsoft/vswhere which we should probably be using instead of all this.

thewilsonator avatar Jun 29 '25 11:06 thewilsonator

After playing a bit and reading the wiki, it should be a case of running the following command:

"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath

If its non-empty, you have a > 2017 VS install. If not you do not.

If program not found, no install.

rikkimax avatar Jun 29 '25 11:06 rikkimax

ping @rainers could you take a look at this?

thewilsonator avatar Jun 29 '25 13:06 thewilsonator

Just to mention that Visual D can detect VS2022 (while the D compiler installer can't):

Image

felixf4xu avatar Aug 29 '25 03:08 felixf4xu