Skip to content

Commit

Permalink
修复 安装问题
Browse files Browse the repository at this point in the history
  • Loading branch information
XiaoXianNv-boot committed Mar 4, 2024
1 parent b28b4af commit e3a9ce9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions server/main/Package.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def down(rul,dir,d,prin,new_client_socket):
acc = 0
nb_traits = 0
progress_bar( nb_traits,dir.split('/')[-1],d,prin,new_client_socket)
with open(".out/" + name + "_V0.2.pkg/" + dir.split("/")[-1], "wb") as file:
with open(".out/" + name + "_" + Version + ".pkg/" + dir.split("/")[-1], "wb") as file:
for chunk in bresp.iter_content(chunk_size=8192):
if chunk:
file.write(chunk)
Expand All @@ -54,7 +54,7 @@ def down(rul,dir,d,prin,new_client_socket):
progress_bar( nb_traits,dir.split('/')[-1],d,prin,new_client_socket)
acc = 0
prin(new_client_socket,("\r{}".format(dir.split('/')[-1]) + d + " : Extracting...{}".format(" "*50)).encode("utf-8")) # Ugly but works everywhere
os.rename(".out/" + name + "_V0.2.pkg/" + dir.split("/")[-1],dir)
os.rename(".out/" + name + "_" + Version + ".pkg/" + dir.split("/")[-1],dir)

prin(new_client_socket,("\r{}".format(dir.split('/')[-1]) + d + " : Pull complete [{}]".format(bresp.headers['Content-Length'])).encode("utf-8"))

Expand All @@ -80,8 +80,8 @@ def install(new_client_socket,post,Versino,Headers,info,prin):
prin(new_client_socket,("\n\r").encode("utf-8"))
if os.path.exists("Tools/openhardwaremonitor") == False:
os.system("Tools\\7z\\7z.exe x lib\\openhardwaremonitor-v0.9.6.zip -r -oTools\\openhardwaremonitor -aoa")
prin(new_client_socket,("install " + name + " V0.2\n\r").encode("utf-8"))
os.system("cp -rf .out/" + name + "_V0.2.pkg/.out/* ./")
prin(new_client_socket,("install " + name + " " + Version + "\n\r").encode("utf-8"))
os.system("cp -rf .out/" + name + "_" + Version + ".pkg/.out/* ./")

if inpkg == "install":
os.system("echo " + name + ">>server/server.ini")
Expand Down Expand Up @@ -111,7 +111,7 @@ def install(new_client_socket,post,Versino,Headers,info,prin):
run.shutdown("reset")
#sys.exit()
#prin(new_client_socket,("END\n\r").encode("utf-8"))
os.system("rm -rf .out/" + name + "_V0.2.pkg")
os.system("rm -rf .out/" + name + "_" + Version + ".pkg")
def remove():
os.system("rm -rf server/" + name)
os.system("rm -rf web/" + name)
Expand Down

0 comments on commit e3a9ce9

Please sign in to comment.