diff options
-rw-r--r-- | compiler/installer.ini | 2 | ||||
-rw-r--r-- | tools/downloader.nim | 29 |
2 files changed, 17 insertions, 14 deletions
diff --git a/compiler/installer.ini b/compiler/installer.ini index 31c6f7728..4c7528c75 100644 --- a/compiler/installer.ini +++ b/compiler/installer.ini @@ -94,7 +94,7 @@ Files: "bin/vccexe.exe" Files: "koch.exe" Files: "finish.exe" -Files: "downloader.exe" +Files: "bin/downloader.exe" ; Files: "dist/mingw" Files: r"tools\start.bat" diff --git a/tools/downloader.nim b/tools/downloader.nim index 511e37f81..da79cde8d 100644 --- a/tools/downloader.nim +++ b/tools/downloader.nim @@ -1,4 +1,15 @@ -# Helper that is run after Nim's installation. +## Helper that is run after Nim's installation. + +## We download mirror'ed mingw packages. The originals came from: +## +## https://sourceforge.net/projects/mingw-w64/files/Toolchains%20 +## targetting%20Win32/Personal%20Builds/mingw-builds/6.3.0/threads-win32/ +## dwarf/i686-6.3.0-release-win32-dwarf-rt_v5-rev1.7z/download +## https://sourceforge.net/projects/mingw-w64/files/Toolchains%20 +## targetting%20Win64/Personal%20Builds/mingw-builds/6.3.0/threads-win32/ +## seh/x86_64-6.3.0-release-win32-seh-rt_v5-rev1.7z/download +## + import ui, asyncdispatch, httpclient, os, finish, registry, strutils @@ -22,30 +33,22 @@ proc download(pkg: string; c: Controls) {.async.} = client.onProgressChanged = onProgressChanged # XXX give a destination filename instead - let contents = await client.getContent("https://nim-lang.org/download/" & pkg & ".zip") - let z = "dist" / pkg & ".zip" + let contents = await client.getContent("https://nim-lang.org/download/" & pkg & ".7z") + let z = r"..\dist" / pkg & ".7z" # XXX make this async somehow: writeFile(z, contents) c.bar.value = 100 let olddir = getCurrentDir() try: setCurrentDir(olddir / "dist") - if os.execShellCmd("bin\\7zG.exe x " & pkg & ".zip") != 0: + if os.execShellCmd("7zG.exe x " & pkg & ".7z") != 0: c.lab.text = "Unpacking failed: " & z finally: setCurrentdir(olddir) - when false: - var a: ZipArchive - if open(a, z, fmRead): - extractAll(a, "dist") - close(a) - else: - c.lab.text = "Error: cannot open: " & z - proc apply(a: Actions; c: Controls) {.async.} = if a.mingw: - await download("mingw" & arch, c) + await download("mingw" & arch & "-6.3.0", c) if a.aporia: await download("aporia-0.4.0", c) |