Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

Commit

Permalink
Final prep for first release
Browse files Browse the repository at this point in the history
  • Loading branch information
NiceneNerd committed Apr 6, 2019
1 parent 1a05f85 commit 79f7bc0
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 11 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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).
32 changes: 25 additions & 7 deletions install.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2019 Nicene Nerd <[email protected]>
# Licensed under GPLv3+

import argparse
import configparser
import csv
Expand All @@ -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
Expand Down Expand Up @@ -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...")
Expand All @@ -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:
Expand All @@ -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'):
Expand Down Expand Up @@ -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')
Expand All @@ -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()
10 changes: 10 additions & 0 deletions uninstall.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2019 Nicene Nerd <[email protected]>
# Licensed under GPLv3+

import argparse
import configparser
import glob
Expand All @@ -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:')
Expand Down
9 changes: 6 additions & 3 deletions update.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Copyright 2019 Nicene Nerd <[email protected]>
# Licensed under GPLv3+

import argparse
from helpers import mergerstb
from helpers import mergepacks

from helpers import mergepacks, mergerstb

args = None

Expand All @@ -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()
main()

0 comments on commit 79f7bc0

Please sign in to comment.