Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function askReplace()
- write("Replace existing AppStore install?\n(Y/N)")
- local resp = read()
- if not (resp=="Y" or resp=="N") then
- print("Please type \"Y\" or \"N\".")
- return askReplace()
- end
- if(resp=="N") then
- print("User cancelled reinstall.")
- error()
- end
- fs.delete("AppStore")
- end
- if fs.exists("AppStore") then askReplace() end
- fs.makeDir("AppStore")
- function downloadFromSource(url_end,id)
- url = "http://dl.dropbox.com/u/133665124/computercraft/appstore-install/"..url_end
- local filecontents = nil
- local link=http.get(url)
- if not link then
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.red)
- term.clear()
- term.setCursorPos(1,1)
- print("Zacpier's appstore installer is having trouble connecting\nto the remote server at:\n"..url.."\nPlease try again later.")
- error()
- end
- filecontents = link.readAll()
- link.close()
- return filecontents
- end
- function dlToFile(name)
- f = io.open("AppStore/"..name, 'w')
- f:write(downloadFromSource(name))
- f:close()
- print("Downloaded "..name..".")
- end
- dlToFile("Store")
- dlToFile("softwareSources")
- fs.makeDir("AppStore/img")
- dlToFile("img/appBox.nfp")
- dlToFile("img/back.nfp")
- dlToFile("img/description.nfp")
- dlToFile("img/install.nfp")
- dlToFile("img/mainFrame.nfp")
- print("Complete!\nTo launch the appstore, just type \"AppStore\\Store\".")
Advertisement
Add Comment
Please, Sign In to add comment