mirror of
https://github.com/ihaveamac/custom-install.git
synced 2026-01-21 14:06:02 +00:00
try to search for save3ds_fuse in PATH, if not found locally
This commit is contained in:
@@ -15,7 +15,7 @@ from os.path import dirname, join, isdir, isfile
|
||||
from random import randint
|
||||
from hashlib import sha256
|
||||
from pprint import pformat
|
||||
from shutil import copyfile, copy2, rmtree
|
||||
from shutil import copyfile, copy2, rmtree, which
|
||||
import sys
|
||||
from sys import platform, executable
|
||||
from tempfile import TemporaryDirectory
|
||||
@@ -64,6 +64,9 @@ else:
|
||||
script_dir = dirname(__file__)
|
||||
save3ds_fuse_path = join(script_dir, 'bin', platform, save3ds_fuse_name)
|
||||
|
||||
if not isfile(save3ds_fuse_path):
|
||||
save3ds_fuse_path = which('save3ds_fuse')
|
||||
|
||||
# missing contents are replaced with 0xFFFFFFFF in the cmd file
|
||||
CMD_MISSING = b'\xff\xff\xff\xff'
|
||||
|
||||
@@ -289,7 +292,7 @@ class CustomInstall:
|
||||
return isdir(sd_path)
|
||||
|
||||
def start(self):
|
||||
if not isfile(save3ds_fuse_path):
|
||||
if not (save3ds_fuse_path and isfile(save3ds_fuse_path)):
|
||||
self.log("Couldn't find " + save3ds_fuse_path, 2)
|
||||
return None, False, 0
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ from pyctr.type.cia import CIAError
|
||||
from pyctr.type.tmd import TitleMetadataError
|
||||
|
||||
from . import __version__
|
||||
from .__main__ import CustomInstall, load_cifinish, InvalidCIFinishError, InstallStatus
|
||||
from .__main__ import CustomInstall, load_cifinish, InvalidCIFinishError, InstallStatus, save3ds_fuse_path
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from os import PathLike
|
||||
@@ -739,6 +739,10 @@ class CustomInstallGUI(ttk.Frame):
|
||||
|
||||
|
||||
def main():
|
||||
if not (save3ds_fuse_path and isfile(save3ds_fuse_path)):
|
||||
mb.showerror('Error', "Couldn't find save3ds_fuse. Please place it PATH.")
|
||||
return
|
||||
|
||||
window = tk.Tk()
|
||||
window.title(f'custom-install {__version__}')
|
||||
frame = CustomInstallGUI(window)
|
||||
|
||||
Reference in New Issue
Block a user