diff --git a/GodMode9 b/GodMode9
index f611b31..cf1cb1c 160000
--- a/GodMode9
+++ b/GodMode9
@@ -1 +1 @@
-Subproject commit f611b31c0c6aa40a04106a4c4ca7e85b740fa38a
+Subproject commit cf1cb1cfc5965cec3dd10ba98269aeb37b9b7a9d
diff --git a/Makefile b/Makefile
index 15a8788..76b11f2 100644
--- a/Makefile
+++ b/Makefile
@@ -9,12 +9,19 @@ builds/finalize.romfs: builds
@3dstool -c -t romfs --romfs-dir romfs --file $@
builds/x_finalize_helper.firm: builds/finalize.romfs
- @cp finalize_helper.gm9 GodMode9/data/autorun.gm9
- @sed -i s/FINALIZE_SHA256SUM/$(shell sha256sum $< | awk '{print $$1}')/g GodMode9/data/autorun.gm9
- @$(MAKE) -C GodMode9 SCRIPT_RUNNER=1
+ @cp finalize.lua GodMode9/data/autorun.lua
+ @cp data/language_select.png GodMode9/data/
+ @cp -r data/lang GodMode9/data/
+ @cp -r data/luapackages GodMode9/data/
+ @sha256sum $< | awk '{print $$1}' > GodMode9/data/finalize-romfs-hash
+ @$(MAKE) -C GodMode9 SCRIPT_RUNNER=1 AUTO_UNLOCK=1
@cp GodMode9/output/GodMode9.firm $@
@printf '\001' | dd conv=notrunc bs=1 seek=16 of=$@
clean:
@rm -rf builds
@$(MAKE) -C GodMode9 clean
- @rm GodMode9/data/autorun.gm9
+ @rm GodMode9/data/autorun.lua
+ @rm GodMode9/data/finalize-romfs-hash
+ @rm GodMode9/data/language_select.png
+ @rm -rf GodMode9/data/lang
+ @rm -rf GodMode9/data/luapackages/finalizeUtil.lua
diff --git a/README.md b/README.md
index e078ae7..a9acfb4 100644
--- a/README.md
+++ b/README.md
@@ -3,15 +3,14 @@
Scripts relating to Finalizing Setup on https://3ds.hacks.guide/finalizing-setup.
- [`/romfs/finalize/`](romfs/finalize): Files that are packed into `finalize.romfs`
- - [`/romfs/finalize/img`](romfs/finalize/img): Images used for visual troubleshooting
- - [`/romfs/finalize/finalize.gm9`](romfs/finalize/finalize.gm9): Script run after `finalize_helper.gm9` that:
- - Installs base homebrew applications to SYSNAND SD (see below for list)
- - Copies GodMode9 to CTRNAND (`/rw/luma/payloads`)
- - Backs up `essential.exefs` to `/gm9/backups`
- - Deletes CFW installation files that are no longer necessary
- - Backs up minsize NAND backup to `/gm9/backups`
- - `/romfs/finalize/donor.db`: Empty title database used for consoles that do not have title database (i.e. no eShop software)
-- [`finalize_helper.gm9`](finalize_helper.gm9): Script that is compiled as GM9 scriptrunner (`finalize_helper.firm`); extracts `finalize.romfs`
+ - [`/romfs/finalize/img`](romfs/finalize/img): Images used for visual troubleshooting
+ - [`/romfs/finalize/donor.db`](romfs/finalize/donor.db): Empty title database used for consoles that do not have title database (i.e. no eShop software)
+- [`finalize_helper.lua`](finalize_helper.lua): Lua script that is compiled as GM9 scriptrunner (`x_finalize_helper.firm`) that:
+ - Installs base homebrew applications to SYSNAND SD (see below for list)
+ - Copies all payloads inside `/luma/payloads` on the SD card to CTRNAND (`/rw/luma/payloads`)
+ - Backs up `essential.exefs` to `/gm9/backups`
+ - Deletes CFW installation files that are no longer necessary
+ - Backs up minsize NAND backup to `/gm9/backups`
- [`docs.md`](docs.md): Full error information / script documentation
## Bundled software
@@ -32,7 +31,7 @@ Releases are tagged for reference (based on usage in the guide). **Releases in t
### Automatically built binaries
-Binaries are automatically built by [GitHub Actions](https://github.com/hacks-guide/finalize/actions/). Place `finalize_helper.firm` in `/luma/payloads/` and `finalize.romfs` on root of SD.
+Binaries are automatically built by [GitHub Actions](https://github.com/hacks-guide/finalize/actions/). Place `x_finalize_helper.firm` in `/luma/payloads/` and `finalize.romfs` on root of SD.
### Manual file placement
diff --git a/data/lang/en_US.json b/data/lang/en_US.json
new file mode 100644
index 0000000..76792a8
--- /dev/null
+++ b/data/lang/en_US.json
@@ -0,0 +1,11 @@
+{
+ "INIT_MESSAGE": "The Finalizing Setup Script is now starting...",
+ "ASK_FOR_HELP": "If this error persists, ask for help\non Discord: https://discord.gg/MWxPgEp",
+
+ "ERROR_00": "Error #00: Build error\nYou have encountered an error\nthat should only occur if the script\nwas built incorrectly.",
+ "ERROR_04": "Error #04: No space\n \nInsufficient space on SD card.\nYou need %s, but you have %s.\nMake some space, then try again.\n \nTIP: You can temporarily remove the Nintendo 3DS\nand DCIM folders from your SD card\nto make enough space.",
+ "ERROR_21": "Error #21: finalize.romfs not found\n \nfinalize.romfs could not be found on the SD card.\nCopy it to root of SD and try again.",
+ "ERROR_22": "Error #22: finalize.romfs is invalid\n \nThe file finalize.romfs is corrupt or unreadable.\nRe-download it, copy it to root of SD, and try again.\n \nExpected: %s\n \nReceived: %s",
+ "INFO_23" : "Information #23: finalize.romfs in wrong location\n \nfinalize.romfs is in the wrong location.\nThis script will attempt to move it.\nPlease hit on the next few prompts.",
+ "ERROR_26": "Error #26: SD card not mounted.\n \nThis should not be possible."
+}
\ No newline at end of file
diff --git a/data/language_select.png b/data/language_select.png
new file mode 100644
index 0000000..cbc20be
Binary files /dev/null and b/data/language_select.png differ
diff --git a/data/luapackages/finalizeUtil.lua b/data/luapackages/finalizeUtil.lua
new file mode 100644
index 0000000..bc52f41
--- /dev/null
+++ b/data/luapackages/finalizeUtil.lua
@@ -0,0 +1,11 @@
+local finalizeUtil = {}
+
+function finalizeUtil.error(text, image, powerOff)
+ ui.show_png("9:/finalize/img/" .. image .. ".png")
+ ui.echo(text)
+ if powerOff then
+ sys.power_off()
+ end
+end
+
+return finalizeUtil
\ No newline at end of file
diff --git a/finalize.lua b/finalize.lua
new file mode 100644
index 0000000..01ddbc9
--- /dev/null
+++ b/finalize.lua
@@ -0,0 +1,158 @@
+--[[
+Script for https://3ds.hacks.guide/finalizing-setup
+This script is not intended be run manually.
+Credits have been moved to within the script's optional menu.
+--]]
+local scriptVersion = "2.0.0"
+local lastModified = "2025-07-30"
+local json = require('json')
+local finalizeUtil = require('finalizeUtil')
+local finalizeRomfs = "0:/finalize.romfs"
+
+local langCodes = {
+ English="en_US"
+}
+
+ui.show_png(CURRDIR .. "/language_select.png")
+
+local languageNames = {}
+for i, v in pairs(langCodes) do
+ table.insert(languageNames, i)
+end
+
+local userSelection = ui.ask_selection("", languageNames)
+if not userSelection then
+ sys.power_off()
+end
+local languageSel = languageNames[userSelection]
+local langCode = langCodes[languageSel]
+
+-- Load temporary locale file, complete one is stored in finalize.romfs because all of the locales don't fit in VRAM
+local tempLangPath = CURRDIR .. "/lang/" .. langCode .. ".json"
+local lang = json.decode(fs.read_file(tempLangPath, 0, fs.stat(tempLangPath).size))
+
+ui.show_text(lang["INIT_MESSAGE"])
+
+if not fs.sd_is_mounted() then
+ ui.echo(string.format("%s\n \n%s", lang["ERROR_26"], lang["ASK_FOR_HELP"]))
+ sys.power_off()
+end
+
+local write = "0:/WRITE"
+pcall(fs.remove, write)
+local success = pcall(fs.make_dummy_file, write, 0x400)
+if not success then
+ ui.echo(string.format("%s\n \n%s", lang["ERROR_25"], lang["ASK_FOR_HELP"]))
+ sys.power_off()
+end
+pcall(fs.remove, write)
+
+local romfsCheckDirectoryList = {"0:", "0:/3ds", "0:/luma/payloads", "0:/luma", "0:/DCIM"}
+local filenameMatchList = {"finalize.romfs", "finalize(*).romfs", "finalize (*).romfs"}
+for _,dir in ipairs(romfsCheckDirectoryList) do
+ for _,filename in ipairs(filenameMatchList) do
+ local success, filesFound = pcall(fs.find_all, dir, filename)
+ if success then
+ for _,path in ipairs(filesFound) do
+ if path ~= "0:/finalize.romfs" then
+ pcall(fs.remove, "0:/finalize.romfs")
+ pcall(fs.move, path, finalizeRomfs, {no_cancel = true, silent = true, overwrite = true})
+ end
+ end
+ end
+ end
+end
+for _,filename in ipairs(filenameMatchList) do
+ local success, filesFound = pcall(fs.find_all, "0:/Nintendo 3DS/", filename)
+ if success then
+ for _,path in ipairs(filesFound) do
+ ui.echo(lang["INFO_23"])
+ pcall(fs.move, "0:/Nintendo 3DS/" .. path, finalizeRomfs, {no_cancel = true, silent = true, overwrite = true})
+ end
+ end
+end
+
+if not fs.exists("0:/finalize.romfs") then
+ ui.echo(lang["ERROR_21"])
+ sys.power_off()
+end
+
+local success, expectedHash = pcall(fs.read_file, CURRDIR.."/finalize-romfs-hash", 0, 64)
+if not success then
+ ui.echo(string.format("%s\n \n%s\nfinalize romfs hash file does not exist", lang["ERROR_00"], lang["ASK_FOR_HELP"]))
+ sys.power_off()
+end
+
+local success, result = pcall(fs.hash_file, finalizeRomfs, 0, 0)
+if not success then
+ ui.echo(string.format(lang["ERROR_22"], expectedHash, "hash failed"))
+ sys.power_off()
+end
+local gotHash = util.bytes_to_hex(result)
+
+if gotHash ~= expectedHash then
+ ui.echo(string.format(lang["ERROR_22"], expectedHash, gotHash))
+ sys.power_off()
+end
+
+local success, result = pcall(fs.img_mount, finalizeRomfs)
+if not success then
+ ui.echo(string.format(lang["ERROR_22"], expectedHash, gotHash) .. "\nImage mount failed... somehow?")
+ sys.power_off()
+end
+
+local success, result = pcall(fs.copy, "G:/finalize", "9:/finalize", {overwrite=true, recursive=true, silent=true})
+if not success then
+ ui.echo(string.format(lang["ERROR_22"], expectedHash, gotHash) .. "\nCopying to RAM failed... somehow?")
+ sys.power_off()
+end
+
+-- We're done with finalize.romfs now
+fs.img_umount()
+
+
+-- New locale files can now be mounted, some finalizeUtil functions become usable too.
+local newLangPath = "9:/finalize/lang/" .. langCode .. ".json"
+lang = json.decode(fs.read_file(newLangPath, 0, fs.stat(newLangPath).size))
+
+-- Check for missing essentials
+-- BuildEssentialBackup() will return 1 (failure) if any of these files are missing. As well as nand_hdr.bin, but like lol
+local missingEssential = ""
+
+if not (fs.find("1:/rw/sys/SecureInfo_A") or fs.find("1:/rw/sys/SecureInfo_B")) then
+ missingEssential = missingEssential .. "SecureInfo\n"
+end
+
+if not (fs.find("1:/rw/sys/LocalFriendCodeSeed_B") or fs.find("1:/rw/sys/LocalFriendCodeSeed_A")) then
+ missingEssential = missingEssential .. "LocalFriendCodeSeed\n"
+end
+
+if not fs.find("1:/private/movable.sed") then
+ missingEssential = missingEssential .. "movable.sed\n"
+end
+
+-- Check for essential.exefs, create if doesn't exist
+
+local success = sys.check_embedded_backup()
+if (not success) or (not fs.find("S:/essential.exefs")) then
+ if missingEssential ~= "" then
+ finalizeUtil.error(string.format(lang["ERROR_30"], missingEssential) .. "\n \n" .. lang["ASK_FOR_HELP"], "error30", true)
+ else
+ finalizeUtil.error(lang["ERROR_02"], "error02", true)
+ end
+end
+
+local minBytes
+if CONSOLE_TYPE == "O3DS" then
+ minBytes = (1024 ^ 3)
+else
+ minBytes = (1024 ^ 3) * 1.4
+end
+local bytesFree = fs.stat_fs("0:/").free
+if bytesFree < minBytes then
+ finalizeUtil.error(string.format(lang["ERROR_04"], ui.format_bytes(minBytes), ui.format_bytes(bytesFree)), "error04", true)
+end
+
+
+ui.echo("The script finished without errors.\n(This script is still in development)")
+sys.power_off()
\ No newline at end of file
diff --git a/finalize_helper.gm9 b/finalize_helper.gm9
deleted file mode 100644
index 2c96350..0000000
--- a/finalize_helper.gm9
+++ /dev/null
@@ -1,97 +0,0 @@
-# Scriptrunner for https://3ds.hacks.guide/finalizing-setup file copying operations
-# Ver. 1.10.2 - Last modified: 2025-04-14
-
-set PREVIEW_MODE "Finalizing Setup Helper Script\n> Copying SD files..."
-
-set WRITE 0:/WRITE
-rm -o -s $[WRITE]
-if fdummy $[WRITE] 400
- rm -o -s $[WRITE]
-else
- set PREVIEW_MODE "Finalizing Setup Helper Script\n> Copying SD files... :("
- echo "Error #24: SD is write-protected\n \nYour SD card is set to read-only.\nEnsure that the lock switch is flipped\nin the upright position.\nOtherwise, your SD card may be failing.\n \nIf this error persists, ask for help\non Discord: https://discord.gg/MWxPgEp"
- poweroff
-end
-
-if find -f "0:/finalize (*).romfs" ROMFS
- cp -w -o -s $[ROMFS] 0:/finalize.romfs
- rm -o -s $[ROMFS]
-end
-
-if find -f "0:/3ds/finalize (*).romfs" ROMFS
- cp -w -o -s $[ROMFS] 0:/finalize.romfs
- rm -o -s $[ROMFS]
-end
-
-if find -f "0:/luma/payloads/finalize (*).romfs" ROMFS
- cp -w -o -s $[ROMFS] 0:/finalize.romfs
- rm -o -s $[ROMFS]
-end
-
-if find -f "0:/luma/finalize (*).romfs" ROMFS
- cp -w -o -s $[ROMFS] 0:/finalize.romfs
- rm -o -s $[ROMFS]
-end
-
-if find -f "0:/DCIM/finalize (*).romfs" ROMFS
- cp -w -o -s $[ROMFS] 0:/finalize.romfs
- rm -o -s $[ROMFS]
-end
-
-if find -f "0:/Nintendo 3DS/finalize (*).romfs" ROMFS
- echo "Information #23: finalize.romfs in wrong location\n \nfinalize.romfs is in the wrong location.\nThis script will attempt to move it.\nPlease hit on the next few prompts."
- cp -w -o -s $[ROMFS] 0:/finalize.romfs
- rm -o -s $[ROMFS]
-end
-
-if find 0:/3ds/finalize.romfs NULL
- cp -w -o -s 0:/3ds/finalize.romfs 0:/finalize.romfs
- rm -o -s 0:/3ds/finalize.romfs
-end
-
-if find 0:/luma/payloads/finalize.romfs NULL
- cp -w -o -s 0:/luma/payloads/finalize.romfs 0:/finalize.romfs
- rm -o -s 0:/luma/payloads/finalize.romfs
-end
-
-if find 0:/luma/finalize.romfs NULL
- cp -w -o -s 0:/luma/finalize.romfs 0:/finalize.romfs
- rm -o -s 0:/luma/finalize.romfs
-end
-
-if find 0:/DCIM/finalize.romfs NULL
- cp -w -o -s 0:/DCIM/finalize.romfs 0:/finalize.romfs
- rm -o -s 0:/DCIM/finalize.romfs
-end
-
-if find "0:/Nintendo 3DS/finalize.romfs" NULL
- echo "Information #23: finalize.romfs in wrong location\n \nfinalize.romfs is in the wrong location.\nThis script will attempt to move it.\nPlease hit on the next few prompts."
- cp -w -o -s "0:/Nintendo 3DS/finalize.romfs" 0:/finalize.romfs
- rm -o -s "0:/Nintendo 3DS/finalize.romfs"
-end
-
-if not find 0:/finalize.romfs NULL
- set PREVIEW_MODE "Finalizing Setup Helper Script\n> Copying SD files... :("
- echo "Error #21: finalize.romfs not found\n \nfinalize.romfs could not be found on the SD card.\nCopy it to root of SD and try again."
- poweroff
-end
-
-if not sha 0:/finalize.romfs FINALIZE_SHA256SUM
- shaget 0:/finalize.romfs ACTUAL_SHA256SUM
- set PREVIEW_MODE "Finalizing Setup Helper Script\n> Copying SD files... :("
- echo "Error #22: finalize.romfs is invalid\n \nThe file finalize.romfs is corrupt or unreadable.\nRe-download it, copy it to root of SD, and try again.\n \nExpected: FINALIZE_SHA256SUM\nReceived: $[ACTUAL_SHA256SUM]"
- poweroff
-else
- imgmount 0:/finalize.romfs
- cp -w -o -s G:/finalize/GodMode9.firm 0:/luma/payloads/GodMode9.firm
- if not find 0:/gm9/scripts NULL
- mkdir 0:/gm9/scripts
- end
- cp -w -o -s G:/finalize/finalize.gm9 0:/gm9/scripts/finalize.gm9
- imgumount
-end
-
-if not boot 0:/luma/payloads/GodMode9.firm
- echo "Error #25: Could not boot GodMode9\n \nThis normally happens due to insufficient SD space.\nPlease make at least 20MB of free space."
- poweroff
-end
diff --git a/romfs/finalize/finalize.gm9 b/romfs/finalize/finalize.gm9
deleted file mode 100644
index 0c5f251..0000000
--- a/romfs/finalize/finalize.gm9
+++ /dev/null
@@ -1,582 +0,0 @@
-# Script for https://3ds.hacks.guide/finalizing-setup
-# Ver. 1.10.2 - Last modified: 2025-04-14
-# GodMode9 scripts can be dangerous!
-# Visit https://github.com/hacks-guide/finalize/releases to verify the integrity of this script.
-# Credits: GM9Megascript contributors ("Scripts from Plailect's Guide"), Mr. Burguers (SD card capacity check), ihaveamac (title.db stuff), J0n_b0 (MSET9 check), Naim2000 (better Nintendo 3DS folder check)
-
-rm -o -s 0:/luma/payloads/finalize_helper.firm
-for 0:/luma/payloads *_finalize_helper.firm
- rm -o -s $[FORPATH]
-next
-
-set PREVIEW_MODE "> Checking for problems...\nAsking for permission... ---\nInstalling homebrew... ---\nCopying GodMode9 to CTRNAND... ---\nCleaning up SD card... ---\nBacking up essential.exefs... ---\nBacking up NAND... ---"
-
-# First order of business - Grab a hold of finalize.romfs
-if not find G:/finalize/finalize.gm9 NULL
- if not find 0:/finalize.romfs ROMFS
- set PREVIEW_MODE "> Checking for problems... :(\nAsking for permission... ---\nInstalling homebrew... ---\nCopying GodMode9 to CTRNAND... ---\nCleaning up SD card... ---\nBacking up essential.exefs... ---\nBacking up NAND... ---"
- echo "Error #21: finalize.romfs not found\n \nfinalize.romfs could not be found on the SD card.\nCopy it to root of SD and try again."
- poweroff
- end
-
- if not shaget $[ROMFS] ROMFS_SHA256
- set PREVIEW_MODE "> Checking for problems... :(\nAsking for permission... ---\nInstalling homebrew... ---\nCopying GodMode9 to CTRNAND... ---\nCleaning up SD card... ---\nBacking up essential.exefs... ---\nBacking up NAND... ---"
- echo "Error #22: finalize.romfs is unreadable\n \nCould not read finalize.romfs.\n(How did this happen..? Did it get corrupt?)\n\nCopy finalize.romfs to your SD card and try again."
- poweroff
- end
-
- if not imgmount $[ROMFS]
- set PREVIEW_MODE "> Checking for problems... :(\nAsking for permission... ---\nInstalling homebrew... ---\nCopying GodMode9 to CTRNAND... ---\nCleaning up SD card... ---\nBacking up essential.exefs... ---\nBacking up NAND... ---"
- echo "Error #22: Failed to mount finalize.romfs\n\nCould not mount finalize.romfs.\n(How did this happen..? Did it get corrupt?)\n\nCopy finalize.romfs to your SD card and try again."
- poweroff
- end
-end
-
-# Copy finalize files to RAMDRIVE
-if not cp -w -s G:/finalize 9:/finalize
- # WHAT????
- set PREVIEW_MODE "> Checking for problems... :(\nAsking for permission... ---\nInstalling homebrew... ---\nCopying GodMode9 to CTRNAND... ---\nCleaning up SD card... ---\nBacking up essential.exefs... ---\nBacking up NAND... ---"
- echo "Error #22: finalize.romfs is unreadable\n \nCould not copy files from finalize.romfs.\n(How did this happen..? Did it get corrupt?)\n\nCopy finalize.romfs to your SD card and try again."
- poweroff
-end
-
-# We're done with finalize.romfs now
-imgumount
-
-# Check for missing essentials
-# BuildEssentialBackup() will return 1 (failure) if any of these files are missing. As well as nand_hdr.bin, but like lol
-
-set MISSINGESSENTIAL ""
-set SEED ""
-
-if find -s 1:/rw/sys/SecureInfo_A NULL
-elif find -s 1:/rw/sys/SecureInfo_B NULL
-else
- set MISSINGESSENTIAL "$[MISSINGESSENTIAL]SecureInfo\n" # Does GodMode9 support \t
-end
-
-if find -s 1:/rw/sys/LocalFriendCodeSeed_B NULL
-elif find -s 1:/rw/sys/LocalFriendCodeSeed_A NULL
-else
- set MISSINGESSENTIAL "$[MISSINGESSENTIAL]LocalFriendCodeSeed\n"
-end
-
-if find -s 1:/private/movable.sed SEED
-else
- set MISSINGESSENTIAL "$[MISSINGESSENTIAL]movable.sed\n"
-end
-
-# Check for missing essential.exefs
-
-if not find S:/essential.exefs NULL
- if chk -u $[MISSINGESSENTIAL] ""
- set PREVIEW_MODE "9:/finalize/img/error30.png"
- echo "Fatal Error #30: Missing console-unique files\n \nThe following files are missing from the NAND:\n$[MISSINGESSENTIAL]\n \nAsk for help on Discord:\nhttps://discord.gg/MWxPgEp"
- poweroff
- else
- set PREVIEW_MODE "9:/finalize/img/error02.png"
- echo "Error #02: Missing essential.exefs\n \nessential.exefs does not exist.\nClose and re-open GodMode9,\nmaking sure to say Yes to the\n'Create essential files' popup."
- poweroff
- end
-end
-
-# Check for missing Nintendo 3DS folder
-
-if not find "0:/Nintendo 3DS" NULL
- if find 0:/gm9/flags/BACKUPFLAG NULL
- goto BACKUPDUPE
- end
- goto NOSPACE
-end
-
-# Okay, at this point, we have the Nintendo 3DS folder. But do we have A: ?
-
-@IS_SYSNAND_SD_OK
-
-if isdir A:
- goto SYSNAND_SD_OK
-end
-
-# We don't. Why not?
-
-if not shaget $[SEED]@110:10 NULL # This should end up failing normally if SEED is "". I'd hope. Someone test this.
- set PREVIEW_MODE "9:/finalize/img/error31.png"
- echo "Fatal Error #31: Missing encryption key\n \nThe system is missing movable.sed from NAND.\n(How did this happen...?)\n \nAsk for help on Discord:\nhttps://discord.gg/MWxPgEp"
- # At this stage, we have essential.exefs.
- # I could copy it. But how do we know that this isn't like, a failed/cancelled Manual Movable Moveover? The user might have been doing something.
- poweroff
-end
-
-# Okay, we have an ID0. Is it there?
-
-if not find "0:/Nintendo 3DS/$[SYSID0]" SYSID0PATH
- if find 0:/gm9/flags/nospace NULL
- goto NOSPACE
- end
-
- set PREVIEW_MODE "9:/finalize/img/error33.png"
- echo "Information #33: Empty Nintendo 3DS folder\n \nThe Nintendo 3DS folder has no data for this console.\nTurn on your console with the SD inserted,\nallow it to reach the HOME Menu, then run\nthis script again."
- reboot
-end
-
-# Check for and attempt to fix edited MSET9 ID1
-
-if find "$[SYSID0PATH]/????????????????????????????????_user-id1" CURRENT
- set PREVIEW_MODE "9:/finalize/img/error18a.png"
- echo "Error #18a: MSET9 detected\n \nID1 still affected by MSET9.\nAttempting to fix it.\n \nPress (A) to continue, then\nenter the key combo if prompted."
- allow "0:/Nintendo 3DS"
- strsplit -b REAL $[CURRENT] "_"
- if not mv $[CURRENT] $[REAL]
- set PREVIEW_MODE "9:/finalize/img/error19a.png"
- echo "Fatal Error #19a: Could not remove MSET9\n \nFailed to rename ID1.\nPlease remove MSET9 manually.\nIf you continue to see this prompt,\nask for help on Discord:\nhttps://discord.gg/MWxPgEp"
- poweroff
- end
- if find "$[SYSID0PATH]/*sdmc*b9" MSET9ID1
- if not rm -s $[MSET9ID1]
- set PREVIEW_MODE "9:/finalize/img/error19b.png"
- echo "Fatal Error #19b: Could not remove MSET9\n \nFailed to remove hax'd ID1.\nPlease remove MSET9 manually.\nIf you continue to see this prompt,\nask for help on Discord:\nhttps://discord.gg/MWxPgEp"
- poweroff
- end
- end
- set FIXEDMSET9 YES
-end
-
-# Check for and attempt to delete hax'd MSET9
-
-if find "$[SYSID0PATH]/*sdmc*b9" MSET9ID1
- set PREVIEW_MODE "9:/finalize/img/error18b.png"
- echo "Error #18b: MSET9 detected\n \nMSET9 hax'd ID1 is still present.\n \nAttempting to fix it.\n \nPress (A) to continue, then\nenter the key combo if prompted."
- allow "0:/Nintendo 3DS"
- if not rm -s $[MSET9ID1]
- set PREVIEW_MODE "9:/finalize/img/error19b.png"
- echo "Fatal Error #19b: Could not remove MSET9\n \nFailed to remove hax'd ID1.\nPlease remove MSET9 manually.\nIf you continue to see this prompt,\nask for help on Discord:\nhttps://discord.gg/MWxPgEp"
- poweroff
- end
- set FIXEDMSET9 YES
-end
-
-# Eject and reinsert SD to mount SYSNAND SD
-
-if chk $[FIXEDMSET9] YES
- set PREVIEW_MODE "9:/finalize/img/mset9_reinsert.png"
- switchsd "MSET9 has been removed.\n \nEject and reinsert your SD card to continue."
- goto IS_SYSNAND_SD_OK
-end
-
-# SYSID0 path exists at this point, yet not SYSNAND SD. Why?
-
-set PREVIEW_MODE "9:/finalize/img/error32.png"
-echo "Fatal Error #32: Nintendo 3DS folder is inaccessible\n \nCould not access the Nintendo 3DS folder.\n(How did this happen..?)\n \nAsk for help on Discord:\nhttps://discord.gg/MWxPgEp"
-poweroff
-
-@SYSNAND_SD_OK
-
-# Check for sufficient SD space
-
-if find 0:/gm9/flags/BACKUPFLAG NULL
- goto SDFREE_NEXT
-end
-
-if chk $[SDFREE] INVALID # should not happen
- set PREVIEW_MODE "9:/finalize/img/error07.png"
- echo "Fatal Error #07: No SD size\n \nCould not get SD card size.\nThis should not happen.\nAsk for help on Discord:\nhttps://discord.gg/MWxPgEp"
-else
- strsplit -f -b SDFREE_VALUE $[SDFREE] " "
- strsplit -f SDFREE_UNITS $[SDFREE] " "
- if chk $[SDFREE_UNITS] GB
- if chk $[ONTYPE] O3DS
- goto SDFREE_NEXT
- end
- strsplit -f -b SDFREE_VALUE_1 $[SDFREE_VALUE] .
- strsplit -f SDFREE_VALUE_2 $[SDFREE_VALUE] .
- if chk -u $[SDFREE_VALUE_1] 1
- goto SDFREE_NEXT
- end
- if chk $[SDFREE_VALUE_2] 0
- elif chk $[SDFREE_VALUE_2] 1
- elif chk $[SDFREE_VALUE_2] 2
- elif chk $[SDFREE_VALUE_2] 3
- else
- goto SDFREE_NEXT
- end
- end
- if not find 0:/gm9/flags NULL
- mkdir -o -s 0:/gm9/flags
- end
- fdummy -o -s 0:/gm9/flags/nospace 400
- if chk $[ONTYPE] O3DS
- set PREVIEW_MODE "9:/finalize/img/error04.png"
- echo "Error #04: No space\n \nInsufficient space on SD card.\nYou need 1.0GB, but you have $[SDFREE].\nMake some space, then try again.\n \nTIP: You can temporarily remove the Nintendo 3DS\nand DCIM folders from your SD card\nto make enough space."
- else
- set PREVIEW_MODE "9:/finalize/img/error04.png"
- echo "Error #04: No space\n \nInsufficient space on SD card.\nYou need 1.4GB, but you have $[SDFREE].\nMake some space, then try again.\n \nTIP: You can temporarily remove the Nintendo 3DS\nand DCIM folders from your SD card\nto make enough space."
- end
-end
-poweroff
-
-@SDFREE_NEXT
-
-# If INSTALLFLAG exists, show setup message that skips CIA install
-
-if find 0:/gm9/flags/INSTALLFLAG NULL
- set PREVIEW_MODE "Checking for problems... DONE\n> Asking for permission...\nInstalling homebrew... SKIP\nCopying GodMode9 to CTRNAND... ---\nCleaning up SD card... ---\nBacking up essential.exefs... ---\nBacking up NAND... ---"
- ask "This script will do the following:\n- Copy GodMode9 to CTRNAND\n- Remove unnecessary SD files\n- Create an essential.exefs backup\n- Create a NAND backup (~1GB)\n \nThis script may take up to\nfifteen minutes to complete.\n \nIf you're okay with this,\npress (A) to continue."
- allow 1:
- goto INSTALL_NEXT
-end
-
-# Check for title database
-
-if not find A:/dbs/title.db NULL
- set PREVIEW_MODE "9:/finalize/img/error05.png"
- ask "Information #05: No title database\n \nTitle database not found.\nPress (A) to automatically import one.\n(A title database is necessary\nfor this script to run.)"
- goto IMPORT
-end
-
-if not imgmount A:/dbs/title.db
- set PREVIEW_MODE "9:/finalize/img/error16.png"
- if ask "Error #16: Title database mount fail\n \nTitle database exists, but could not\nbe accessed.\n \nAttempt donor import?\n(If you have anything installed on\nthis console, this may result in\ninstalled digital games being rendered\n INACCESSIBLE!)"
- goto IMPORT
- else
- poweroff
- end
-end
-
-goto MAIN
-
-@IMPORT
-
-mkdir -o -s A:/dbs
-
-if not cp -w -o -s 9:/finalize/donor.db A:/dbs/title.db
- set PREVIEW_MODE "9:/finalize/img/error12a.png"
- echo "Error #12a: Copy title.db fail\n \nTitle database could not be copied to A:/dbs.\n(Is your SD card locked?)\n \nAsk for help on Discord:\nhttps://discord.gg/MWxPgEp"
- poweroff
-end
-
-if not cp -w -o -s 9:/finalize/donor.db A:/dbs/import.db
- set PREVIEW_MODE "9:/finalize/img/error12b.png"
- echo "Error #12b: Copy import.db fail\n \nTitle database could not be copied to A:/dbs.\n(Is your SD card locked?)\n \nAsk for help on Discord:\nhttps://discord.gg/MWxPgEp"
- poweroff
-end
-
-if not fixcmac A:/dbs/title.db
- set PREVIEW_MODE "9:/finalize/img/error13a.png"
- echo "Fatal Error #13a: Fix CMAC fail\n \nCMACs could not be fixed for title database.\n(How did this happen?)\n \nAsk for help on Discord:\nhttps://discord.gg/MWxPgEp"
- poweroff
-end
-
-if not fixcmac A:/dbs/import.db
- set PREVIEW_MODE "9:/finalize/img/error13b.png"
- echo "Fatal Error #13b: Fix CMAC fail\n \nCMACs could not be fixed for title database.\n(How did this happen?)\n \nAsk for help on Discord:\nhttps://discord.gg/MWxPgEp"
- poweroff
-end
-
-
-
-@MAIN
-
-# Ask for consent here
-
-set PREVIEW_MODE "Checking for problems... DONE\n> Asking for permission...\nInstalling homebrew... ---\nCopying GodMode9 to CTRNAND... ---\nCleaning up SD card... ---\nBacking up essential.exefs... ---\nBacking up NAND... ---"
-
-ask "This script will do the following:\n- Install base homebrew applications\n- Copy GodMode9 to CTRNAND\n- Remove unnecessary SD files\n- Create an essential.exefs backup\n- Create a NAND backup (~1GB)\n \nThis script may take up to\nfifteen minutes to complete.\n \nIf you're okay with this,\npress (A) to continue."
-allow 1:
-
-set PREVIEW_MODE "Checking for problems... DONE\nAsking for permission... DONE\n> Installing homebrew...\nCopying GodMode9 to CTRNAND... ---\nCleaning up SD card... ---\nBacking up essential.exefs... ---\nBacking up NAND... ---"
-
-# Install base homebrew applications
-# Can't be issues with the copy anymore...
-
-if not install 9:/finalize/Anemone3DS.cia
- set PREVIEW_MODE "9:/finalize/img/error14a.png"
- echo "Error #14a: CIA install fail\n \nA CIA (Anemone3DS) failed to install.\n \nAsk for help on Discord: https://discord.gg/MWxPgEp"
- poweroff
-end
-
-if not install 9:/finalize/Checkpoint.cia
- set PREVIEW_MODE "9:/finalize/img/error14b.png"
- echo "Error #14b: CIA install fail\n \nA CIA (Checkpoint) failed to install.\n \nAsk for help on Discord: https://discord.gg/MWxPgEp"
- poweroff
-end
-
-if not install 9:/finalize/FBI.cia
- set PREVIEW_MODE "9:/finalize/img/error14c.png"
- echo "Error #14c: CIA install fail\n \nA CIA (FBI) failed to install.\n \nAsk for help on Discord: https://discord.gg/MWxPgEp"
- poweroff
-end
-
-if not install 9:/finalize/ftpd.cia
- set PREVIEW_MODE "9:/finalize/img/error14d.png"
- echo "Error #14d: CIA install fail\n \nA CIA (ftpd) failed to install.\n \nAsk for help on Discord: https://discord.gg/MWxPgEp"
- poweroff
-end
-
-if not install 9:/finalize/Homebrew_Launcher.cia
- set PREVIEW_MODE "9:/finalize/img/error14e.png"
- echo "Error #14e: CIA install fail\n \nA CIA (Homebrew Launcher) failed to install.\n \nAsk for help on Discord: https://discord.gg/MWxPgEp"
- poweroff
-end
-
-if not install 9:/finalize/Universal-Updater.cia
- set PREVIEW_MODE "9:/finalize/img/error14f.png"
- echo "Error #14f: CIA install fail\n \nA CIA (Universal-Updater) failed to install.\n \nAsk for help on Discord: https://discord.gg/MWxPgEp"
- poweroff
-end
-
-set PREVIEW_MODE "Checking for problems... DONE\nAsking for permission... DONE\nInstalling homebrew... DONE\n> Copying GodMode9 to CTRNAND...\nCleaning up SD card... ---\nBacking up essential.exefs... ---\nBacking up NAND... ---"
-
-@INSTALL_NEXT
-
-if find 0:/gm9/flags/INSTALLFLAG NULL
- set PREVIEW_MODE "Checking for problems... DONE\nAsking for permission... DONE\nInstalling homebrew... SKIP\n> Copying GodMode9 to CTRNAND...\n> Cleaning up SD card...\nBacking up essential.exefs... ---\nBacking up NAND... ---"
-end
-
-# Copy GodMode9 to CTRNAND
-
-cp -w -o -s 0:/luma/payloads 1:/rw/luma/payloads
-
-# Delete Finalizing Setup Helper on CTRNAND if it exists
-
-rm -o -s 1:/rw/luma/payloads/finalize_helper.firm
-for 1:/rw/luma/payloads *_finalize_helper.firm
- rm -o -s $[FORPATH]
-next
-
-set PREVIEW_MODE "Checking for problems... DONE\nAsking for permission... DONE\nInstalling homebrew... DONE\nCopying GodMode9 to CTRNAND... DONE\n> Cleaning up SD card...\nBacking up essential.exefs... ---\nBacking up NAND... ---"
-
-if find 0:/gm9/flags/INSTALLFLAG NULL
- set PREVIEW_MODE "Checking for problems... DONE\nAsking for permission... DONE\nInstalling homebrew... SKIP\nCopying GodMode9 to CTRNAND... ---\n> Cleaning up SD card...\nBacking up essential.exefs... ---\nBacking up NAND... ---"
-end
-
-# Remove unnecessary SD files
-
-## A9LH to B9S / Updating B9S
-
-rm -o -s 0:/arm9loaderhax.bin
-rm -o -s 0:/arm9loaderhax_si.bin
-rm -o -s 0:/luma/payloads/SafeB9SInstaller.bin
-rm -o -s 0:/luma/payloads/Decrypt9WIP.bin
-rm -o -s 0:/luma/payloads/Hourglass9.bin
-rm -o -s 0:/luma/payloads/GodMode9.bin
-rm -o -s 0:/boot9strap/secret_sector.bin
-
-## General
-
-rm -o -s 0:/SafeB9SInstaller.bin
-rm -o -s 0:/boot9strap/boot9strap.firm
-rm -o -s 0:/boot9strap/boot9strap.firm.sha
-
-## Soundhax
-
-rm -o -s 0:/soundhax-chn-o3ds-post5.0.m4a
-rm -o -s 0:/soundhax-chn-o3ds-v3.xand4.x.m4a
-rm -o -s 0:/soundhax-eur-n3ds.m4a
-rm -o -s 0:/soundhax-eur-o3ds-post5.0.m4a
-rm -o -s 0:/soundhax-eur-o3ds-pre2.1.m4a
-rm -o -s 0:/soundhax-eur-o3ds-v2.1and2.2.m4a
-rm -o -s 0:/soundhax-eur-o3ds-v3.xand4.x.m4a
-rm -o -s 0:/soundhax-eur-o3ds-pre2.1-post5franken.m4a
-rm -o -s 0:/soundhax-eur-o3ds-v2.1and2.2-post5franken.m4a
-rm -o -s 0:/soundhax-jpn-n3ds.m4a
-rm -o -s 0:/soundhax-jpn-o3ds-post5.0.m4a
-rm -o -s 0:/soundhax-jpn-o3ds-pre2.1.m4a
-rm -o -s 0:/soundhax-jpn-o3ds-v2.1and2.2.m4a
-rm -o -s 0:/soundhax-jpn-o3ds-v3.xand4.x.m4a
-rm -o -s 0:/soundhax-jpn-o3ds-pre2.1-post5franken.m4a
-rm -o -s 0:/soundhax-jpn-o3ds-v2.1and2.2-post5franken.m4a
-rm -o -s 0:/soundhax-kor-n3ds.m4a
-rm -o -s 0:/soundhax-kor-o3ds-post5.0.m4a
-rm -o -s 0:/soundhax-kor-o3ds-v3.xand4.x.m4a
-rm -o -s 0:/soundhax-twn-o3ds-post5.0.4m4a
-rm -o -s 0:/soundhax-twn-o3ds-v3.xand4.x.m4a
-rm -o -s 0:/soundhax-usa-n3ds.m4a
-rm -o -s 0:/soundhax-usa-o3ds-post5.0.m4a
-rm -o -s 0:/soundhax-usa-o3ds-pre2.1.m4a
-rm -o -s 0:/soundhax-usa-o3ds-v2.1and2.2.m4a
-rm -o -s 0:/soundhax-usa-o3ds-v3.xand4.x.m4a
-rm -o -s 0:/soundhax-usa-o3ds-pre2.1-post5franken.m4a
-rm -o -s 0:/soundhax-usa-o3ds-v2.1and2.2-post5franken.m4a
-rm -o -s 0:/soundhax.m4a
-rm -o -s 0:/otherapp.bin
-
-## BannerBomb3
-
-rm -o -s 0:/bb3.bin
-rm -o -s "A:/Nintendo DSiWare/F00D43D5.bin"
-
-## unSAFE_MODE
-
-rm -o -s 0:/usm.bin
-rm -o -s 0:/3ds/slotTool/
-rm -o -s 0:/3ds/slotTool.3dsx
-
-## Fredtool / Frogtool
-
-rm -o -s 0:/484E4441.bin
-rm -o -s 0:/484E4441.bin.patched
-rm -o -s 0:/frogcert.bin
-rm -o -s 0:/private/ds/app/4B47554A/001/T00031_1038C2A757B77_000.ppm
-rm -o -s 0:/movable.sed
-rm -o -s 0:/3ds/Frogtool.3dsx
-rm -o -s 0:/boot.nds
-
-## Browser
-
-rm -o -s 0:/browserhax_hblauncher_ropbin_payload.bin
-rm -o -s 0:/arm11code.bin
-
-## menuhax67 / nimdsphax-common (that's y i'm requesting it be made)
-
-rm -o -s 0:/Launcher.dat # sorry gateway users
-rm -o -s 0:/3ds/menuhax67_installer.3dsx
-rm -o -s 0:/3ds/nimdsphax/
-
-## Alternate Exploits
-
-rm -o -s 0:/freaky.bin
-rm -o -s 0:/steelhax/
-rm -o -s 0:/petitcom_us.icn
-rm -o -s 0:/petitcom_jpn.icn # technically redundant
-rm -o -s 0:/petitcom_eu.icn
-
-## MSET9
-
-rm -o -s 0:/mset9.bat
-rm -o -s 0:/MSET9-Windows.bat
-rm -o -s 0:/mset9.command
-rm -o -s 0:/MSET9-macOS.command
-rm -o -s 0:/mset9.py
-rm -o -s 0:/b9
-rm -o -s 0:/SafeB9S.bin
-rm -o -s 0:/_INSTRUCTIONS.txt
-rm -o -s 0:/errors.txt
-
-set PREVIEW_MODE "Checking for problems... DONE\nAsking for permission... DONE\nInstalling homebrew... DONE\nCopying GodMode9 to CTRNAND... DONE\nCleaning up SD card... DONE\n> Backing up essential.exefs...\nBacking up NAND... ---"
-
-if find 0:/gm9/flags/INSTALLFLAG NULL
- set PREVIEW_MODE "Checking for problems... DONE\nAsking for permission... DONE\nInstalling homebrew... SKIP\nCopying GodMode9 to CTRNAND... DONE\nCleaning up SD card... DONE\n> Backing up essential.exefs...\n> Backing up NAND... ---"
-end
-
-# Backup essential.exefs
-
-if not find 0:/gm9/backups NULL
- mkdir 0:/gm9/backups
-end
-findnot 0:/gm9/backups/$[SERIAL]_essential_??.exefs OUTPATH
-cp -w S:/essential.exefs $[OUTPATH]
-
-set PREVIEW_MODE "Checking for problems... DONE\nAsking for permission... DONE\nInstalling homebrew... DONE\nCopying GodMode9 to CTRNAND... DONE\nCleaning up SD card... DONE\nBacking up essential.exefs... DONE\n> Backing up NAND..."
-
-if find 0:/gm9/flags/INSTALLFLAG NULL
- set PREVIEW_MODE "Checking for problems... DONE\nAsking for permission... DONE\nInstalling homebrew... SKIP\nCopying GodMode9 to CTRNAND... DONE\nCleaning up SD card... DONE\nBacking up essential.exefs... DONE\n> Backing up NAND... ---"
-end
-
-# NAND backup
-
-if find 0:/gm9/flags/BACKUPFLAG NULL
- goto BACKUPSKIP
-end
-
-findnot 0:/gm9/backups/$[DATESTAMP]_$[SERIAL]_sysnand_??.bin OUTPATH
-
-if cp -h S:/nand_minsize.bin $[OUTPATH]
-else
- set PREVIEW_MODE "9:/finalize/img/error06.png"
- echo "Error #06: NAND backup fail\n \nThe NAND backup failed for some reason.\n(Did you cancel it?)\nAsk for help on Discord:\nhttps://discord.gg/MWxPgEp"
- poweroff
-end
-goto CLEANUP
-
-@NOSPACE # Contingency if SD is backed up due to lack of space
-
-set PREVIEW_MODE "Checking for problems... No 3DS folder\n> Backing up NAND..."
-if not find 0:/gm9/backups NULL
- mkdir 0:/gm9/backups
-end
-findnot 0:/gm9/backups/$[DATESTAMP]_$[SERIAL]_sysnand_??.bin OUTPATH
-
-if cp -h S:/nand_minsize.bin $[OUTPATH]
-else
- set PREVIEW_MODE "9:/finalize/img/error06_nospace.png"
- echo "Error #06: NAND backup fail\n \nThe NAND backup failed for some reason.\n(Do you have enough space?)\nAsk for help on Discord:\nhttps://discord.gg/MWxPgEp"
- poweroff
-end
-
-if not find 0:/gm9/flags NULL
- mkdir 0:/gm9/flags
-end
-if find 0:/gm9/flags/BACKUPFLAG NULL
- rm -o -s 0:/gm9/flags/BACKUPFLAG
-end
-
-set BACKUPFLAG 0:/gm9/flags/BACKUPFLAG
-if not fdummy $[BACKUPFLAG] 400
- set PREVIEW_MODE "9:/finalize/img/error15.png"
- echo "Fatal Error #15: File creation fail\n \nCould not create 0:/gm9/flags/BACKUPFLAG.\n(How did this happen?)\n \nAsk for help on Discord:\nhttps://discord.gg/MWxPgEp"
- poweroff
-end
-
-set PREVIEW_MODE "9:/finalize/img/emptysd_complete.png"
-echo "NAND backup complete.\nCopy the two SysNAND files in SD:/gm9/backups\nto a safe location on your computer, then\ndelete them from your SD card.\nThen, copy your Nintendo 3DS folder back\nto your SD card and re-run this script.\n \nIf you don't have a Nintendo 3DS folder backup,\nopen HOME Menu, then re-run this script."
-poweroff
-
-@CLEANUP # Self-removes script and remove script flags
-
-if find 0:/gm9/flags/INSTALLFLAG NULL
- set PREVIEW_MODE "Checking for problems... DONE\nAsking for permission... DONE\nInstalling homebrew... SKIP\nCopying GodMode9 to CTRNAND... DONE\nCleaning up SD card... DONE\nBacking up essential.exefs... DONE\nBacking up NAND... DONE"
- goto INSTALLSKIP
-end
-
-cp -w 9:/finalize/GM9Megascript.gm9 0:/gm9/scripts/GM9Megascript.gm9
-rm -o -s 0:/gm9/scripts/finalize.gm9
-rm -o -s 0:/finalize.romfs
-
-set PREVIEW_MODE "9:/finalize/img/complete.png"
-
-echo "Success: Setup complete! :D\n \nRemember to backup the contents of\nSD:/gm9/backups to somewhere safe."
-# rm -o -s 0:/finalize
-rm -o -s 0:/gm9/flags
-
-poweroff
-
-@BACKUPSKIP
-
-cp -w 9:/finalize/GM9Megascript.gm9 0:/gm9/scripts/GM9Megascript.gm9
-rm -o -s 0:/gm9/scripts/finalize.gm9
-rm -o -s 0:/finalize.romfs
-
-set PREVIEW_MODE "9:/finalize/img/complete_backupflag.png"
-
-if find 0:/gm9/flags/INSTALLFLAG NULL
- echo "Success: Setup complete! :D\n \nRemember to backup the contents of\nSD:/gm9/backups to somewhere safe.\n \nWARNING: NAND backup automatically skipped!\nIf you need to make another backup,\nfollow these instructions:\nhttps://tinyurl.com/gm9nandbackup\nWARNING: CIA install skipped by user request!"
-else
- echo "Success: Setup complete! :D\n \nRemember to backup the contents of\nSD:/gm9/backups to somewhere safe.\n \nWARNING: NAND backup automatically skipped!\nIf you need to make another backup,\nfollow these instructions:\nhttps://tinyurl.com/gm9nandbackup"
-end
-
-# rm -o -s 0:/finalize
-rm -o -s 0:/gm9/flags
-poweroff
-
-@BACKUPDUPE
-
-set PREVIEW_MODE "9:/finalize//img/error17.png"
-
-ask "Information #17: Duplicate NAND backup\nIt looks like you've already made a NAND backup.\n \nIf you want to install homebrew applications,\nyou should copy your NAND backup from\nSD:/gm9/backups to a safe location on your computer,\ndelete the backup from the SD card, and\ncopy the Nintendo 3DS folder back to your SD card.\n(If you've lost the folder, you can regenerate\none by opening HOME Menu with this SD inserted.)\n \nPress (A) to make another NAND backup anyway.\nPress (B) to cancel."
-goto NOSPACE
-
-@INSTALLSKIP
-
-cp -w 9:/finalize/GM9Megascript.gm9 0:/gm9/scripts/GM9Megascript.gm9
-rm -o -s 0:/gm9/scripts/finalize.gm9
-rm -o -s 0:/finalize.romfs
-
-set PREVIEW_MODE "9:/finalize/img/complete_installflag.png"
-
-echo "Success: Setup complete! :D\n \nRemember to backup the contents of\nSD:/gm9/backups to somewhere safe.\n \nWARNING: CIA install skipped by user request!"
-# rm -o -s 0:/finalize
-rm -o -s 0:/gm9/flags
-
-poweroff
-
-
diff --git a/romfs/finalize/lang/en_US.json b/romfs/finalize/lang/en_US.json
new file mode 100644
index 0000000..4507c39
--- /dev/null
+++ b/romfs/finalize/lang/en_US.json
@@ -0,0 +1,13 @@
+{
+ "INIT_MESSAGE": "The Finalizing Setup Script is now starting...",
+ "ASK_FOR_HELP": "Ask for help on Discord:\nhttps://discord.gg/MWxPgEp",
+
+ "ERROR_00": "Error #00: Build error\nYou have encountered an error\nthat should only occur if the script\nwas built incorrectly.",
+ "ERROR_02": "Error #02: Missing essential.exefs\n \nessential.exefs does not exist.\nTry again,\nmaking sure to say Yes to the\n'Create essential files' popup.",
+ "ERROR_04": "Error #04: No space\n \nInsufficient space on SD card.\nYou need %s, but you have %s.\nMake some space, then try again.\n \nTIP: You can temporarily remove the Nintendo 3DS\nand DCIM folders from your SD card\nto make enough space.",
+ "ERROR_21": "Error #21: finalize.romfs not found\n \nfinalize.romfs could not be found on the SD card.\nCopy it to root of SD and try again.",
+ "ERROR_22": "Error #22: finalize.romfs is invalid\n \nThe file finalize.romfs is corrupt or unreadable.\nRe-download it, copy it to root of SD, and try again.\n \nExpected: %s\n \nReceived: %s",
+ "INFO_23" : "Information #23: finalize.romfs in wrong location\n \nfinalize.romfs is in the wrong location.\nThis script will attempt to move it.\nPlease hit on the next few prompts.",
+ "ERROR_26": "Error #26: SD card not mounted.\n \nThis should not be possible.",
+ "ERROR_30": "Fatal Error #30: Missing console-unique files\n \nThe following files are missing from the NAND:\n%s"
+}
\ No newline at end of file