Re: Automatic Updater in Python

2020-04-05 Thread AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector


  


Re: Automatic Updater in Python

@10I think you have to use the popen constructor directly; see the Python subprocess module docs for details.

URL: https://forum.audiogames.net/post/516379/#p516379




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Automatic Updater in Python

2020-04-05 Thread AudioGames . net Forum — Developers room : TJ . Breitenfeldt via Audiogames-reflector


  


Re: Automatic Updater in Python

Thank you for the replies. I have almost finished implementing Hijackers method for handling this, and so far it is working great. However, I have been having problems finding the write code for creating a new process that is independent of the process that started it. In otherwords, I want to be able to run the updater, reach the end, the user presses enter, then right before closing it launches my main application. The code I am using seems to create a child process, and the parent process is waiting until the child process has closed. I am using subprocess right now, here is the line I am using for starting a new process for windows, my mac code is slightly different:                subprocess.check_output(["start", "upgrader.exe"], shell=True, stderr=subprocess.PIPE, stdin=subprocess.PIPE)As I mentioned I have two lines of code to do this, one for windows and one for unix. Is there a better way of doing this, and how can I create an independent process rather than a child process.Timothy Breitenfeldt

URL: https://forum.audiogames.net/post/516377/#p516377




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Automatic Updater in Python

2020-04-04 Thread AudioGames . net Forum — Developers room : ashleygrobler04 via Audiogames-reflector


  


Re: Automatic Updater in Python

yeah same here

URL: https://forum.audiogames.net/post/515972/#p515972




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Automatic Updater in Python

2020-04-04 Thread AudioGames . net Forum — Developers room : thetechguy via Audiogames-reflector


  


Re: Automatic Updater in Python

@NicklasMCHD. I can't read the docs of Just Update. It brings me to a not found error.

URL: https://forum.audiogames.net/post/515954/#p515954




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Automatic Updater in Python

2020-04-04 Thread AudioGames . net Forum — Developers room : NicklasMCHD via Audiogames-reflector


  


Re: Automatic Updater in Python

@6 it does not have that out of the box (since that is UI specific) but it's very easy to implement, since the update process have a callback function, that you can use to get the status and update a progress bar

URL: https://forum.audiogames.net/post/515908/#p515908




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Automatic Updater in Python

2020-04-04 Thread AudioGames . net Forum — Developers room : ashleygrobler04 via Audiogames-reflector


  


Re: Automatic Updater in Python

@5 does your updater have progress bars that checks the download progress or do i need to do that with wx my self?

URL: https://forum.audiogames.net/post/515904/#p515904




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Automatic Updater in Python

2020-04-04 Thread AudioGames . net Forum — Developers room : NicklasMCHD via Audiogames-reflector


  


Re: Automatic Updater in Python

If you want, you can also check out JustUpdate which is an updater framework I developed. I'm currently using it in all my projects, both on Windows and MacOS, and it's working amazing so far.

URL: https://forum.audiogames.net/post/515891/#p515891




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Automatic Updater in Python

2020-04-03 Thread AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector


  


Re: Automatic Updater in Python

Grab Rust, C++, or Go. Write your updater in that as a small executable.  Go is probably the easiest for someone who is going to learn a language and never touch it again. You won't even have a UI in the updater.  Here is what you need to do, modulo details you'll have to work out along the way.  You can probably just find someone else's solution for this in sighted land anyway. But if you really want to.When the program launches, it's launched through a shortcut pointing at the updater (which should be windowless, so that the user doesn't even know it's there) instead of directly. The updater starts the program immediately.  Then it checks the server for updates while the user uses the program. If it finds one, it starts a download to a directory adjacent to your program (deleting said directory and starting over if it's already there). After it has successfully completed and verified the download, it writes a magic file that says it finished downloading (doing this only after the download is 100% there and verified is important).Next time it starts the program, it sees the magic file.  Then the updater copies itself to a temporary directory, starts the copy in the temporary directory passing in the path that needs updating and a switch that says this is the real update, then kills itself.The version in the temp directory just replaces the first directory's contents with the downloaded version, which can include the updater program itself.  Then starts the program as usual and shuts down. Because it's small it can just sit there until something cleans up the temp files.If you want to prompt the user, have the updater write a marker file that says a new version is available, then when the program launches (not the updater, the real program) rename that file appropriately to the "update me" marker file if the user says yes and restart the program, which will immediately perform the update.And you're done. A little bit confusing but this is probably only 100 lines of Go total.I don't recommend trying to work out platform specific batch scripts.  And please, for the love of god, do not use commands without fully understanding what they do inside something which has the power to delete files.  I don't care what the command is, as soon as you're saying that you don't fully understand something you had better go understand it.  The difference between a working updater and you killing someone's computer is your updater being fully understood and perfect in every way.

URL: https://forum.audiogames.net/post/515780/#p515780




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Automatic Updater in Python

2020-04-03 Thread AudioGames . net Forum — Developers room : Ty via Audiogames-reflector


  


Re: Automatic Updater in Python

What you could also do is have it not unzip the files and have the user do that, or you could have it extract to a subfolder.

URL: https://forum.audiogames.net/post/515779/#p515779




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Automatic Updater in Python

2020-04-03 Thread AudioGames . net Forum — Developers room : Hijacker via Audiogames-reflector


  


Re: Automatic Updater in Python

First: yeah, only Windows knows the limitation to lock file access as long as its in use AFAIK, hence you can properly implement the easiest updating method on Linux/Mac: overwriting even the running executable. On Windows however, there will most likely be a two-part updating process. The main application checks for updates and reports if an update is available. If the user decides to download and apply the update, the main program runs the updater with the required information (which version to download etc). The main program will shut down right afterwards. The updater will do its thing, replacing the main program and all of its components, but store all the components related to the updater itself, including the newest version of the updater, if available, in some secure place, e.g. a temp folder, then launches the main program if the remaining update was successful. The main program can then notice if there are still files which need to be replaced, e.g. by checking if a temp folder like previously mentioned can be found on the system. If yes, it will move on to replace all the parts from the updater to finish the update properly. That way, both the main program and the updater can be updated.It always depends on the program layout though. If you have e.g. a Java program, the actual process will only contain the JVM which runs the Java files in a sandbox. That has the advantage that the launcher, the main program, usually doesn't need to be replaced, because it doesn't contain any critical code, but just the code to launch the VM. That allows to replace all the actual program components, because the relevant files aren't locked.Best Regards.Hijacker

URL: https://forum.audiogames.net/post/515776/#p515776




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Automatic Updater in Python

2020-04-03 Thread AudioGames . net Forum — Developers room : TJ . Breitenfeldt via Audiogames-reflector


  


Automatic Updater in Python

Hi, I am trying to create a platform independent automatic updater in python 3.7.6. I had it working successfully for a while, but only on windows. This is kind of a confusing thing I am trying to do, and perhaps someone can tell me if I am just nuts, and need to suck it up that I can't update my updater.Anyways, so what it was doing was checking my web server for version.txt using a HTTP GET request, and comparing it against the version number in the program. If the user chooses to update, it makes an HTTP request to pull the zip file from the server into the temp directory, unzip it, and starts moving files over replacing the old  files. This is where my problem is. So, I have the main exicutable that was created using pyinstaller --onefile, a second exicutable that is my updater, plus other files and folders.I would like the ability to update the updater as well, which seems paradoxical, but if I make changes to the updater, I would like those changes to be pushed and downloaded by the updater also. The main problem is on windows, although I have not looked much into Mac yet, you cannot delete a file of a running process. This means that when I start moving files from the new version in temp to the location of the installed program, I can not replace the updater executable because it is running. I don't think Linux has this restriction, not sure about Mac yet. So, I solved this before, by using a hackery batch command. My updater wrote a batch script to kill the process of my updater, move the files, and at the end I used this command, (goto) 2> NUL & del \"%~f0\" & pause & exitwhich performs a goto instruction that I don't quite understand, but allows me to self delete the script so the user doesn't have a batch script just hanging around, and pauses just before exiting.It is pretty terrible, but it worked. I was able to update the updater and push the new update. Users  would pull the update if the user chose to update using the updater, and the updater would generate the batch script that handled moving files, and would self delete. To my problem, I want this functionality platform independent, well at least working on Mac also. So, am I crazy to try and create a self updating updater, or is there a better solution.The option I have been pondering is, using the same solution for windows, and just doing a operating system check to perform a different set of tasks for Mac. I don't like this though for reasons that I am sure most can guess.I am guessing that most people are going to tell me to just except that the updater won't get updated, it is just a utility program to update the main application, and that I need to just write the code well the first time and not touch it again. I am curious though if what people's thoughts are on this.Thanks,Timothy Breitenfeldt

URL: https://forum.audiogames.net/post/515767/#p515767




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector