Merge remote-tracking branch 'origin/main'

This commit is contained in:
Campbell 2024-05-18 20:46:51 -04:00
commit 0bf0c2b5d7
Signed by: NinjaCheetah
GPG Key ID: B547958AF96ED344
4 changed files with 47 additions and 31 deletions

View File

@ -73,7 +73,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")
@ -177,8 +178,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")
@ -564,6 +565,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__":
@ -575,14 +578,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)

View File

@ -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.

View File

@ -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",

View File

@ -1,5 +1,5 @@
pyside6
nuitka
git+https://github.com/NinjaCheetah/libWiiPy
libWiiPy
libTWLPy
zstandard