downloader: unzip to dist/ directory

This commit is contained in:
Araq 2017-01-23 00:45:29 +01:00
commit 65dda79335

View file

@ -27,8 +27,13 @@ proc download(pkg: string; c: Controls) {.async.} =
# XXX make this async somehow: # XXX make this async somehow:
writeFile(z, contents) writeFile(z, contents)
c.bar.value = 100 c.bar.value = 100
if os.execShellCmd("7zG x " & z) != 0: let olddir = getCurrentDir()
c.lab.text = "Unpacking failed: " & z try:
setCurrentDir(olddir / "dist")
if os.execShellCmd("bin\\7zG.exe x " & pkg & ".zip") != 0:
c.lab.text = "Unpacking failed: " & z
finally:
setCurrentdir(olddir)
when false: when false:
var a: ZipArchive var a: ZipArchive