Skip to content

Commit

Permalink
Update launcher_reinstall.py
Browse files Browse the repository at this point in the history
  • Loading branch information
seuyh authored Aug 28, 2024
1 parent 7c1549c commit 5077320
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions libs/launcher_reinstall.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os
from shutil import rmtree
from shutil import rmtree, move
from subprocess import Popen
from PyQt5 import QtCore
from time import sleep
Expand All @@ -11,13 +11,16 @@ class ReinstallThread(QtCore.QThread):
error_signal = QtCore.pyqtSignal(Exception)
continue_reinstall = QtCore.pyqtSignal(str)

def __init__(self, msi_path, paradox_folder1, paradox_folder2, paradox_folder3, paradox_folder4):
def __init__(self, msi_path, paradox_folder1, paradox_folder2, paradox_folder3, paradox_folder4,
launcher_downloaded, downloaded_launcher_dir):
super().__init__()
self.msi_path = msi_path
self.paradox_folder1 = paradox_folder1
self.paradox_folder2 = paradox_folder2
self.paradox_folder3 = paradox_folder3
self.paradox_folder4 = paradox_folder4
self.launcher_downloaded = launcher_downloaded
self.downloaded_launcher_dir = downloaded_launcher_dir

def run(self):
msi_files = glob(os.path.join(self.msi_path, "launcher-installer-windows_*.msi"))
Expand All @@ -29,6 +32,10 @@ def run(self):
pass
else:
self.error_signal.emit('launcher_installer not found!')
print(f'Требуется ли подмена лаунчера: {self.launcher_downloaded}')
if self.launcher_downloaded:
os.remove(msi_path)
move(self.downloaded_launcher_dir, msi_path)
print(f'Путь к игре: {self.msi_path}')
print(f'Путь к лаунчеру: {msi_path}\nСуществует ли путь: {os.path.exists(msi_path)}')
print(f'Выполнение удаления')
Expand Down

0 comments on commit 5077320

Please sign in to comment.