From 79f7bc05737a29b47cd8bc8011e548266473904e Mon Sep 17 00:00:00 2001 From: Caleb Smith Date: Fri, 5 Apr 2019 21:14:21 -0500 Subject: [PATCH] Final prep for first release --- README.md | 5 ++++- install.py | 32 +++++++++++++++++++++++++------- uninstall.py | 10 ++++++++++ update.py | 9 ++++++--- 4 files changed, 45 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 3d5e11a2..eef57df8 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,9 @@ The following `pip` packages ## Setup -Until I figure out how to make a `pip` package, either: +First, make sure you have all the dependencies. If you don't, install them. + +Next, until I get around to making a `pip` package, either: * Clone the repository to your root CEMU folder, e.g. `C:\Cemu\BCML`, or * Download the release ZIP and unzip to your root CEMU folder, e.g. `C:\Cemu\BCML` @@ -124,6 +126,7 @@ optional arguments: ``` ## License + This software is licensed under the terms of the GNU General Public License, version 3 or later. This software includes the 7-Zip console application `7za.exe`, which is licensed under the GNU Lesser General Public License. The source code for this application is available for free at [https://www.7-zip.org/download.html](https://www.7-zip.org/download.html). \ No newline at end of file diff --git a/install.py b/install.py index a7d38f94..483e24c8 100644 --- a/install.py +++ b/install.py @@ -1,3 +1,6 @@ +# Copyright 2019 Nicene Nerd +# Licensed under GPLv3+ + import argparse import configparser import csv @@ -16,8 +19,8 @@ import wszst_yaz0 import xxhash from rstb import util -from helpers import mergerstb -from helpers import mergepacks + +from helpers import mergepacks, mergerstb hashtable = {} args = None @@ -86,6 +89,16 @@ def get_mod_id(moddir) -> int: return i def main(): + print('##############################################') + print('## Breath of the Wild Cemu Mod Loader ##') + print('## Mod Installer ##') + print('##------------------------------------------##') + print('## (c) 2019 Nicene Nerd - GPLv3+ ##') + print('## 7za.exe (c) 2019 Ignor Pavolv - LGPLv3+ ##') + print('##############################################') + print() + print(f'Attemping to install {args.mod}...') + print() try: exdir = os.getcwd() print("Loading hash table...") @@ -109,7 +122,7 @@ def main(): modzip.extractall('./tmp') modzip.close() elif args.mod.endswith('.7z'): - os.system(f'.\\helpers\\7za.exe x -otmp "{args.mod}"') + os.system(f'.\\helpers\\7za.exe x -otmp "{args.mod}" >nul 2>&1') else: raise Exception except: @@ -123,7 +136,8 @@ def main(): try: os.chdir(mdir) except Exception as e: - pass + print('No rules.txt was found. Is this a mod in Cemu graphics pack format?') + sys.exit(e) modfiles = {} if os.path.exists('./content'): @@ -195,6 +209,10 @@ def main(): rules.close() mergerstb.main(args.directory, "verb" if args.verbose else "quiet") if not args.nomerge: mergepacks.main(args.directory, args.verbose) + + os.chdir(exdir) + if os.path.exists('tmp'): shutil.rmtree('tmp') + print('Mod installed successfully!') except: print(f'There was an error installing {args.mod}') print('Check error.log for details') @@ -207,11 +225,11 @@ def main(): if __name__ == "__main__": parser = argparse.ArgumentParser(description = 'A tool to install and manage mods for Breath of the Wild in CEMU') parser.add_argument('mod', help = 'Path to a ZIP or RAR archive containing a BOTW mod in Cemu 1.15+ format') - parser.add_argument('-s', '--shrink', help = 'Update RSTB entries for files which haven\'t grown', action="store_true") - parser.add_argument('-l', '--leave', help = 'Do not remove RSTB entries for file sizes which cannot be calculated', action="store_true") - parser.add_argument('-p', '--priority', help = 'Mod load priority, default 100', default = '100', type = int) parser.add_argument('-d', '--directory', help = 'Specify path to Cemu graphicPacks folder, default assumes relative path from BCML install directory', default = '../graphicPacks', type = str) + parser.add_argument('-p', '--priority', help = 'Mod load priority, default 100', default = '100', type = int) parser.add_argument('--nomerge', help = 'Do not automatically merge pack files', action = 'store_true') + parser.add_argument('-s', '--shrink', help = 'Update RSTB entries for files which haven\'t grown', action="store_true") + parser.add_argument('-l', '--leave', help = 'Do not remove RSTB entries for file sizes which cannot be calculated', action="store_true") parser.add_argument('-v', '--verbose', help = 'Verbose output covering every file processed', action='store_true') args = parser.parse_args() main() diff --git a/uninstall.py b/uninstall.py index dec3f6cd..82fa8375 100644 --- a/uninstall.py +++ b/uninstall.py @@ -1,3 +1,6 @@ +# Copyright 2019 Nicene Nerd +# Licensed under GPLv3+ + import argparse import configparser import glob @@ -9,6 +12,13 @@ args = None def main(): + print('##############################################') + print('## Breath of the Wild Cemu Mod Loader ##') + print('## Mod Installer ##') + print('##------------------------------------------##') + print('## (c) 2019 Nicene Nerd - GPLv3+ ##') + print('##############################################') + print() i = 0 mods = {} print('Mods currently installed:') diff --git a/update.py b/update.py index 73ac7d2d..93f4888a 100644 --- a/update.py +++ b/update.py @@ -1,6 +1,9 @@ +# Copyright 2019 Nicene Nerd +# Licensed under GPLv3+ + import argparse -from helpers import mergerstb -from helpers import mergepacks + +from helpers import mergepacks, mergerstb args = None @@ -22,4 +25,4 @@ def main(): parser.add_argument('-d', '--directory', help = 'Specify path to Cemu graphicPacks folder, default assumes relative path from BCML install directory', default = '../graphicPacks', type = str) parser.add_argument('-v', '--verbose', help = 'Verbose output covering every file processed', action='store_true') args = parser.parse_args() - main() \ No newline at end of file + main()