1
1
2
2
# Created by YourKalamity
3
- #https://github.com/YourKalamity/lazy-dsi-file-downloader
3
+ #https://github.com/YourKalamity/lazy-dsi-file-downloader
4
4
5
5
6
6
import tkinter
15
15
import shutil
16
16
from subprocess import Popen
17
17
import zipfile
18
+ import distutils
19
+ from distutils import dir_util
18
20
19
21
if (sys .version_info .major < 3 ):
20
22
print ("This program will ONLY work on Python 3 and above" )
@@ -125,53 +127,61 @@ def start():
125
127
temp = directory + "/tmp/"
126
128
Path (temp ).mkdir (parents = True ,exist_ok = True )
127
129
128
- #Download Memory Pit
129
- memoryPitLocation = directory + "/private/ds/app/484E494A/"
130
- Path (memoryPitLocation ).mkdir (parents = True , exist_ok = True )
131
- r = requests .get (memoryPitDownload , allow_redirects = True )
132
- memoryPitLocation = memoryPitLocation + "pit.bin"
133
- open (memoryPitLocation , 'wb' ).write (r .content )
134
- outputbox ("Memory Pit Downloaded " )
135
-
136
- #Download TWiLight Menu
137
- r = requests .get (getLatestTWLmenu (), allow_redirects = True )
138
- TWLmenuLocation = temp + "TWiLightMenu.7z"
139
- open (TWLmenuLocation ,'wb' ).write (r .content )
140
- outputbox ("TWiLight Menu ++ Downloaded " )
141
-
142
- #Extract TWiLight Menu
143
- proc = Popen ([ _7za , 'x' , TWLmenuLocation , '-o' + temp , '_nds' , 'DSi - CFW users' ,
130
+ if downloadmemorypit .get () == 1 :
131
+ #Download Memory Pit
132
+ memoryPitLocation = directory + "/private/ds/app/484E494A/"
133
+ Path (memoryPitLocation ).mkdir (parents = True , exist_ok = True )
134
+ r = requests .get (memoryPitDownload , allow_redirects = True )
135
+ memoryPitLocation = memoryPitLocation + "pit.bin"
136
+ open (memoryPitLocation , 'wb' ).write (r .content )
137
+ outputbox ("Memory Pit Downloaded " )
138
+ print ("Memory Pit Downloaded" )
139
+
140
+ if downloadtwlmenu .get () == 1 :
141
+ #Download TWiLight Menu
142
+ r = requests .get (getLatestTWLmenu (), allow_redirects = True )
143
+ TWLmenuLocation = temp + "TWiLightMenu.7z"
144
+ open (TWLmenuLocation ,'wb' ).write (r .content )
145
+ outputbox ("TWiLight Menu ++ Downloaded " )
146
+ print ("TWiLight Menu ++ Downloaded" )
147
+
148
+ #Extract TWiLight Menu
149
+ proc = Popen ([ _7za , 'x' , TWLmenuLocation , '-y' , '-o' + temp , '_nds' , 'DSi - CFW users' ,
144
150
'DSi&3DS - SD card users' , 'roms' ])
145
- ret_val = proc .wait ()
146
-
147
- while True :
148
- if ret_val == 0 :
149
- outputbox ("TWiLight Menu ++ Extracted " )
150
- break
151
- else :
152
- continue
153
-
154
- #Move TWiLight Menu
155
- shutil .copy (temp + "DSi&3DS - SD card users/BOOT.NDS" , directory )
156
- shutil .move (temp + "_nds/" , directory )
157
- shutil .move (temp + "DSi - CFW users/SDNAND root/hiya" , directory )
158
- shutil .move (temp + "DSi - CFW users/SDNAND root/title" , directory )
159
- shutil .copy (temp + "DSi&3DS - SD card users/_nds/nds-bootstrap-hb-nightly.nds" , directory + "/_nds" )
160
- shutil .copy (temp + "DSi&3DS - SD card users/_nds/nds-bootstrap-hb-release.nds" , directory + "/_nds" )
161
- outputbox ("TWiLight Menu ++ placed " )
162
-
163
- #Download dumpTool
164
- r = requests .get (getLatestdumpTool (), allow_redirects = True )
165
- dumpToolLocation = directory + "/dumpTool.nds"
166
- open (dumpToolLocation ,'wb' ).write (r .content )
167
- outputbox ("dumpTool Downloaded " )
151
+ ret_val = proc .wait ()
152
+
153
+ while True :
154
+ if ret_val == 0 :
155
+ outputbox ("TWiLight Menu ++ Extracted " )
156
+ print ("TWiLight Menu ++ Extracted to" , temp )
157
+ break
158
+
159
+ #Move TWiLight Menu
160
+ shutil .copy (temp + "DSi&3DS - SD card users/BOOT.NDS" , directory )
161
+ distutils .dir_util .copy_tree (temp + "_nds/" , directory + "/_nds/" )
162
+ distutils .dir_util .copy_tree (temp + "DSi - CFW users/SDNAND root/hiya" , directory + "hiya/" )
163
+ distutils .dir_util .copy_tree (temp + "DSi - CFW users/SDNAND root/title" , directory + "hiya/" )
164
+ shutil .copy (temp + "DSi&3DS - SD card users/_nds/nds-bootstrap-hb-nightly.nds" , directory + "/_nds" )
165
+ shutil .copy (temp + "DSi&3DS - SD card users/_nds/nds-bootstrap-hb-release.nds" , directory + "/_nds" )
166
+ Path (directory + "/roms/" ).mkdir (parents = True ,exist_ok = True )
167
+ print ("TWiLight Menu ++ placed in" , directory )
168
+ outputbox ("TWiLight Menu ++ placed " )
169
+
170
+ if downloaddumptool .get () == 1 :
171
+ #Download dumpTool
172
+ r = requests .get (getLatestdumpTool (), allow_redirects = True )
173
+ dumpToolLocation = directory + "/dumpTool.nds"
174
+ open (dumpToolLocation ,'wb' ).write (r .content )
175
+ print ("dumpTool downloaded" )
176
+ outputbox ("dumpTool Downloaded " )
168
177
169
178
if unlaunchNeeded == 1 :
170
179
#Download Unlaunch
171
180
url = "https://problemkaputt.de/unlaunch.zip"
172
181
r = requests .get (url , allow_redirects = True )
173
182
unlaunchLocation = temp + "unlaunch.zip"
174
183
open (unlaunchLocation ,'wb' ).write (r .content )
184
+ print ("Unlaunch Downloaded" )
175
185
outputbox ("Unlaunch Downloaded " )
176
186
177
187
#Extract Unlaunch
@@ -180,11 +190,11 @@ def start():
180
190
zip_ref .close ()
181
191
182
192
183
- #Delete tmp folder
184
- shutil .rmtree (directory + '/tmp' )
193
+ #Delete tmp folder
194
+ shutil .rmtree (directory + '/tmp' )
195
+ print ("Done!" )
196
+ outputbox ("Done!" )
185
197
186
- outputbox ("Done!" )
187
-
188
198
189
199
def chooseDir ():
190
200
window .sourceFolder = filedialog .askdirectory (parent = window , initialdir = "/" , title = 'Please select the directory of your SD card' )
@@ -196,6 +206,12 @@ def chooseDir():
196
206
b_chooseDir .width = 100
197
207
b_chooseDir .height = 50
198
208
209
+ downloadmemorypit = tkinter .IntVar (value = 1 )
210
+ downloadmemorypitCheck = tkinter .Checkbutton (window , text = "Download Memory pit exploit?" , variable = downloadmemorypit )
211
+
212
+ downloadtwlmenu = tkinter .IntVar (value = 1 )
213
+ downloadtwlmenuCheck = tkinter .Checkbutton (window , text = "Download / Update TWiLight menu?" , variable = downloadtwlmenu )
214
+
199
215
firmwareLabel = tkinter .Label (text = "Select your DSi firmware : " )
200
216
firmwareLabel .width = 100
201
217
@@ -204,10 +220,13 @@ def chooseDir():
204
220
selector = tkinter .OptionMenu (window , firmwareVersion , * dsiVersions )
205
221
selector .width = 100
206
222
223
+ downloaddumptool = tkinter .IntVar (value = 1 )
224
+ downloaddumptoolCheck = tkinter .Checkbutton (window , text = "Download dumpTool?" , variable = downloaddumptool )
225
+
207
226
unlaunch = tkinter .IntVar (value = 1 )
208
227
unlaunchCheck = tkinter .Checkbutton (window , text = "Download Unlaunch?" , variable = unlaunch )
209
228
210
- startButton = tkinter .Button (window , text = "Start" , width = 25 , command = start )
229
+ startButton = tkinter .Button (window , text = "Start" , font = ( "TkDefaultFont" , 12 , 'bold' ), width = 25 , command = start )
211
230
outputLabel = tkinter .Label (text = "Output" )
212
231
outputLabel .width = 100
213
232
outputBox = tkinter .Text (window ,state = 'disabled' , width = 30 , height = 10 )
@@ -219,11 +238,13 @@ def chooseDir():
219
238
SDlabel .pack ()
220
239
SDentry .pack ()
221
240
b_chooseDir .pack ()
241
+ downloadmemorypitCheck .pack ()
222
242
firmwareLabel .pack ()
223
243
selector .pack ()
244
+ downloadtwlmenuCheck .pack ()
245
+ downloaddumptoolCheck .pack ()
224
246
unlaunchCheck .pack ()
225
247
startButton .pack ()
226
248
outputLabel .pack ()
227
249
outputBox .pack ()
228
250
window .mainloop ()
229
-
0 commit comments