jneilliii / OctoPrint-WindowsInstaller

72 stars 21 forks source link

[Question] How to upgrade Octoprint #11

Closed SqualeDev closed 11 months ago

SqualeDev commented 1 year ago

I installed version 1.8.7 and it worked fine. I saw that version 1.9.0 was out and so I wanted to install it but I got a message during the installation saying that port 5000 is already in use. What is the procedure to update the version of OctoPrint under windows?

2probro commented 1 year ago

Same issue here

2probro commented 1 year ago

When I try to upload it in octoprint itself, I get an error message and the update fails

jneilliii commented 1 year ago

It's related to not having the vc++ build tools installed, and is described in the error with a link. Basically need to do step 2 from here first which is download install from https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2022 and during install check desktop development with c++.

3e370587a9618f2ea136af049026c7dfa5eee9f5

kobusestas commented 1 year ago

I agree, it would be nice to have some quick info on how to upgrade with an existing install. I tried to get into the pip environment to do it that way but didn't have any luck.

jneilliii commented 1 year ago

Yeah, I've been meaning to add a batch file to do it. Basically you have to stop the service, and then use the proper pip command to upgrade.

C:\OctoPrint\WPy64-31050\python-3.10.5.amd64\Scripts\pip.exe install --upgrade octoprint 

The base path and WPy64... folders may have changed depending on when you installed.

kobusestas commented 1 year ago

Yeah, I've been meaning to add a batch file to do it. Basically you have to stop the service, and then use the proper pip command to upgrade.

C:\OctoPrint\WPy64-31050\python-3.10.5.amd64\Scripts\pip.exe install --upgrade octoprint 

The base path and WPy64... folders may have changed depending on when you installed.

Ah perfect, thanks much! I'll give this a try tomorrow and report back.

jneilliii commented 1 year ago

actually, I did already add the upgrade_octoprint.bat file to the installer, but only 3 weeks ago. you could download the file from here and manually edit it to replace the ####EXEPATH#### token inside with Notepad, to the path that matches your installation path and the rest as mentioned before. Then you'll have it for the next version upgrade as well.

kobusestas commented 1 year ago

Awesome, that's perfect. Thanks for the quick reply! I'll try that then.

jneilliii commented 1 year ago

Realized that since the installer allows you to install multiple instances for controlling more than one printer, can't stop the service automatically, but it gives warning to remind you when you run it. Depending on where you installed it you may also have to Run As Administrator to have the necessary permissions. Windows has gotten way more finicky about stuff like that.

kobusestas commented 1 year ago

Editing the bat file worked for me, thanks again. I'm trying to see if there's an easy way to automate stopping the octoprint service with a wildcard search to add to the script. Will report back if I figure that out in case you want to add that in.

jneilliii commented 11 months ago

So I was able to figure out a loop method in batch file to handle stopping/starting services. I just pushed it to the repo and the installer is building now with the new change. @kobusestas you can modify your file to match the new template here.

kobusestas commented 11 months ago

So I was able to figure out a loop method in batch file to handle stopping/starting services. I just pushed it to the repo and the installer is building now with the new change. @kobusestas you can modify your file to match the new template here.

Perfect thanks much! Something to note, I was able to update from the web interface this time without any issues. I'm not sure if running the script last time "freed something up" to allow that or if I just got lucky but thought I'd share the info in case it's helpful.

jneilliii commented 11 months ago

I think maybe you got lucky. In the next release of OctoPrint 1.10.0 on windows it won't give you the option to upgrade from the UI.