forked from comfyanonymous/ComfyUI
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the old updater if present when running on the windows standal…
…one.
- Loading branch information
1 parent
36f7fac
commit e61755e
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import os | ||
import shutil | ||
|
||
base_path = os.path.dirname(os.path.realpath(__file__)) | ||
|
||
|
||
def update_windows_updater(): | ||
top_path = os.path.dirname(base_path) | ||
updater_path = os.path.join(base_path, ".ci/update_windows/update.py") | ||
bat_path = os.path.join(base_path, ".ci/update_windows/update_comfyui.bat") | ||
|
||
dest_updater_path = os.path.join(top_path, "update/update.py") | ||
dest_bat_path = os.path.join(top_path, "update/update_comfyui.bat") | ||
dest_bat_deps_path = os.path.join(top_path, "update/update_comfyui_and_python_dependencies.bat") | ||
|
||
try: | ||
with open(dest_bat_path, 'rb') as f: | ||
contents = f.read() | ||
except: | ||
return | ||
|
||
if not contents.startswith(b"..\\python_embeded\\python.exe .\\update.py"): | ||
return | ||
|
||
shutil.copy(updater_path, dest_updater_path) | ||
try: | ||
with open(dest_bat_deps_path, 'rb') as f: | ||
contents = f.read() | ||
contents = contents.replace(b'..\\python_embeded\\python.exe .\\update.py ..\\ComfyUI\\', b'call update_comfyui.bat nopause') | ||
with open(dest_bat_deps_path, 'wb') as f: | ||
f.write(contents) | ||
except: | ||
pass | ||
shutil.copy(bat_path, dest_bat_path) | ||
print("Updated the windows standalone package updater.") |