1414// Header needed for unicode adjustment support
1515#include < tchar.h>
1616#include " dirent.h"
17- // Header for downloading files
18- #include < urlmon.h>
17+ #include < urlmon.h>
1918#pragma comment (lib,"urlmon.lib")
2019#pragma comment(lib, "comctl32.lib")
2120#pragma comment(linker,"\"/manifestdependency:type='win32' \
@@ -26,10 +25,10 @@ processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
2625// Global variables
2726
2827// The main window class name.
29- static TCHAR szWindowClass[] = _T(" MiichanicToolBoxInstaller" );
28+ static TCHAR szWindowClass[] = _T(" MiichanicToolBoxInstaller" );// class name, make this your own
3029
3130// The string that appears in the application's title bar.
32- static TCHAR szTitle[] = _T(" Miichanic's Tool Box Installer v2.00" );
31+ static TCHAR szTitle[] = _T(" Miichanic's Tool Box Installer v2.00" );// title name, make this your own
3332
3433HINSTANCE hInst;
3534
@@ -144,7 +143,7 @@ int WINAPI WinMain(
144143 {
145144MessageBox (NULL ,
146145_T (" Call to RegisterClassEx failed!" ),
147- _T (" Miichanic Installer " ),
146+ _T (" Error " ),
148147NULL );
149148
150149return 1 ;
@@ -181,7 +180,7 @@ int WINAPI WinMain(
181180 {
182181MessageBox (NULL ,
183182_T (" Call to CreateWindow failed!" ),
184- _T (" Miichanic Installer " ),
183+ _T (" Error " ),
185184NULL );
186185
187186return 1 ;
@@ -210,7 +209,7 @@ HWND item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item
210209int page =0 ;// page index
211210std::string realdir;// drive to install to
212211
213- bool Region[6 ] = {
212+ bool Region[6 ] = {// maybe remove some of these, meh
214213false ,// jpn (0)
215214false ,// usa (1)
216215false ,// eur (2)
@@ -249,6 +248,18 @@ void enableAll() {
249248// WM_DESTROY - post a quit message and return
250249LRESULT CALLBACKWndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
251250{
251+ // edit this stuff
252+ std::string TIDJPN =" 0004001000020700" ;
253+ std::string TIDUSA =" 0004001000021700" ;
254+ std::string TIDEUR =" 0004001000022700" ;
255+ std::string TIDCHN =" 0004001000026700" ;
256+ std::string TIDKOR =" 0004001000027700" ;
257+ std::string TIDTWN =" 0004001000028700" ;
258+ LPCTSTR PluginLink =TEXT (" https://github.com/FoofooTheGuy/Miichanic_Plugin/releases/latest/download/Miichanic.3gx" );
259+ LPCTSTR PluginFile =TEXT (" Miichanic.3gx" );
260+ std::string PluginFileString =" Miichanic.3gx" ;
261+ LPCTSTR BootFirmLink =TEXT (" https://github.com/FoofooTheGuy/Miichanic_Plugin/raw/main/boot.firm" );
262+
252263 BOOL checked1 =IsDlgButtonChecked (hwnd,2 );
253264 BOOL checked2 =IsDlgButtonChecked (hwnd,3 );
254265 BOOL checked3 =IsDlgButtonChecked (hwnd,4 );
@@ -283,7 +294,7 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
283294 }
284295// https://github.com/malortie/Tutorials/blob/master/tutorials/cpp/win32/controls/progressbar/ProgressBar.cpp
285296 item2 =CreateWindowEx (0 , PROGRESS_CLASS,TEXT (" " ), WS_CHILD | WS_VISIBLE,15 ,320 ,450 ,30 , hwnd, (HMENU)ID_DEFAULTPROGRESSCTRL, ((LPCREATESTRUCT)lParam)->hInstance ,NULL );
286- item3 =CreateWindow (TEXT (" BUTTON" ),TEXT (" JPN" ), WS_VISIBLE | WS_CHILD | WS_BORDER | BS_CHECKBOX,20 ,30 ,185 ,35 , hwnd, (HMENU)2 , ((LPCREATESTRUCT)lParam)->hInstance ,NULL );
297+ item3 =CreateWindow (TEXT (" BUTTON" ),TEXT (" JPN" ), WS_VISIBLE | WS_CHILD | WS_BORDER | BS_CHECKBOX,20 ,30 ,185 ,35 , hwnd, (HMENU)2 , ((LPCREATESTRUCT)lParam)->hInstance ,NULL );// region buttons, note some out if you dont need some
287298 item4 =CreateWindow (TEXT (" BUTTON" ),TEXT (" USA" ), WS_VISIBLE | WS_CHILD | WS_BORDER | BS_CHECKBOX,20 ,70 ,185 ,35 , hwnd, (HMENU)3 , ((LPCREATESTRUCT)lParam)->hInstance ,NULL );
288299 item5 =CreateWindow (TEXT (" BUTTON" ),TEXT (" EUR" ), WS_VISIBLE | WS_CHILD | WS_BORDER | BS_CHECKBOX,20 ,110 ,185 ,35 , hwnd, (HMENU)4 , ((LPCREATESTRUCT)lParam)->hInstance ,NULL );
289300 item6 =CreateWindow (TEXT (" BUTTON" ),TEXT (" CHN" ), WS_VISIBLE | WS_CHILD | WS_BORDER | BS_CHECKBOX,20 ,150 ,185 ,35 , hwnd, (HMENU)5 , ((LPCREATESTRUCT)lParam)->hInstance ,NULL );
@@ -332,8 +343,8 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
332343 }
333344SendMessage (item13, WM_SETTEXT,0 , (LPARAM)TEXT (" Starting..." ));
334345disableAll ();
335- SendMessage (item13, WM_SETTEXT,0 , (LPARAM)TEXT (" Downloading Miichanic.3gx..." ));
336- hr =URLDownloadToFile (NULL ,_T ( " https://github.com/FoofooTheGuy/Miichanic_Plugin/releases/latest/download/Miichanic.3gx " ), _T ( " Miichanic.3gx " ) ,0 ,NULL );
346+ SendMessage (item13, WM_SETTEXT,0 , (LPARAM)TEXT (" Downloading Miichanic.3gx..." ));// you may want to change this
347+ hr =URLDownloadToFile (NULL ,PluginLink, PluginFile ,0 ,NULL );
337348switch (hr)// http://www.cplusplus.com/forum/windows/53113/#msg288171
338349 {
339350case S_OK:break ;
@@ -343,7 +354,7 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
343354 }
344355::SendMessage (item2, PBM_SETPOS, (WPARAM)(INT)25, 0);// make progress bar 25
345356SendMessage (item13, WM_SETTEXT,0 , (LPARAM)TEXT (" Downloading boot.firm..." ));
346- hr =URLDownloadToFile (NULL ,_T ( " https://github.com/FoofooTheGuy/Miichanic_Plugin/raw/main/boot.firm " ) ,_T (" boot.firm" ),0 ,NULL );
357+ hr =URLDownloadToFile (NULL ,BootFirmLink ,_T (" boot.firm" ),0 ,NULL );
347358switch (hr)// http://www.cplusplus.com/forum/windows/53113/#msg288171
348359 {
349360case S_OK:break ;
@@ -354,51 +365,51 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
354365::SendMessage (item2, PBM_SETPOS, (WPARAM)(INT)50, 0);// make progress bar 50
355366SendMessage (item13, WM_SETTEXT,0 , (LPARAM)TEXT (" Copying to drive..." ));
356367if (Region[0 ]) {// jpn
357- std::stringMakedirCom (" md" + realdir +" luma\\ plugins\\ 0004001000020700 " );
358- std::stringFinalPath (" copyMiichanic.3gx " + realdir +" luma\\ plugins\\ 0004001000020700 \\ Miichanic.3gx " );
368+ std::stringMakedirCom (" md" + realdir +" luma\\ plugins\\ " + TIDJPN );
369+ std::stringFinalPath (" copy" + PluginFileString + " " + realdir +" luma\\ plugins\\ " + TIDJPN + " \\ " + PluginFileString );
359370system (MakedirCom.c_str ());
360371system (FinalPath.c_str ());
361372 }
362373if (Region[1 ]) {// usa
363- std::stringMakedirCom (" md" + realdir +" luma\\ plugins\\ 0004001000021700 " );
364- std::stringFinalPath (" copyMiichanic.3gx " + realdir +" luma\\ plugins\\ 0004001000021700 \\ Miichanic.3gx " );
374+ std::stringMakedirCom (" md" + realdir +" luma\\ plugins\\ " + TIDUSA );
375+ std::stringFinalPath (" copy" + PluginFileString + " " + realdir +" luma\\ plugins\\ " + TIDUSA + " \\ " + PluginFileString );
365376system (MakedirCom.c_str ());
366377system (FinalPath.c_str ());
367378 }
368379if (Region[2 ]) {// eur
369- std::stringMakedirCom (" md" + realdir +" luma\\ plugins\\ 0004001000022700 " );
370- std::stringFinalPath (" copyMiichanic.3gx " + realdir +" luma\\ plugins\\ 0004001000022700 \\ Miichanic.3gx " );
380+ std::stringMakedirCom (" md" + realdir +" luma\\ plugins\\ " + TIDEUR );
381+ std::stringFinalPath (" copy" + PluginFileString + " " + realdir +" luma\\ plugins\\ " + TIDEUR + " \\ " + PluginFileString );
371382system (MakedirCom.c_str ());
372383system (FinalPath.c_str ());
373384 }
374385if (Region[3 ]) {// chn
375- std::stringMakedirCom (" md" + realdir +" luma\\ plugins\\ 0004001000026700 " );
376- std::stringFinalPath (" copyMiichanic.3gx " + realdir +" luma\\ plugins\\ 0004001000026700 \\ Miichanic.3gx " );
386+ std::stringMakedirCom (" md" + realdir +" luma\\ plugins\\ " + TIDCHN );
387+ std::stringFinalPath (" copy" + PluginFileString + " " + realdir +" luma\\ plugins\\ " + TIDCHN + " \\ " + PluginFileString );
377388system (MakedirCom.c_str ());
378389system (FinalPath.c_str ());
379390 }
380391if (Region[4 ]) {// kor
381- std::stringMakedirCom (" md" + realdir +" luma\\ plugins\\ 0004001000027700 " );
382- std::stringFinalPath (" copyMiichanic.3gx " + realdir +" luma\\ plugins\\ 0004001000027700 \\ Miichanic.3gx " );
392+ std::stringMakedirCom (" md" + realdir +" luma\\ plugins\\ " + TIDKOR );
393+ std::stringFinalPath (" copy" + PluginFileString + " " + realdir +" luma\\ plugins\\ " + TIDKOR + " \\ " + PluginFileString );
383394system (MakedirCom.c_str ());
384395system (FinalPath.c_str ());
385396 }
386397if (Region[5 ]) {// twn
387- std::stringMakedirCom (" md" + realdir +" luma\\ plugins\\ 0004001000028700 " );
388- std::stringFinalPath (" copyMiichanic.3gx " + realdir +" luma\\ plugins\\ 0004001000028700 \\ Miichanic.3gx " );
398+ std::stringMakedirCom (" md" + realdir +" luma\\ plugins\\ " + TIDTWN );
399+ std::stringFinalPath (" copy" + PluginFileString + " " + realdir +" luma\\ plugins\\ " + TIDTWN + " \\ " + PluginFileString );
389400system (MakedirCom.c_str ());
390401system (FinalPath.c_str ());
391402 }
392403::SendMessage (item2, PBM_SETPOS, (WPARAM)(INT)75, 0);// make progress bar 75
393404 std::stringFinalPath (" copy boot.firm" + realdir);
394405system (FinalPath.c_str ());
395- remove (" Miichanic.3gx " );// delete downloaded files after copying
406+ remove (PluginFileString. c_str () );// delete downloaded files after copying
396407remove (" boot.firm" );
397408::SendMessage (item2, PBM_SETPOS, (WPARAM)(INT)100, 0);// make progress bar 100
398409SendMessage (item13, WM_SETTEXT,0 , (LPARAM)TEXT (" Installation complete!" ));
399410 choice = ::MessageBox (hwnd,TEXT (" Installation complete! Would you like to continue to the rest of the guide?" ),TEXT (" Complete!" ), MB_YESNO | MB_ICONASTERISK);
400411switch (choice) {
401- case IDYES:system (" start\"\" https://github.com/FoofooTheGuy/Miichanic_Plugin#method-1-assisted-installation-using-a-windows-pc" );
412+ case IDYES:system (" start\"\" https://github.com/FoofooTheGuy/Miichanic_Plugin#method-1-assisted-installation-using-a-windows-pc" );// change this as well
402413break ;
403414default :
404415break ;
@@ -534,4 +545,4 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
534545 }
535546
536547return 0 ;
537- }
548+ }