740{
744
748
752
753 ULONG dwContentLen, dwBytesWritten, dwBytesRead,
dwStatus, dwStatusLen;
754 ULONG dwCurrentBytesRead = 0;
756
760
761
763 const DWORD dwUrlConnectFlags =
766 size_t urlLength;
768
769
771 {
774 break;
777 break;
780 break;
781 }
783
784
786 {
788 {
791 }
792 }
793 else
794 {
796 }
797
798
800
801
803 {
806 }
807
808
810 {
812 {
815 }
816 }
817
819 {
823 break;
825 {
831 break;
832 }
833 }
834
837 {
838
840 goto run;
841 }
842
843
845
847 {
848 case 0:
849 default:
851 break;
852 case 1:
854 break;
855 case 2:
858 break;
859 }
860
861 if (!hOpen)
862 {
865 }
866
868 dwContentLen = 0;
870 ZeroMemory(&urlComponents,
sizeof(urlComponents));
872
873 urlLength =
Info.szUrl.GetLength();
876
878 {
881 }
882
884 {
887 {
889 {
890
892 }
894 }
895
896
898 {
901 }
902
904 {
907 }
908
909
911 }
913 {
914
918 {
920 {
921
923 }
925 }
926
928 }
930 {
931
934
937 {
939 {
940 goto run;
941 }
942 else
943 {
946 }
947 }
948 else
949 {
952 }
953 }
954
955 if (!dwContentLen)
956 {
957
958 if (
Info.SizeInBytes)
959 {
960 dwContentLen =
Info.SizeInBytes;
961 }
962 else
963 {
964
966 }
967 }
968
970
971#ifdef USE_CERT_PINNING
972
974 {
977 bool bAskQuestion = false;
979 {
981 bAskQuestion = true;
982 }
983 else if (!IsTrustedPinnedCert(
subjectName, issuerName))
984 {
986 bAskQuestion = true;
987 }
988
989 if (bAskQuestion)
990 {
992 {
994 }
995 }
996 }
997#endif
998
1001 {
1004 }
1005
1006 dwCurrentBytesRead = 0;
1007 do
1008 {
1010 if (bCancelled)
1011 break;
1012
1014 {
1017 }
1018
1020 {
1023 }
1024
1025 dwCurrentBytesRead += dwBytesRead;
1027
1028 } while (dwBytesRead);
1029
1032
1033 if (bCancelled)
1034 {
1035 DPRINT1(
"Operation cancelled\n");
1037 }
1038
1039 if (!dwContentLen)
1040 {
1041
1043
1044 dwContentLen = dwCurrentBytesRead;
1046 }
1047
1048
1049
1051 {
1053
1054
1056 {
1057 DPRINT1(
"Unable to load string\n");
1059 }
1060
1063
1064
1066 {
1068 {
1069 DPRINT1(
"Unable to load string\n");
1071 }
1072
1075 }
1076 }
1077
1078run:
1080
1081
1083 {
1091
1093 {
1095 L" \"" +
Info.szPackageName +
L"\" \"" + shExInfo.
lpFile +
L"\"";
1100 }
1102 {
1105 {
1108 }
1110 }
1111
1112 if (bSilentInstall)
1113 {
1114 if (!
Info.szSilentInstallArgs.IsEmpty())
1115 {
1116
1118 }
1119 else
1120 {
1123
1126
1128 {
1131 shExInfo.
lpFile =
L"msiexec.exe";
1132 }
1133 }
1134 }
1135
1136
1138
1140 {
1141
1142
1145
1147
1148
1150 {
1154 }
1155 }
1156 else
1157 {
1159 }
1160
1162 {
1164 }
1165 }
1166
1170
1174
1175 if (bTempfile)
1176 {
1178 {
1179
1182 {
1184 }
1185 }
1186 }
1187
1189}
PRTL_UNICODE_STRING_BUFFER Path
#define APPLICATION_DATABASE_NAME
BOOL WriteLogMessage(WORD wType, DWORD dwEventID, LPCWSTR lpMsg)
BOOL GetStorageDirectory(CStringW &lpDirectory)
BOOL OpensWithExplorer(PCWSTR Path)
BOOL GetSilentInstallParameters(InstallerType InstallerType, UINT ExtraInfo, LPCWSTR Installer, CStringW &Parameters)
BOOL DeleteDirectoryTree(LPCWSTR Dir, HWND hwnd=NULL)
UINT ClassifyFile(PCWSTR Path)
InstallerType GuessInstallerType(LPCWSTR Installer, UINT &ExtraInfo)
#define IDS_UNABLE_TO_DOWNLOAD
#define IDS_MISMATCH_CERT_INFO
#define IDS_UNABLE_TO_DOWNLOAD2
#define IDS_UNABLE_TO_QUERY_CERT
#define IDC_DOWNLOAD_STATUS
#define IDS_INTEG_CHECK_TITLE
#define IDS_DL_DIALOG_DB_DOWNLOAD_DISP
#define IDS_INTEG_CHECK_FAIL
#define IDS_DL_DIALOG_DB_UNOFFICIAL_DOWNLOAD_DISP
SETTINGS_INFO SettingsInfo
bool IsEmpty() const noexcept
void ReleaseBuffer(_In_ int nNewLength=-1)
void __cdecl Format(UINT nFormatID,...)
void UpdateProgress(ULONG ulProgress, ULONG ulProgressMax)
WCHAR m_szCaptionFmt[100]
CDownloaderProgress m_ProgressBar
VOID SetMarquee(BOOL Enable)
VOID SetProgress(ULONG ulProgress, ULONG ulProgressMax)
#define INVALID_HANDLE_VALUE
BOOL WINAPI CopyFileW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName, IN BOOL bFailIfExists)
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
HRESULT WINAPI PathCreateFromUrlW(const WCHAR *url, WCHAR *path, DWORD *pcchPath, DWORD dwReserved)
DWORD WINAPI FtpGetFileSize(HINTERNET hFile, LPDWORD lpdwFileSizeHigh)
BOOL WINAPI HttpQueryInfoW(HINTERNET hHttpRequest, DWORD dwInfoLevel, LPVOID lpBuffer, LPDWORD lpdwBufferLength, LPDWORD lpdwIndex)
BOOL WINAPI InternetCrackUrlW(const WCHAR *lpszUrl, DWORD dwUrlLength, DWORD dwFlags, URL_COMPONENTSW *lpUC)
BOOL WINAPI InternetReadFile(HINTERNET hFile, LPVOID lpBuffer, DWORD dwNumOfBytesToRead, LPDWORD pdwNumOfBytesRead)
HINTERNET WINAPI InternetOpenUrlW(HINTERNET hInternet, LPCWSTR lpszUrl, LPCWSTR lpszHeaders, DWORD dwHeadersLength, DWORD dwFlags, DWORD_PTR dwContext)
BOOL WINAPI InternetCloseHandle(HINTERNET hInternet)
HINTERNET WINAPI InternetOpenW(LPCWSTR lpszAgent, DWORD dwAccessType, LPCWSTR lpszProxy, LPCWSTR lpszProxyBypass, DWORD dwFlags)
HRESULT ExtractArchiveForExecution(PCWSTR pszArchive, const CStringW &PackageName, CStringW &TempDir, CStringW &App)
GLenum const GLfloat * params
static void SetFriendlyUrl(HWND hWnd, LPCWSTR pszUrl)
VOID UrlUnescapeAndMakeFileNameValid(CStringW &str)
static VOID MessageBox_LoadString(HWND hOwnerWnd, INT StringID)
@ DLSTATUS_WAITING_INSTALL
static BOOL ShowLastError(HWND hWndOwner, BOOL bInetError, DWORD dwLastError)
CStringW LoadStatusString(DownloadStatus StatusParam)
@ DLTYPE_DBUPDATE_UNOFFICIAL
static BYTE subjectName[]
#define WM_NOTIFY_INSTALLERFINISHED
#define SEE_MASK_NOCLOSEPROCESS
BOOL WINAPI DECLSPEC_HOTPATCH ShellExecuteExW(LPSHELLEXECUTEINFOW sei)
@ PERCEIVED_TYPE_COMPRESSED
WCHAR szDownloadDir[MAX_PATH]
WCHAR szNoProxyFor[MAX_PATH]
WCHAR szProxyServer[MAX_PATH]
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
#define INVALID_FILE_ATTRIBUTES
SERVICE_STATUS_HANDLE hStatus
DWORD WINAPI GetLastError(void)
#define INTERNET_SCHEME_FTP
#define INTERNET_SCHEME_HTTP
#define INTERNET_SCHEME_HTTPS
#define INTERNET_FLAG_PRAGMA_NOCACHE
#define INTERNET_FLAG_DONT_CACHE
#define INTERNET_FLAG_KEEP_CONNECTION
#define INTERNET_FLAG_PASSIVE
#define HTTP_QUERY_FLAG_NUMBER
#define INTERNET_OPEN_TYPE_DIRECT
#define INTERNET_OPEN_TYPE_PROXY
#define HTTP_QUERY_STATUS_CODE
#define INTERNET_OPEN_TYPE_PRECONFIG
#define HTTP_QUERY_CONTENT_LENGTH
BOOL VerifyInteg(LPCWSTR lpSHA1Hash, LPCWSTR lpFileName)
int WINAPI MessageBoxA(_In_opt_ HWND hWnd, _In_opt_ LPCSTR lpText, _In_opt_ LPCSTR lpCaption, _In_ UINT uType)
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)