You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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... ---"
11
11
12
+
# First order of business - Grab a hold of finalize.romfs
13
+
if not find G:/finalize/finalize.gm9 NULL
14
+
if not find 0:/finalize.romfs ROMFS
15
+
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... ---"
16
+
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."
17
+
poweroff
18
+
end
19
+
20
+
if not shaget $[ROMFS] ROMFS_SHA256
21
+
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... ---"
22
+
echo "Error #22: finalize.romfs is unreadable\n \nCould not read fianlize.romfs.\n(How did this happen..? Did it get corrupt?)\n\nCopy finalize.romfs to your SD card and try again."
23
+
poweroff
24
+
end
25
+
26
+
if not imgmount $[ROMFS]
27
+
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... ---"
28
+
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."
29
+
poweroff
30
+
end
31
+
end
32
+
33
+
# Copy finalize files to RAMDRIVE
34
+
if not cp -w -s G:/finalize 9:/finalize
35
+
# WHAT????
36
+
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... ---"
37
+
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."
38
+
poweroff
39
+
end
40
+
41
+
# We're done with finalize.romfs now
42
+
imgumount
43
+
12
44
# Check for missing essentials
13
45
# BuildEssentialBackup() will return 1 (failure) if any of these files are missing. As well as nand_hdr.bin, but like lol
14
46
@@ -36,11 +68,11 @@ end
36
68
37
69
if not find S:/essential.exefs NULL
38
70
if chk -u $[MISSINGESSENTIAL] ""
39
-
set PREVIEW_MODE "0:/finalize/img/error30.png"
71
+
set PREVIEW_MODE "9:/finalize/img/error30.png"
40
72
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"
41
73
poweroff
42
74
else
43
-
set PREVIEW_MODE "0:/finalize/img/error02.png"
75
+
set PREVIEW_MODE "9:/finalize/img/error02.png"
44
76
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."
45
77
poweroff
46
78
end
@@ -66,7 +98,7 @@ end
66
98
# We don't. Why not?
67
99
68
100
if not shaget $[SEED]@110:10 NULL # This should end up failing normally if SEED is "". I'd hope. Someone test this.
69
-
set PREVIEW_MODE "0:/finalize/img/error31.png"
101
+
set PREVIEW_MODE "9:/finalize/img/error31.png"
70
102
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"
71
103
# At this stage, we have essential.exefs.
72
104
# 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.
@@ -76,30 +108,30 @@ end
76
108
# Okay, we have an ID0. Is it there?
77
109
78
110
if not find "0:/Nintendo 3DS/$[SYSID0]" SYSID0PATH
79
-
if find 0:/finalize/nospace NULL
111
+
if find 0:/gm9/flags/nospace NULL
80
112
goto NOSPACE
81
113
end
82
114
83
-
set PREVIEW_MODE "0:/finalize/img/error33.png"
115
+
set PREVIEW_MODE "9:/finalize/img/error33.png"
84
116
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."
85
117
reboot
86
118
end
87
119
88
120
# Check for and attempt to fix edited MSET9 ID1
89
121
90
122
if find "$[SYSID0PATH]/????????????????????????????????_user-id1" CURRENT
91
-
set PREVIEW_MODE "0:/finalize/img/error18a.png"
123
+
set PREVIEW_MODE "9:/finalize/img/error18a.png"
92
124
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."
93
125
allow "0:/Nintendo 3DS"
94
126
strsplit -b REAL $[CURRENT] "_"
95
127
if not mv $[CURRENT] $[REAL]
96
-
set PREVIEW_MODE "0:/finalize/img/error19a.png"
128
+
set PREVIEW_MODE "9:/finalize/img/error19a.png"
97
129
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"
98
130
poweroff
99
131
end
100
132
if find "$[SYSID0PATH]/*sdmc*b9" MSET9ID1
101
133
if not rm -s $[MSET9ID1]
102
-
set PREVIEW_MODE "0:/finalize/img/error19b.png"
134
+
set PREVIEW_MODE "9:/finalize/img/error19b.png"
103
135
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"
104
136
poweroff
105
137
end
@@ -110,11 +142,11 @@ end
110
142
# Check for and attempt to delete hax'd MSET9
111
143
112
144
if find "$[SYSID0PATH]/*sdmc*b9" MSET9ID1
113
-
set PREVIEW_MODE "0:/finalize/img/error18b.png"
145
+
set PREVIEW_MODE "9:/finalize/img/error18b.png"
114
146
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."
115
147
allow "0:/Nintendo 3DS"
116
148
if not rm -s $[MSET9ID1]
117
-
set PREVIEW_MODE "0:/finalize/img/error19b.png"
149
+
set PREVIEW_MODE "9:/finalize/img/error19b.png"
118
150
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"
119
151
poweroff
120
152
end
@@ -124,14 +156,14 @@ end
124
156
# Eject and reinsert SD to mount SYSNAND SD
125
157
126
158
if chk $[FIXEDMSET9] YES
127
-
set PREVIEW_MODE "0:/finalize/img/mset9_reinsert.png"
159
+
set PREVIEW_MODE "9:/finalize/img/mset9_reinsert.png"
128
160
switchsd "MSET9 has been removed.\n \nEject and reinsert your SD card to continue."
129
161
goto IS_SYSNAND_SD_OK
130
162
end
131
163
132
164
# SYSID0 path exists at this point, yet not SYSNAND SD. Why?
133
165
134
-
set PREVIEW_MODE "0:/finalize/img/error32.png"
166
+
set PREVIEW_MODE "9:/finalize/img/error32.png"
135
167
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"
136
168
poweroff
137
169
@@ -144,7 +176,7 @@ if find 0:/gm9/flags/BACKUPFLAG NULL
144
176
end
145
177
146
178
if chk $[SDFREE] INVALID # should not happen
147
-
set PREVIEW_MODE "0:/finalize/img/error07.png"
179
+
set PREVIEW_MODE "9:/finalize/img/error07.png"
148
180
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"
149
181
else
150
182
strsplit -f -b SDFREE_VALUE $[SDFREE] " "
@@ -166,12 +198,15 @@ else
166
198
goto SDFREE_NEXT
167
199
end
168
200
end
169
-
fdummy -o -s 0:/finalize/nospace 400
201
+
if not find 0:/gm9/flags NULL
202
+
mkdir -o -s 0:/gm9/flags
203
+
end
204
+
fdummy -o -s 0:/gm9/flags/nospace 400
170
205
if chk $[ONTYPE] O3DS
171
-
set PREVIEW_MODE "0:/finalize/img/error04.png"
206
+
set PREVIEW_MODE "9:/finalize/img/error04.png"
172
207
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."
173
208
else
174
-
set PREVIEW_MODE "0:/finalize/img/error04.png"
209
+
set PREVIEW_MODE "9:/finalize/img/error04.png"
175
210
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."
176
211
end
177
212
end
@@ -191,13 +226,13 @@ end
191
226
# Check for title database
192
227
193
228
if not find A:/dbs/title.db NULL
194
-
set PREVIEW_MODE "0:/finalize/img/error05.png"
229
+
set PREVIEW_MODE "9:/finalize/img/error05.png"
195
230
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.)"
196
231
goto IMPORT
197
232
end
198
233
199
234
if not imgmount A:/dbs/title.db
200
-
set PREVIEW_MODE "0:/finalize/img/error16.png"
235
+
set PREVIEW_MODE "9:/finalize/img/error16.png"
201
236
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!)"
202
237
goto IMPORT
203
238
else
@@ -211,26 +246,26 @@ goto MAIN
211
246
212
247
mkdir -o -s A:/dbs
213
248
214
-
if not cp -w -o -s 0:/finalize/donor.db A:/dbs/title.db
215
-
set PREVIEW_MODE "0:/finalize/img/error12a.png"
249
+
if not cp -w -o -s 9:/finalize/donor.db A:/dbs/title.db
250
+
set PREVIEW_MODE "9:/finalize/img/error12a.png"
216
251
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"
217
252
poweroff
218
253
end
219
254
220
-
if not cp -w -o -s 0:/finalize/donor.db A:/dbs/import.db
221
-
set PREVIEW_MODE "0:/finalize/img/error12b.png"
255
+
if not cp -w -o -s 9:/finalize/donor.db A:/dbs/import.db
256
+
set PREVIEW_MODE "9:/finalize/img/error12b.png"
222
257
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"
223
258
poweroff
224
259
end
225
260
226
261
if not fixcmac A:/dbs/title.db
227
-
set PREVIEW_MODE "0:/finalize/img/error13a.png"
262
+
set PREVIEW_MODE "9:/finalize/img/error13a.png"
228
263
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"
229
264
poweroff
230
265
end
231
266
232
267
if not fixcmac A:/dbs/import.db
233
-
set PREVIEW_MODE "0:/finalize/img/error13b.png"
268
+
set PREVIEW_MODE "9:/finalize/img/error13b.png"
234
269
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"
235
270
poweroff
236
271
end
@@ -249,44 +284,41 @@ allow 1:
249
284
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... ---"
250
285
251
286
# Install base homebrew applications
287
+
# Can't be issues with the copy anymore...
252
288
253
-
if not install 0:/finalize/Anemone3DS.cia
254
-
if not find 0:/finalize/img/error14a.png NULL
255
-
echo "Error #14g: CIA install fail\n \nA CIA (Anemone3DS) failed to install.\nAlso, script graphics are missing.\n \nTry re-running finalize_helper, or ask for help\non Discord: https://discord.gg/MWxPgEp"
256
-
poweroff
257
-
end
258
-
set PREVIEW_MODE "0:/finalize/img/error14a.png"
259
-
echo "Error #14a: CIA install fail\n \nA CIA (Anemone3DS) failed to install.\n \nTry replacing it with a freshly\ndownloaded copy, or ask for help\non Discord: https://discord.gg/MWxPgEp"
289
+
if not install 9:/finalize/Anemone3DS.cia
290
+
set PREVIEW_MODE "9:/finalize/img/error14a.png"
291
+
echo "Error #14a: CIA install fail\n \nA CIA (Anemone3DS) failed to install.\n \nAsk for help on Discord: https://discord.gg/MWxPgEp"
260
292
poweroff
261
293
end
262
294
263
-
if not install 0:/finalize/Checkpoint.cia
264
-
set PREVIEW_MODE "0:/finalize/img/error14b.png"
265
-
echo "Error #14b: CIA install fail\n \nA CIA (Checkpoint) failed to install.\n \nTry replacing it with a freshly\ndownloaded copy, or ask for help\non Discord: https://discord.gg/MWxPgEp"
295
+
if not install 9:/finalize/Checkpoint.cia
296
+
set PREVIEW_MODE "9:/finalize/img/error14b.png"
297
+
echo "Error #14b: CIA install fail\n \nA CIA (Checkpoint) failed to install.\n \nAsk for help on Discord: https://discord.gg/MWxPgEp"
266
298
poweroff
267
299
end
268
300
269
-
if not install 0:/finalize/FBI.cia
270
-
set PREVIEW_MODE "0:/finalize/img/error14c.png"
271
-
echo "Error #14c: CIA install fail\n \nA CIA (FBI) failed to install.\n \nTry replacing it with a freshly\ndownloaded copy, or ask for help\non Discord: https://discord.gg/MWxPgEp"
301
+
if not install 9:/finalize/FBI.cia
302
+
set PREVIEW_MODE "9:/finalize/img/error14c.png"
303
+
echo "Error #14c: CIA install fail\n \nA CIA (FBI) failed to install.\n \nAsk for help on Discord: https://discord.gg/MWxPgEp"
272
304
poweroff
273
305
end
274
306
275
-
if not install 0:/finalize/ftpd.cia
276
-
set PREVIEW_MODE "0:/finalize/img/error14d.png"
277
-
echo "Error #14d: CIA install fail\n \nA CIA (ftpd) failed to install.\n \nTry replacing it with a freshly\ndownloaded copy, or ask for help\non Discord: https://discord.gg/MWxPgEp"
307
+
if not install 9:/finalize/ftpd.cia
308
+
set PREVIEW_MODE "9:/finalize/img/error14d.png"
309
+
echo "Error #14d: CIA install fail\n \nA CIA (ftpd) failed to install.\n \nAsk for help on Discord: https://discord.gg/MWxPgEp"
278
310
poweroff
279
311
end
280
312
281
-
if not install 0:/finalize/Homebrew_Launcher.cia
282
-
set PREVIEW_MODE "0:/finalize/img/error14e.png"
283
-
echo "Error #14e: CIA install fail\n \nA CIA (Homebrew Launcher) failed to install.\n \nTry replacing it with a freshly\ndownloaded copy, or ask for help\non Discord: https://discord.gg/MWxPgEp"
313
+
if not install 9:/finalize/Homebrew_Launcher.cia
314
+
set PREVIEW_MODE "9:/finalize/img/error14e.png"
315
+
echo "Error #14e: CIA install fail\n \nA CIA (Homebrew Launcher) failed to install.\n \nAsk for help on Discord: https://discord.gg/MWxPgEp"
284
316
poweroff
285
317
end
286
318
287
-
if not install 0:/finalize/Universal-Updater.cia
288
-
set PREVIEW_MODE "0:/finalize/img/error14f.png"
289
-
echo "Error #14f: CIA install fail\n \nA CIA (Universal-Updater) failed to install.\n \nTry replacing it with a freshly\ndownloaded copy, or ask for help\non Discord: https://discord.gg/MWxPgEp"
319
+
if not install 9:/finalize/Universal-Updater.cia
320
+
set PREVIEW_MODE "9:/finalize/img/error14f.png"
321
+
echo "Error #14f: CIA install fail\n \nA CIA (Universal-Updater) failed to install.\n \nAsk for help on Discord: https://discord.gg/MWxPgEp"
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"
set PREVIEW_MODE "0:/finalize/img/error06_nospace.png"
494
+
set PREVIEW_MODE "9:/finalize/img/error06_nospace.png"
463
495
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"
464
496
poweroff
465
497
end
@@ -473,12 +505,12 @@ end
473
505
474
506
set BACKUPFLAG 0:/gm9/flags/BACKUPFLAG
475
507
if not fdummy $[BACKUPFLAG] 400
476
-
set PREVIEW_MODE "0:/finalize/img/error15.png"
508
+
set PREVIEW_MODE "9:/finalize/img/error15.png"
477
509
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"
478
510
poweroff
479
511
end
480
512
481
-
set PREVIEW_MODE "0:/finalize/img/emptysd_complete.png"
513
+
set PREVIEW_MODE "9:/finalize/img/emptysd_complete.png"
482
514
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."
483
515
poweroff
484
516
@@ -489,53 +521,53 @@ if find 0:/gm9/flags/INSTALLFLAG NULL
set PREVIEW_MODE "0:/finalize/img/complete_backupflag.png"
542
+
set PREVIEW_MODE "9:/finalize/img/complete_backupflag.png"
511
543
512
-
if find 0:/gm9/flags/INSTALLFLAG NULL
544
+
if find 9:/finalize/INSTALLFLAG NULL
513
545
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!"
514
546
else
515
547
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"
516
548
end
517
549
518
-
rm -o -s 0:/finalize
550
+
# rm -o -s 0:/finalize
519
551
rm -o -s 0:/gm9/flags
520
552
poweroff
521
553
522
554
@BACKUPDUPE
523
555
524
-
set PREVIEW_MODE "0:/finalize/img/error17.png"
556
+
set PREVIEW_MODE "9:/finalize//img/error17.png"
525
557
526
558
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."
set PREVIEW_MODE "0:/finalize/img/complete_installflag.png"
567
+
set PREVIEW_MODE "9:/finalize/img/complete_installflag.png"
536
568
537
569
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!"
0 commit comments