Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit02d5004

Browse files
authored
make things easier to edit
more template like
1 parent5128ff2 commit02d5004

File tree

2 files changed

+37
-26
lines changed

2 files changed

+37
-26
lines changed
139 KB
Binary file not shown.

‎New Installer/main.cpp‎

Lines changed: 37 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
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

3433
HINSTANCE hInst;
3534

@@ -144,7 +143,7 @@ int WINAPI WinMain(
144143
{
145144
MessageBox(NULL,
146145
_T("Call to RegisterClassEx failed!"),
147-
_T("Miichanic Installer"),
146+
_T("Error"),
148147
NULL);
149148

150149
return1;
@@ -181,7 +180,7 @@ int WINAPI WinMain(
181180
{
182181
MessageBox(NULL,
183182
_T("Call to CreateWindow failed!"),
184-
_T("Miichanic Installer"),
183+
_T("Error"),
185184
NULL);
186185

187186
return1;
@@ -210,7 +209,7 @@ HWND item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item
210209
int page =0;//page index
211210
std::string realdir;//drive to install to
212211

213-
bool Region[6] = {
212+
bool Region[6] = {//maybe remove some of these, meh
214213
false,//jpn (0)
215214
false,//usa (1)
216215
false,//eur (2)
@@ -249,6 +248,18 @@ void enableAll() {
249248
// WM_DESTROY - post a quit message and return
250249
LRESULT 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
}
333344
SendMessage(item13, WM_SETTEXT,0, (LPARAM)TEXT("Starting..."));
334345
disableAll();
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);
337348
switch (hr)//http://www.cplusplus.com/forum/windows/53113/#msg288171
338349
{
339350
case 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
345356
SendMessage(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);
347358
switch (hr)//http://www.cplusplus.com/forum/windows/53113/#msg288171
348359
{
349360
case 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
355366
SendMessage(item13, WM_SETTEXT,0, (LPARAM)TEXT("Copying to drive..."));
356367
if (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);
359370
system(MakedirCom.c_str());
360371
system(FinalPath.c_str());
361372
}
362373
if (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);
365376
system(MakedirCom.c_str());
366377
system(FinalPath.c_str());
367378
}
368379
if (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);
371382
system(MakedirCom.c_str());
372383
system(FinalPath.c_str());
373384
}
374385
if (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);
377388
system(MakedirCom.c_str());
378389
system(FinalPath.c_str());
379390
}
380391
if (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);
383394
system(MakedirCom.c_str());
384395
system(FinalPath.c_str());
385396
}
386397
if (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);
389400
system(MakedirCom.c_str());
390401
system(FinalPath.c_str());
391402
}
392403
::SendMessage(item2, PBM_SETPOS, (WPARAM)(INT)75, 0);//make progress bar 75
393404
std::stringFinalPath("copy boot.firm" + realdir);
394405
system(FinalPath.c_str());
395-
remove("Miichanic.3gx");//delete downloaded files after copying
406+
remove(PluginFileString.c_str());//delete downloaded files after copying
396407
remove("boot.firm");
397408
::SendMessage(item2, PBM_SETPOS, (WPARAM)(INT)100, 0);//make progress bar 100
398409
SendMessage(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);
400411
switch (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
402413
break;
403414
default:
404415
break;
@@ -534,4 +545,4 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
534545
}
535546

536547
return0;
537-
}
548+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp