From ca5a0fc00ee296f77606a80c73c71be57d731e40 Mon Sep 17 00:00:00 2001 From: NinjaCheetah <58050615+NinjaCheetah@users.noreply.github.com> Date: Fri, 10 May 2024 14:21:44 -0400 Subject: [PATCH 1/4] Updated some text, and changed default download directory to a folder under the user's downloads folder --- NUSGet.py | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/NUSGet.py b/NUSGet.py index bc670cb..a4cb935 100644 --- a/NUSGet.py +++ b/NUSGet.py @@ -71,7 +71,8 @@ class MainWindow(QMainWindow, Ui_MainWindow): f"Select a title from the list on the left, or enter a Title ID to begin.\n\n" f"Titles marked with a checkmark are free and have a ticket available, and can" f" be decrypted and/or packed into a WAD or TAD. Titles with an X do not have " - f"a ticket, and only their encrypted contents can be saved.") + f"a ticket, and only their encrypted contents can be saved.\n\nTitles will be " + f"downloaded to a folder named \"NUSGet\" inside your downloads folder.") # Add console entries to dropdown and attach on change signal. self.ui.console_select_dropdown.addItem("Wii") self.ui.console_select_dropdown.addItem("vWii") @@ -175,8 +176,8 @@ class MainWindow(QMainWindow, Ui_MainWindow): pass # Add warning text to the log if the selected title has no ticket. if selected_title["Ticket"] is False: - danger_text = danger_text + ("Note: This Title does not have a Ticket available, so it cannot be packed " - "into a WAD or be decrypted.") + danger_text = danger_text + ("Note: This Title does not have a Ticket available, so it cannot be decrypted" + " or packed into a WAD/TAD.") # Print log info about the selected title and version. self.log_text = (tid + " - " + selected_title["Name"] + "\n" + "Version: " + selected_version + "\n\n" + danger_text + "\n") @@ -562,6 +563,8 @@ class MainWindow(QMainWindow, Ui_MainWindow): self.ui.pack_vwii_mode_chkbox.setEnabled(True) elif self.ui.console_select_dropdown.currentText() == "Wii": self.ui.pack_vwii_mode_chkbox.setEnabled(False) + elif self.ui.console_select_dropdown.currentText() == "DSi": + self.ui.pack_vwii_mode_chkbox.setEnabled(False) if __name__ == "__main__": @@ -573,14 +576,19 @@ if __name__ == "__main__": vwii_database = json.load(database_file) database_file = open(os.path.join(os.path.dirname(__file__), "data/dsi-database.json")) dsi_database = json.load(database_file) - # If this is a compiled build, the path needs to be obtained differently than if it isn't. The use of an absolute - # path here is for compatibility with macOS .app bundles, which require the use of absolute paths. - try: - # noinspection PyUnresolvedReferences - out_folder = os.path.join(__compiled__.containing_dir, "titles") - except NameError: - out_folder = os.path.join(os.path.dirname(sys.argv[0]), "titles") - # Create the titles directory if it doesn't exist. In the future, this directory will probably be elsewhere. + # Load the user's Downloads directory, which of course requires different steps on Windows vs macOS/Linux. + if os.name == 'nt': + import winreg + sub_key = r'SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders' + downloads_guid = '{374DE290-123F-4565-9164-39C4925E467B}' + with winreg.OpenKey(winreg.HKEY_CURRENT_USER, sub_key) as key: + location = winreg.QueryValueEx(key, downloads_guid)[0] + else: + location = os.path.join(os.path.expanduser('~'), 'Downloads') + # Build the path by combining the path to the Downloads photo with "NUSGet". + out_folder = os.path.join(location, "NUSGet") + # Create the "NUSGet" directory if it doesn't exist. In the future, this will be user-customizable, but this works + # for now, and avoids the issues from when it used to use a directory next to the binary (mostly on macOS). if not os.path.isdir(out_folder): os.mkdir(out_folder) From 4b770f0a81addf6f51b28793268448b72022f4d1 Mon Sep 17 00:00:00 2001 From: NinjaCheetah <58050615+NinjaCheetah@users.noreply.github.com> Date: Tue, 14 May 2024 10:01:47 -0400 Subject: [PATCH 2/4] Small DSi database update, getting prepared for release --- data/dsi-database.json | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/data/dsi-database.json b/data/dsi-database.json index 9432c2d..7e6ac15 100644 --- a/data/dsi-database.json +++ b/data/dsi-database.json @@ -22,7 +22,7 @@ }, "Ticket": true, "TAD Name": "Launcher-NUS", - "Danger": "wip" + "Danger": "The Launcher (DSi Menu) is a critical part of the DSi's operation, and should not be modified unless you have Unlaunch installed." }, { "Name": "Version Data", @@ -46,7 +46,7 @@ }, "Ticket": true, "TAD Name": "WiFi-Firmware-NUS", - "Danger": "wip" + "Danger": "The WiFi Firmware is the firmware that runs on the DSi's WiFi chip, and should not be modified. WiFi will not work properly if this title is missing or damaged." } ], "System Apps": [ @@ -57,8 +57,7 @@ "World": [256] }, "Ticket": true, - "TAD Name": "DS-Download-Play-NUS", - "Danger": "wip" + "TAD Name": "DS-Download-Play-NUS" }, { "Name": "Flipnote Studio", @@ -82,8 +81,7 @@ "Australia/NZ": [512, 768] }, "Ticket": false, - "TAD Name": "Nintendo-3DS-Transfer-Tool-NUS", - "Danger": "wip" + "TAD Name": "Nintendo-3DS-Transfer-Tool-NUS" }, { "Name": "Nintendo DSi Browser", @@ -120,8 +118,7 @@ "Australia/NZ": [1536, 1792, 2048, 2304, 2560, 2816, 3072] }, "Ticket": true, - "TAD Name": "Nintendo-DSi-Shop-NUS", - "Danger": "wip" + "TAD Name": "Nintendo-DSi-Shop-NUS" }, { "Name": "Nintendo DSi Sound", From b273c09b584bd68623370aa46f92de248185d900 Mon Sep 17 00:00:00 2001 From: NinjaCheetah <58050615+NinjaCheetah@users.noreply.github.com> Date: Tue, 14 May 2024 10:14:46 -0400 Subject: [PATCH 3/4] Update README.md --- README.md | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 312f59d..c9d3c4c 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,27 @@ # NUSGet -A modern replacement for NUS Downloader built with Python and Qt 6. Powered by libWiiPy. +A modern and supercharged NUS downloader built with Python and Qt6. Powered by libWiiPy and libTWLPy. [![Python application](https://github.com/NinjaCheetah/NUSGet/actions/workflows/python-build.yml/badge.svg)](https://github.com/NinjaCheetah/NUSGet/actions/workflows/python-build.yml) -## Why? -NUS Downloader (Nintendo Update Server Downloader), is an old tool for downloading titles from the Nintendo Update Servers for the Wii and DSi. Originally released in 2009, and effectively last updated in 2011, it stills works today, however it definitely shows its age, and is in need of a refresh. One of the major shortcomings of NUSD is that it only supports Windows, as most of the tools for the Wii from that era are written in C# and use the .NET Framework, especially since they tend to rely on the C# library libWiiSharp. - -With my introduction of [libWiiPy](https://github.com/NinjaCheetah/libWiiPy), there's now a work-in-progress Python library designed to eventually have feature parity with libWiiSharp. At this point in time, the library is featured enough that every piece of libWiiSharp that NUSD relied on is now available in libWiiPy, so I decided to put that to use and create a replacement for it. NUSGet offers nearly all the same features as NUSD (currently there is no support for the DSi servers or for scripting), but is built on top of a modern library with a modern graphical framework, that being Qt6. A major benefit of this rewrite is that its fully cross-platform, and is natively compiled for Windows, Linux, and macOS. - The name is a play on NuGet, the .NET package manager. Thank you [@Janni9009](https://github.com/Janni9009) for the name idea! ## Features -NUSDGet allows you to download any content from the Nintendo Update Servers. Free content (content with a Ticket freely available on the servers) can be decrypted or packed directly into a WAD. +NUSDGet allows you to download any content from the Nintendo Update Servers. Free content (content with a Ticket freely available on the servers) can be decrypted or packed directly into an installable archive (WAD/TAD). -The following options are available: -- Keep encrypted contents: Keeps the files like `00000000`, `00000001`, etc., which are the encrypted contents directly from the update servers. -- Create decrypted contents (*.app): Create decrypted files like `00000000.app`, `00000001.app`, etc., which are the decrypted data from the encrypted contents on the servers. Only supported for free titles. -- Pack WAD: Pack the encrypted contents into a WAD file that can be installed on a Wii or in Dolphin Emulator. Only supported for free titles. +NUSGet also offers the ability to create vWii WADs that can be installed from within vWii mode, since the content directly from the update servers is only designed to be installed from Wii U mode. + +The following features are available for all supported consoles: +- Downloading encrypted contents (files like `00000000`, `00000001`, etc.) directly from the update servers for any title. +- Creating decrypted contents (*.app files) from the encrypted contents on the servers. Only supported for free titles. + +**For Wii and vWii titles only:** +- "Pack installable archive (WAD/TAD)": Pack the encrypted contents, TMD, and Ticket into a WAD file that can be installed on a Wii or in Dolphin Emulator. Only supported for free titles. + +**For vWii titles only:** +- "Pack for vWii mode instead of Wii U mode": Re-encrpyt the Title Key in a vWii title's Ticket before packing a WAD, so that the WAD can be installed from inside the vWii on a Wii U. **This also creates WADs that can be installed directly in Dolphin, allowing for running the vWii System Menu in Dolphin without a vWii NAND dump!** + +**For DSi titles only:** +- "Pack installable archive (WAD/TAD)": Pack the encrypted contents, TMD, and Ticket into a TAD file that can be installed on a TAD or in a DSi-capable emulator. Only supported for free titles. For real hardware, these titles can be installed using [@rvtr](https://github.com/rvtr)'s handy [TAD Delivery Tool](https://github.com/rvtr/TDT). ## Building ### System Requirements @@ -48,3 +53,9 @@ nuitka3 --show-progress --include-data-dir=data=data --assume-yes-for-downloads ``` The result will be a single binary named `NUSGet` that contains everything required to run NUSGet. No dependencies are needed on the target system. + + +## Why this and not NUSD? +NUS Downloader (Nintendo Update Server Downloader), is an old tool for downloading titles from the Nintendo Update Servers for the Wii and DSi. Originally released in 2009, and effectively last updated in 2011, it stills works today, however it definitely shows its age, and is in need of a refresh. One of the major shortcomings of NUSD is that it only supports Windows, as most of the tools for the Wii from that era are written in C# and use the .NET Framework, especially since they tend to rely on the C# library libWiiSharp. NUSD also has far more limited support for DSi titles, and no support whatsoever for vWii titles. + +With my introduction of [libWiiPy](https://github.com/NinjaCheetah/libWiiPy), there's now a work-in-progress Python library designed to eventually have feature parity with libWiiSharp. At this point in time, the library is featured enough that every piece of libWiiSharp that NUSD relied on is now available in libWiiPy, so I decided to put that to use and create a replacement for it. NUSGet offers nearly all the same features as NUSD (currently there is no support for the DSi servers or for scripting), but is built on top of a modern library with a modern graphical framework, that being Qt6. A major benefit of this rewrite is that its fully cross-platform, and is natively compiled for Windows, Linux, and macOS. From f4c73a7f73d44807dcb1e594bd77ef3407b9034e Mon Sep 17 00:00:00 2001 From: NinjaCheetah <58050615+NinjaCheetah@users.noreply.github.com> Date: Tue, 14 May 2024 10:56:54 -0400 Subject: [PATCH 4/4] Switch requirements back to latest libWiiPy release and not main --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index af0df9f..c47b23b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ pyside6 nuitka -git+https://github.com/NinjaCheetah/libWiiPy +libWiiPy libTWLPy zstandard \ No newline at end of file