Jump to content




How to make a self updating program?

wireless

  • You cannot reply to this topic
1 reply to this topic

#1 SlimeBOOS

  • Members
  • 10 posts

Posted 12 February 2017 - 12:10 PM

I need to find out how to make a self updating program because i dont wanna keep reupdating the pastebin links.

#2 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 12 February 2017 - 12:17 PM

Simply code the paste IDs into your script, along with an option for it to wipe and replace itself with a fresh copy of whatever's on the pastebin servers.

As a very simple example, I tend to write separate scripts alongside my larger ones which simply serve to download updates for me:

fs.delete("startup")
shell.run("pastebin get <somePasteId> startup")
os.reboot()

I can then just run my updater script, and hey presto, my computer restarts with the latest copy of my software on it. This obviously relies on me having a pastebin account so that I can upload fresh code updates to the same paste ID over and over.

If you're looking for anything more specific than this, then you may need to ask a more specific question.

Edited by Bomb Bloke, 12 February 2017 - 12:19 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users