-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathupgrade_octoprint.bat
More file actions
69 lines (62 loc) · 3.35 KB
/
upgrade_octoprint.bat
File metadata and controls
69 lines (62 loc) · 3.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
@echo off
cls
@echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@echo !!! !!!
@echo !!! An attempt will be made to stop all OctoPrint services. Please make sure !!!
@echo !!! you are not currently printing before continuing. !!!
@echo !!! !!!
@echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
pause
cls
setlocal EnableDelayedExpansion
FOR /F "usebackq skip=2 tokens=1,2*" %%A IN (`REG QUERY "HKLM\SOFTWARE\WOW6432Node\OctoPrint\Instances" 2^>nul`) DO (
REM %%A captures the Value Name
REM %%B captures the Value Type (e.g., REG_SZ, REG_DWORD)
REM %%C captures the Value Data
SET "ValueName=%%A"
SET "ValueType=%%B"
SET "ValueData=%%C"
REM Remove quotes from ValueData if present
SET "ValueData=!ValueData:\"=!"
net stop "OctoPrint on Port !ValueName!"
)
endlocal
pause
cls
@echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@echo !!! !!!
@echo !!! Starting upgrade process... !!!
@echo !!! !!!
@echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
call "%~dp0\WPy64-31700\scripts\python.bat" -m pip install --upgrade octoprint
@echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@echo !!! !!!
@echo !!! Upgrade process completed, if there are any errors listed above the !!!
@echo !!! upgrade probably failed, use the error information to open an issue on !!!
@echo !!! GitHub: https://github.com/jneilliii/OctoPrint-WindowsInstaller !!!
@echo !!! !!!
@echo !!! An attempt will now be made to start all OctoPrint services. !!!
@echo !!! !!!
@echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
pause
cls
setlocal EnableDelayedExpansion
FOR /F "usebackq skip=2 tokens=1,2*" %%A IN (`REG QUERY "HKLM\SOFTWARE\WOW6432Node\OctoPrint\Instances" 2^>nul`) DO (
REM %%A captures the Value Name
REM %%B captures the Value Type (e.g., REG_SZ, REG_DWORD)
REM %%C captures the Value Data
SET "ValueName=%%A"
SET "ValueType=%%B"
SET "ValueData=%%C"
REM Remove quotes from ValueData if present
SET "ValueData=!ValueData:\"=!"
net start "OctoPrint on Port !ValueName!"
)
endlocal
pause