From 56747d36eb5b58856c5413fe88b48916c4c8a808 Mon Sep 17 00:00:00 2001 From: Ian Burgwin Date: Sun, 19 Jul 2020 22:29:33 -0700 Subject: [PATCH] custominstall: exit early if save3ds_fuse can't be found --- custominstall.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/custominstall.py b/custominstall.py index 6b212e0..844fd44 100644 --- a/custominstall.py +++ b/custominstall.py @@ -6,7 +6,7 @@ from argparse import ArgumentParser from os import makedirs, scandir -from os.path import dirname, join +from os.path import dirname, join, isfile from random import randint from hashlib import sha256 from locale import getpreferredencoding @@ -162,6 +162,13 @@ class CustomInstall: self.event.update_percentage((total_read / size) * 100, total_read / 1048576, size / 1048576) def start(self, continue_on_fail=True): + save3ds_fuse_path = join(script_dir, 'bin', platform, 'save3ds_fuse') + if platform == 'win32': + save3ds_fuse_path += '.exe' + if not isfile(save3ds_fuse_path): + self.log("Couldn't find " + save3ds_fuse_path, 2) + return + crypto = self.crypto # TODO: Move a lot of these into their own methods self.log("Finding path to install to...") @@ -393,7 +400,7 @@ class CustomInstall: with TemporaryDirectory(suffix='-custom-install') as tempdir: # set up the common arguments for the two times we call save3ds_fuse save3ds_fuse_common_args = [ - join(script_dir, 'bin', platform, 'save3ds_fuse'), + save3ds_fuse_path, '-b', crypto.b9_path, '-m', self.movable, '--sd', self.sd,