Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
  • 0
AwesomeAlec1

Trouble writing a program that can update and immediately re-run itself

Question

Hello, I'm working with a friend on an installer program for one of our other programs. The installer is supposed to be able to ask the user to update the installer, and if they say yes, the installer will overwrite itself with its latest version from GitHub, then run itself once complete. The way we did this in previous programs was as follows:
 
os.execute("cd /home; pastebin get -f hh14Sxhi dc15; cls; dc15")
 
In the above code, the example program cd's to its install directory, overwrites itself using the pastebin command, then runs itself. However, that is not having the intended effect in the installer, which ends up skipping past the update prompt when re-running itself. Is there a better way to implement this? (edited)
The only thing I can think of would be to create a new thread that runs the new process, then kill the overwritten process without joining the newly-created thread, but I'm not entirely sure.
Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.