Copy the respected vc folder into Compilers directory of your PureBasic 6.10 installation.
Code: Select all
EnableExplicit
UseZipPacker()
Procedure UnPackDelete(sVSIX.s, sOut.s)
Protected sPattern.s = "*/cvtres.exe;*/link.exe;*/mspdb140.dll;*/mspdbcore.dll;*/msvcp140.dll" +
";*/msvcp140_atomic_wait.dll;*/pgodb140.dll;*/tbbmalloc.dll" +
";*/vcruntime140.dll;*/vcruntime140_1.dll;*/mspdbcore.dll"
Protected iCount, hPack = OpenPack(#PB_Any, sVSIX)
If hPack
If ExaminePack(hPack)
While NextPackEntry(hPack)
If PathMatchSpec_(PackEntryName(hPack), @sPattern)
If UncompressPackFile(hPack, sOut + GetFilePart(PackEntryName(hPack)), PackEntryName(hPack)) <> -1
iCount + 1
EndIf
EndIf
Wend
EndIf
ClosePack(hPack)
EndIf
DeleteFile(sVSIX)
ProcedureReturn iCount
EndProcedure
Procedure DownLoad_VcLinker(sDir.s = "")
Protected sTempDir.s = GetTemporaryDirectory()
If sDir = ""
Protected sDesktop.s = Space(#MAX_PATH), pidl
If SHGetSpecialFolderLocation_ (0, #CSIDL_DESKTOP, @pidl) = #NOERROR
SHGetPathFromIDList_(pidl, @sDesktop)
CoTaskMemFree_(pidl)
sDir = sDesktop
EndIf
EndIf
If Right(sDir, 1) <> "\" : sDir + "\" : EndIf
sDir + "VC_Linker\"
Protected sOut_64.s, sOut_86.s, iCount
sOut_64 = sDir + "x64\vc\"
sOut_86 = sDir + "x86\vc\"
SHCreateDirectory_(0, @sOut_64)
SHCreateDirectory_(0, @sOut_86)
Debug "Loading 1 / 4"
ReceiveHTTPFile("https://download.visualstudio.microsoft.com/" +
"download/pr/76697fd9-5c84-4e10-9209-374cb27a9f53/" +
"e35eb4be1c72d8419f5a1fa7d59e11a5aecfc4b96e0e0e7e67b0aa59ad4b52b9/" +
"Microsoft.VC.14.39.17.9.Tools.HostX64.TargetX64.base.vsix",
sTempDir + "Tools.HostX64.vsix")
Debug "Loading 2 / 4"
ReceiveHTTPFile("https://download.visualstudio.microsoft.com/" +
"download/pr/ec3eaa61-e46b-4bc9-8f37-6de6009fd3f6/" +
"1b928af049010451b5ec600fbaf873905b289c6936f3ccbbec4951d79b264e4d/" +
"Microsoft.VC.14.39.17.9.Premium.Tools.HostX64.TargetX64.base.vsix",
sTempDir + "Premium.Tools.HostX64.vsix")
Debug "Loading 3 / 4"
ReceiveHTTPFile("https://download.visualstudio.microsoft.com/"+
"download/pr/76697fd9-5c84-4e10-9209-374cb27a9f53/" +
"1267083ebf94f6bf042385146161c65805517d137a3b065dc57b1148f6b7d99b/" +
"Microsoft.VC.14.39.17.9.Tools.HostX86.TargetX86.base.vsix",
sTempDir + "Tools.HostX86.vsix")
Debug "Loading 4 / 4"
ReceiveHTTPFile("https://download.visualstudio.microsoft.com/"+
"download/pr/ec3eaa61-e46b-4bc9-8f37-6de6009fd3f6/" +
"6b79e89351b89132c6be407357349f4cbcd8e717f16a46503c1a23b655e9fa62/" +
"Microsoft.VC.14.39.17.9.Premium.Tools.HostX86.TargetX86.base.vsix",
sTempDir + "Premium.Tools.HostX86.vsix")
iCount = UnPackDelete(sTempDir + "Tools.HostX64.vsix", sOut_64)
iCount + UnPackDelete(sTempDir + "Premium.Tools.HostX64.vsix", sOut_64)
iCount + UnPackDelete(sTempDir + "Tools.HostX86.vsix", sOut_86)
iCount + UnPackDelete(sTempDir + "Premium.Tools.HostX86.vsix", sOut_86)
Protected flags = #PB_MessageRequester_Error
If iCount = 19
flags = #PB_MessageRequester_Info
EndIf
MessageRequester("Download finished", Str(iCount) + " from 19 files received!", flags)
ShellExecute_(0, 0, @sDir, 0, 0, #SW_SHOWDEFAULT)
EndProcedure
DownLoad_VcLinker()