downloader: unzip to dist/ directory
This commit is contained in:
parent
26a8364ed7
commit
65dda79335
1 changed files with 7 additions and 2 deletions
|
|
@ -27,8 +27,13 @@ proc download(pkg: string; c: Controls) {.async.} =
|
|||
# XXX make this async somehow:
|
||||
writeFile(z, contents)
|
||||
c.bar.value = 100
|
||||
if os.execShellCmd("7zG x " & z) != 0:
|
||||
c.lab.text = "Unpacking failed: " & z
|
||||
let olddir = getCurrentDir()
|
||||
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:
|
||||
var a: ZipArchive
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue