Skip to content

Commit

Permalink
Merge pull request dyang886#15 from Karasukaigan/main
Browse files Browse the repository at this point in the history
Fix Partial Program Crash BUG
  • Loading branch information
dyang886 authored Mar 31, 2024
2 parents 6ad2e18 + b481375 commit bcdd622
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,7 @@ def run(self):

# Locate extracted .exe file
cnt = 0
gameRawName = None
for filename in os.listdir(self.tempDir):
if "Trainer" in filename and filename.endswith(".exe"):
gameRawName = filename
Expand All @@ -823,6 +824,12 @@ def run(self):
self.messageBox.emit("info", tr("Attention"), tr("Additional actions required\nPlease check folder for details!"))
os.startfile(self.tempDir)

# Check if gameRawName is None
if gameRawName is None:
self.messageBox.emit("error", tr("Error"), tr("Could not find the downloaded trainer file, please try turning your antivirus software off."))
self.finished.emit(1)
return

os.makedirs(self.trainerPath, exist_ok=True)
trainer_name = trans_mFilename + ".exe"
source_file = os.path.join(self.tempDir, gameRawName)
Expand Down

0 comments on commit bcdd622

Please sign in to comment.