|
1 | 1 | #include "dllmain.h"
|
2 | 2 | #include "exception.hpp"
|
3 |
| -#include <shellapi.h> |
4 |
| -#include <Commctrl.h> |
5 |
| -#pragma comment(lib,"Comctl32.lib") |
6 |
| -#pragma comment(linker,"\"/manifestdependency:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") |
7 | 3 | #include <initguid.h>
|
8 | 4 | #include <filesystem>
|
9 | 5 | #include <safetyhook.hpp>
|
@@ -33,18 +29,6 @@ std::vector<std::pair<std::filesystem::path, LARGE_INTEGER>> updateFilenames;
|
33 | 29 | thread_local std::string sCurrentFindFileDirA;
|
34 | 30 | thread_local std::wstring sCurrentFindFileDirW;
|
35 | 31 |
|
36 |
| -HRESULT CALLBACK TaskDialogCallbackProc(HWND hwnd, UINT uNotification, WPARAM wParam, LPARAM lParam, LONG_PTR dwRefData) |
37 |
| -{ |
38 |
| - switch (uNotification) |
39 |
| - { |
40 |
| - case TDN_HYPERLINK_CLICKED: |
41 |
| - ShellExecuteW(hwnd, L"open", (LPCWSTR)lParam, NULL, NULL, SW_SHOW); |
42 |
| - break; |
43 |
| - } |
44 |
| - |
45 |
| - return S_OK; |
46 |
| -} |
47 |
| - |
48 | 32 | bool iequals(std::wstring_view s1, std::wstring_view s2)
|
49 | 33 | {
|
50 | 34 | std::wstring str1(std::move(s1));
|
@@ -676,40 +660,20 @@ void FindFiles(WIN32_FIND_DATAW* fd)
|
676 | 660 | auto e = GetLastError();
|
677 | 661 | if (e != ERROR_DLL_INIT_FAILED && e != ERROR_BAD_EXE_FORMAT) // in case dllmain returns false or IMAGE_MACHINE is not compatible
|
678 | 662 | {
|
679 |
| - TASKDIALOGCONFIG tdc = { sizeof(TASKDIALOGCONFIG) }; |
680 |
| - int nClickedBtn; |
681 |
| - BOOL bCheckboxChecked; |
682 |
| - LPCWSTR szTitle = L"ASI Loader", szHeader = L"", szContent = L""; |
683 |
| - TASKDIALOG_BUTTON aCustomButtons[] = { { 1000, L"Continue" } }; |
684 |
| - |
685 |
| - std::wstring msg = L"Unable to load " + std::wstring(fd->cFileName) + L". Error: " + std::to_wstring(e); |
686 |
| - szHeader = msg.c_str(); |
687 |
| - |
| 663 | + std::wstring msg = L"Unable to load " + std::wstring(fd->cFileName) + L". Error: " + std::to_wstring(e) + L"."; |
688 | 664 | if (e == ERROR_MOD_NOT_FOUND)
|
689 | 665 | {
|
690 |
| - szContent = L"This ASI file requires a dependency that is missing from your system. To identify the missing dependency, download and run the free, open-source app, " \ |
691 |
| - L"<a href=\"https://github.com/lucasg/Dependencies/releases/latest\">Dependencies</a>.\n\n" \ |
692 |
| - L"<a href=\"https://github.com/lucasg/Dependencies\">https://github.com/lucasg/Dependencies</a>"; |
| 666 | + msg += L" This ASI file requires a dependency that is missing from your system. " \ |
| 667 | + "To identify the missing dependency, download and run the free, open-source app, " \ |
| 668 | + "Dependencies at https://github.com/lucasg/Dependencies"; |
693 | 669 | }
|
694 |
| - |
695 |
| - tdc.hwndParent = NULL; |
696 |
| - tdc.dwFlags = TDF_USE_COMMAND_LINKS | TDF_ENABLE_HYPERLINKS | TDF_SIZE_TO_CONTENT | TDF_CAN_BE_MINIMIZED; |
697 |
| - tdc.pButtons = aCustomButtons; |
698 |
| - tdc.cButtons = _countof(aCustomButtons); |
699 |
| - tdc.pszWindowTitle = szTitle; |
700 |
| - tdc.pszMainIcon = TD_ERROR_ICON; |
701 |
| - tdc.pszMainInstruction = szHeader; |
702 |
| - tdc.pszContent = szContent; |
703 |
| - tdc.pfCallback = TaskDialogCallbackProc; |
704 |
| - tdc.lpCallbackData = 0; |
705 |
| - |
706 |
| - std::ignore = TaskDialogIndirect(&tdc, &nClickedBtn, NULL, &bCheckboxChecked); |
| 670 | + MessageBoxW(0, msg.c_str(), L"ASI Loader", MB_ICONERROR); |
707 | 671 | }
|
708 | 672 | }
|
709 | 673 | else
|
710 | 674 | {
|
711 | 675 | auto procedure = (void(*)())GetProcAddress(h, "InitializeASI");
|
712 |
| - |
| 676 | + |
713 | 677 | if (procedure != NULL)
|
714 | 678 | {
|
715 | 679 | procedure();
|
|
0 commit comments