File tree Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -193,6 +193,13 @@ def load_extra_path_config(yaml_path):
193
193
folder_paths .set_temp_directory (temp_dir )
194
194
cleanup_temp ()
195
195
196
+ if args .windows_standalone_build :
197
+ try :
198
+ import new_updater
199
+ new_updater .update_windows_updater ()
200
+ except :
201
+ pass
202
+
196
203
loop = asyncio .new_event_loop ()
197
204
asyncio .set_event_loop (loop )
198
205
server = server .PromptServer (loop )
Original file line number Diff line number Diff line change
1
+ import os
2
+ import shutil
3
+
4
+ base_path = os .path .dirname (os .path .realpath (__file__ ))
5
+
6
+
7
+ def update_windows_updater ():
8
+ top_path = os .path .dirname (base_path )
9
+ updater_path = os .path .join (base_path , ".ci/update_windows/update.py" )
10
+ bat_path = os .path .join (base_path , ".ci/update_windows/update_comfyui.bat" )
11
+
12
+ dest_updater_path = os .path .join (top_path , "update/update.py" )
13
+ dest_bat_path = os .path .join (top_path , "update/update_comfyui.bat" )
14
+ dest_bat_deps_path = os .path .join (top_path , "update/update_comfyui_and_python_dependencies.bat" )
15
+
16
+ try :
17
+ with open (dest_bat_path , 'rb' ) as f :
18
+ contents = f .read ()
19
+ except :
20
+ return
21
+
22
+ if not contents .startswith (b"..\\ python_embeded\\ python.exe .\\ update.py" ):
23
+ return
24
+
25
+ shutil .copy (updater_path , dest_updater_path )
26
+ try :
27
+ with open (dest_bat_deps_path , 'rb' ) as f :
28
+ contents = f .read ()
29
+ contents = contents .replace (b'..\\ python_embeded\\ python.exe .\\ update.py ..\\ ComfyUI\\ ' , b'call update_comfyui.bat nopause' )
30
+ with open (dest_bat_deps_path , 'wb' ) as f :
31
+ f .write (contents )
32
+ except :
33
+ pass
34
+ shutil .copy (bat_path , dest_bat_path )
35
+ print ("Updated the windows standalone package updater." )
You can’t perform that action at this time.
0 commit comments