Loweynet
修訂 | a18cfa2489906cd58981b7cbc328f157cfa250d5 (tree) |
---|---|
時間 | 2017-03-20 14:13:38 |
作者 | s_kawamoto <s_kawamoto@user...> |
Commiter | s_kawamoto |
Support proxy connection for automatic software update.
Show the path of the backup copy after automatic software update.
@@ -242,7 +242,7 @@ FONT 9, "MS Shell Dlg", 0, 0, 0x0 | ||
242 | 242 | BEGIN |
243 | 243 | DEFPUSHBUTTON "OK",IDOK,133,294,50,14 |
244 | 244 | ICON ffftp,-1,7,4,20,20 |
245 | - CTEXT "FFFTP Ver 1.99a-20170217",-1,113,11,90,8 | |
245 | + CTEXT "FFFTP Ver 1.99a-20170320",-1,113,11,90,8 | |
246 | 246 | CTEXT "FFFTPÍfreewareÅ·",-1,7,279,305,8 |
247 | 247 | CTEXT "Copyright(C) 1997-2010 Sota & ²¦Í¢½¾¢½ûX\nCopyright (C) 2011-2017 FFFTP Project (Hiromichi Matsushima, Suguru Kawamoto, IWAMOTO Kouichi, vitamin0x, ¤È[, Asami, fortran90, tomo1192, Yuji Tanaka, Moriguchi Hirokazu, Ó¤¹ñ)",-1,7,25,305,44,SS_NOPREFIX |
248 | 248 | CTEXT "",ABOUT_JRE,7,96,305,8 |
@@ -2213,8 +2213,8 @@ nodrop_csr CURSOR "nodrop_c.cur" | ||
2213 | 2213 | // |
2214 | 2214 | |
2215 | 2215 | VS_VERSION_INFO VERSIONINFO |
2216 | - FILEVERSION 1,99,1,11 | |
2217 | - PRODUCTVERSION 1,99,1,11 | |
2216 | + FILEVERSION 1,99,1,12 | |
2217 | + PRODUCTVERSION 1,99,1,12 | |
2218 | 2218 | FILEFLAGSMASK 0x3fL |
2219 | 2219 | #ifdef _DEBUG |
2220 | 2220 | FILEFLAGS 0x1L |
@@ -2232,12 +2232,12 @@ BEGIN | ||
2232 | 2232 | VALUE "Comments", "±êÍt[\tgEGAÅ·B" |
2233 | 2233 | VALUE "CompanyName", "Sota, FFFTP Project" |
2234 | 2234 | VALUE "FileDescription", "FFFTP" |
2235 | - VALUE "FileVersion", "1, 99, 1, 11" | |
2235 | + VALUE "FileVersion", "1, 99, 1, 12" | |
2236 | 2236 | VALUE "InternalName", "FFFTP" |
2237 | 2237 | VALUE "LegalCopyright", "Copyright (C) 1997-2010 Sota & ²¦Í¢½¾¢½ûX\nCopyright (C) 2011-2017 FFFTP Project (Hiromichi Matsushima, Suguru Kawamoto, IWAMOTO Kouichi, vitamin0x, ¤È[, Asami, fortran90, tomo1192, Yuji Tanaka, Moriguchi Hirokazu, Ó¤¹ñ)." |
2238 | 2238 | VALUE "OriginalFilename", "FFFTP.exe" |
2239 | 2239 | VALUE "ProductName", "FFFTP" |
2240 | - VALUE "ProductVersion", "1, 99, 1, 11" | |
2240 | + VALUE "ProductVersion", "1, 99, 1, 12" | |
2241 | 2241 | END |
2242 | 2242 | END |
2243 | 2243 | BLOCK "VarFileInfo" |
@@ -242,7 +242,7 @@ FONT 9, "MS Shell Dlg", 0, 0, 0x0 | ||
242 | 242 | BEGIN |
243 | 243 | DEFPUSHBUTTON "OK",IDOK,132,296,50,14 |
244 | 244 | ICON ffftp,-1,7,4,20,20 |
245 | - CTEXT "FFFTP Ver 1.99a-20170217",-1,110,11,90,8 | |
245 | + CTEXT "FFFTP Ver 1.99a-20170320",-1,110,11,90,8 | |
246 | 246 | CTEXT "FFFTP is freeware",-1,7,281,301,8 |
247 | 247 | CTEXT "Copyright(C) 1997-2010 Sota && cooperators\nCopyright (C) 2011-2017 FFFTP Project (Hiromichi Matsushima, Suguru Kawamoto, IWAMOTO Kouichi, vitamin0x, unarist, Asami, fortran90, tomo1192, Yuji Tanaka, Moriguchi Hirokazu, Fu-sen)",-1,7,25,301,44 |
248 | 248 | CTEXT "",ABOUT_JRE,7,93,301,8 |
@@ -2253,8 +2253,8 @@ nodrop_csr CURSOR "nodrop_c.cur" | ||
2253 | 2253 | // |
2254 | 2254 | |
2255 | 2255 | VS_VERSION_INFO VERSIONINFO |
2256 | - FILEVERSION 1,99,1,11 | |
2257 | - PRODUCTVERSION 1,99,1,11 | |
2256 | + FILEVERSION 1,99,1,12 | |
2257 | + PRODUCTVERSION 1,99,1,12 | |
2258 | 2258 | FILEFLAGSMASK 0x3fL |
2259 | 2259 | #ifdef _DEBUG |
2260 | 2260 | FILEFLAGS 0x1L |
@@ -2272,12 +2272,12 @@ BEGIN | ||
2272 | 2272 | VALUE "Comments", "This software is Free Software" |
2273 | 2273 | VALUE "CompanyName", "Sota, FFFTP Project" |
2274 | 2274 | VALUE "FileDescription", "FFFTP" |
2275 | - VALUE "FileVersion", "1, 99, 1, 11" | |
2275 | + VALUE "FileVersion", "1, 99, 1, 12" | |
2276 | 2276 | VALUE "InternalName", "FFFTP" |
2277 | 2277 | VALUE "LegalCopyright", "Copyright (C) 1997-2010 Sota & cooperators\nCopyright (C) 2011-2017 FFFTP Project (Hiromichi Matsushima, Suguru Kawamoto, IWAMOTO Kouichi, vitamin0x, unarist, Asami, fortran90, tomo1192, Yuji Tanaka, Moriguchi Hirokazu, Fu-sen)." |
2278 | 2278 | VALUE "OriginalFilename", "FFFTP.exe" |
2279 | 2279 | VALUE "ProductName", "FFFTP" |
2280 | - VALUE "ProductVersion", "1, 99, 1, 11" | |
2280 | + VALUE "ProductVersion", "1, 99, 1, 12" | |
2281 | 2281 | END |
2282 | 2282 | END |
2283 | 2283 | BLOCK "VarFileInfo" |
@@ -72,16 +72,16 @@ | ||
72 | 72 | //#define PROGRAM_VERSION_NUM 1972 /* バージョン */ |
73 | 73 | // 64ビット対応 |
74 | 74 | #ifdef _WIN64 |
75 | -#define VER_STR "1.99a-20170217 64bit" | |
75 | +#define VER_STR "1.99a-20170320 64bit" | |
76 | 76 | #else |
77 | -#define VER_STR "1.99a-20170217" | |
77 | +#define VER_STR "1.99a-20170320" | |
78 | 78 | #endif |
79 | 79 | #define VER_NUM 1990 /* 設定バージョン */ |
80 | 80 | #define PROGRAM_VERSION_NUM 1990 /* バージョン */ |
81 | 81 | // ソフトウェア自動更新 |
82 | 82 | // リリースバージョンはリリース予定年(10進数4桁)+月(2桁)+日(2桁)+通し番号(0スタート2桁)とする |
83 | 83 | // 2014年7月31日中の30個目のリリースは2014073129 |
84 | -#define RELEASE_VERSION_NUM 2017021700 /* リリースバージョン */ | |
84 | +#define RELEASE_VERSION_NUM 2017032000 /* リリースバージョン */ | |
85 | 85 | |
86 | 86 | |
87 | 87 | // SourceForge.JPによるフォーク |
@@ -329,6 +329,7 @@ int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLi | ||
329 | 329 | char ListFile[FMAX_PATH+1]; |
330 | 330 | char Description[FMAX_PATH+1]; |
331 | 331 | char UpdateDir[FMAX_PATH+1]; |
332 | + char Buf[FMAX_PATH+1]; | |
332 | 333 | char Path[FMAX_PATH+1]; |
333 | 334 | char Command[FMAX_PATH+1]; |
334 | 335 | char* p; |
@@ -464,7 +465,12 @@ int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLi | ||
464 | 465 | { |
465 | 466 | Sleep(1000); |
466 | 467 | if(ApplyUpdates(UpdateDir, "updatebackup")) |
467 | - MessageBox(NULL, MSGJPN358, "FFFTP", MB_OK); | |
468 | + { | |
469 | + GetModuleFileName(NULL, Path, MAX_PATH); | |
470 | + strcpy(GetFileName(Path), "updatebackup"); | |
471 | + sprintf(Buf, MSGJPN358, Path); | |
472 | + MessageBox(NULL, Buf, "FFFTP", MB_OK); | |
473 | + } | |
468 | 474 | else |
469 | 475 | MessageBox(NULL, MSGJPN359, "FFFTP", MB_OK | MB_ICONERROR); |
470 | 476 | } |
@@ -356,7 +356,7 @@ | ||
356 | 356 | #define MSGJPN355 _Tu8("Move to &parent folder...", "Move to &parent folder...") |
357 | 357 | #define MSGJPN356 _Tu8("XML file\0*.xml\0All file\0*\0", "XML file\0*.xml\0All file\0*\0") |
358 | 358 | #define MSGJPN357 _Tu8("Failed to export the settings.\nPlease change saving path or format.", "Failed to export the settings.\nPlease change saving path or format.") |
359 | -#define MSGJPN358 _Tu8("Software update has been completed.", "Software update has been completed.") | |
359 | +#define MSGJPN358 _Tu8("Software update has been completed.\nA backup copy of the previous version is in the following location.\n%s", "Software update has been completed.\nA backup copy of the previous version is in the following location.\n%s") | |
360 | 360 | #define MSGJPN359 _Tu8("Failed to update the software.\nPlease get the latest version from our web site and update it manually.", "Failed to update the software.\nPlease get the latest version from our web site and update it manually.") |
361 | 361 | #define MSGJPN360 _Tu8("Updates", "Updates") |
362 | 362 | #define MSGJPN361 _Tu8("There is a new version.\n\nCurrent version: %s\nNew version: %s\n%s\n\nIt takes a few minutes to download the updates.\nDo you want to update now?\n", "There is a new version.\n\nCurrent version: %s\nNew version: %s\n%s\n\nIt takes a few minutes to download the updates.\nDo you want to update now?\n") |
@@ -356,7 +356,7 @@ | ||
356 | 356 | #define MSGJPN355 _Tu8("一つ上のフォルダへ移動(&P)...", "\xE4\xB8\x80\xE3\x81\xA4\xE4\xB8\x8A\xE3\x81\xAE\xE3\x83\x95\xE3\x82\xA9\xE3\x83\xAB\xE3\x83\x80\xE3\x81\xB8\xE7\xA7\xBB\xE5\x8B\x95(&P)...") |
357 | 357 | #define MSGJPN356 _Tu8("XMLファイル\0*.xml\0全てのファイル\0*\0", "XML\xE3\x83\x95\xE3\x82\xA1\xE3\x82\xA4\xE3\x83\xAB\0*.xml\0\xE5\x85\xA8\xE3\x81\xA6\xE3\x81\xAE\xE3\x83\x95\xE3\x82\xA1\xE3\x82\xA4\xE3\x83\xAB\0*\0") |
358 | 358 | #define MSGJPN357 _Tu8("設定のエクスポートに失敗しました.\n保存する場所や形式を変更してください.", "\xE8\xA8\xAD\xE5\xAE\x9A\xE3\x81\xAE\xE3\x82\xA8\xE3\x82\xAF\xE3\x82\xB9\xE3\x83\x9D\xE3\x83\xBC\xE3\x83\x88\xE3\x81\xAB\xE5\xA4\xB1\xE6\x95\x97\xE3\x81\x97\xE3\x81\xBE\xE3\x81\x97\xE3\x81\x9F.\n\xE4\xBF\x9D\xE5\xAD\x98\xE3\x81\x99\xE3\x82\x8B\xE5\xA0\xB4\xE6\x89\x80\xE3\x82\x84\xE5\xBD\xA2\xE5\xBC\x8F\xE3\x82\x92\xE5\xA4\x89\xE6\x9B\xB4\xE3\x81\x97\xE3\x81\xA6\xE3\x81\x8F\xE3\x81\xA0\xE3\x81\x95\xE3\x81\x84.") |
359 | -#define MSGJPN358 _Tu8("ソフトウェアの更新が完了しました.", "\xE3\x82\xBD\xE3\x83\x95\xE3\x83\x88\xE3\x82\xA6\xE3\x82\xA7\xE3\x82\xA2\xE3\x81\xAE\xE6\x9B\xB4\xE6\x96\xB0\xE3\x81\x8C\xE5\xAE\x8C\xE4\xBA\x86\xE3\x81\x97\xE3\x81\xBE\xE3\x81\x97\xE3\x81\x9F.") | |
359 | +#define MSGJPN358 _Tu8("ソフトウェアの更新が完了しました.\n以前のバージョンのバックアップコピーは以下の場所にあります.\n%s", "\xE3\x82\xBD\xE3\x83\x95\xE3\x83\x88\xE3\x82\xA6\xE3\x82\xA7\xE3\x82\xA2\xE3\x81\xAE\xE6\x9B\xB4\xE6\x96\xB0\xE3\x81\x8C\xE5\xAE\x8C\xE4\xBA\x86\xE3\x81\x97\xE3\x81\xBE\xE3\x81\x97\xE3\x81\x9F.\n\xE4\xBB\xA5\xE5\x89\x8D\xE3\x81\xAE\xE3\x83\x90\xE3\x83\xBC\xE3\x82\xB8\xE3\x83\xA7\xE3\x83\xB3\xE3\x81\xAE\xE3\x83\x90\xE3\x83\x83\xE3\x82\xAF\xE3\x82\xA2\xE3\x83\x83\xE3\x83\x97\xE3\x82\xB3\xE3\x83\x94\xE3\x83\xBC\xE3\x81\xAF\xE4\xBB\xA5\xE4\xB8\x8B\xE3\x81\xAE\xE5\xA0\xB4\xE6\x89\x80\xE3\x81\xAB\xE3\x81\x82\xE3\x82\x8A\xE3\x81\xBE\xE3\x81\x99.\n%s") | |
360 | 360 | #define MSGJPN359 _Tu8("ソフトウェアの更新に失敗しました.\nWebサイトから最新版を入手して手動で更新してください.", "\xE3\x82\xBD\xE3\x83\x95\xE3\x83\x88\xE3\x82\xA6\xE3\x82\xA7\xE3\x82\xA2\xE3\x81\xAE\xE6\x9B\xB4\xE6\x96\xB0\xE3\x81\xAB\xE5\xA4\xB1\xE6\x95\x97\xE3\x81\x97\xE3\x81\xBE\xE3\x81\x97\xE3\x81\x9F.\nWeb\xE3\x82\xB5\xE3\x82\xA4\xE3\x83\x88\xE3\x81\x8B\xE3\x82\x89\xE6\x9C\x80\xE6\x96\xB0\xE7\x89\x88\xE3\x82\x92\xE5\x85\xA5\xE6\x89\x8B\xE3\x81\x97\xE3\x81\xA6\xE6\x89\x8B\xE5\x8B\x95\xE3\x81\xA7\xE6\x9B\xB4\xE6\x96\xB0\xE3\x81\x97\xE3\x81\xA6\xE3\x81\x8F\xE3\x81\xA0\xE3\x81\x95\xE3\x81\x84.") |
361 | 361 | #define MSGJPN360 _Tu8("更新", "\xE6\x9B\xB4\xE6\x96\xB0") |
362 | 362 | #define MSGJPN361 _Tu8("新しいバージョンがあります.\n\n現在のバージョン: %s\n新しいバージョン: %s\n%s\n\n更新のダウンロードには数分間かかります.\n今すぐ更新しますか.", "\xE6\x96\xB0\xE3\x81\x97\xE3\x81\x84\xE3\x83\x90\xE3\x83\xBC\xE3\x82\xB8\xE3\x83\xA7\xE3\x83\xB3\xE3\x81\x8C\xE3\x81\x82\xE3\x82\x8A\xE3\x81\xBE\xE3\x81\x99.\n\n\xE7\x8F\xBE\xE5\x9C\xA8\xE3\x81\xAE\xE3\x83\x90\xE3\x83\xBC\xE3\x82\xB8\xE3\x83\xA7\xE3\x83\xB3: %s\n\xE6\x96\xB0\xE3\x81\x97\xE3\x81\x84\xE3\x83\x90\xE3\x83\xBC\xE3\x82\xB8\xE3\x83\xA7\xE3\x83\xB3: %s\n%s\n\n\xE6\x9B\xB4\xE6\x96\xB0\xE3\x81\xAE\xE3\x83\x80\xE3\x82\xA6\xE3\x83\xB3\xE3\x83\xAD\xE3\x83\xBC\xE3\x83\x89\xE3\x81\xAB\xE3\x81\xAF\xE6\x95\xB0\xE5\x88\x86\xE9\x96\x93\xE3\x81\x8B\xE3\x81\x8B\xE3\x82\x8A\xE3\x81\xBE\xE3\x81\x99.\n\xE4\xBB\x8A\xE3\x81\x99\xE3\x81\x90\xE6\x9B\xB4\xE6\x96\xB0\xE3\x81\x97\xE3\x81\xBE\xE3\x81\x99\xE3\x81\x8B.") |
@@ -53,6 +53,10 @@ BOOL ReadFileViaHTTPW(void* pOut, DWORD Length, DWORD* pLength, LPCWSTR UserAgen | ||
53 | 53 | DWORD Buffer; |
54 | 54 | HINTERNET hConnect; |
55 | 55 | HINTERNET hRequest; |
56 | + WCHAR* Url; | |
57 | + WINHTTP_AUTOPROXY_OPTIONS AutoProxyOptions; | |
58 | + WINHTTP_PROXY_INFO ProxyInfo; | |
59 | + WINHTTP_CURRENT_USER_IE_PROXY_CONFIG ProxyConfig; | |
56 | 60 | bResult = FALSE; |
57 | 61 | if(hSession = WinHttpOpen(UserAgent, WINHTTP_ACCESS_TYPE_NO_PROXY, WINHTTP_NO_PROXY_NAME, WINHTTP_NO_PROXY_BYPASS, 0)) |
58 | 62 | { |
@@ -63,6 +67,64 @@ BOOL ReadFileViaHTTPW(void* pOut, DWORD Length, DWORD* pLength, LPCWSTR UserAgen | ||
63 | 67 | { |
64 | 68 | if(hRequest = WinHttpOpenRequest(hConnect, L"GET", ObjectName, NULL, WINHTTP_NO_REFERER, WINHTTP_DEFAULT_ACCEPT_TYPES, 0)) |
65 | 69 | { |
70 | + if(Url = (WCHAR*)malloc(sizeof(WCHAR) * (wcslen(L"http://") + wcslen(ServerName) + wcslen(ObjectName) + 1))) | |
71 | + { | |
72 | + wcscpy(Url, L"http://"); | |
73 | + wcscat(Url, ServerName); | |
74 | + wcscat(Url, ObjectName); | |
75 | + } | |
76 | + memset(&AutoProxyOptions, 0, sizeof(WINHTTP_AUTOPROXY_OPTIONS)); | |
77 | + AutoProxyOptions.dwFlags = WINHTTP_AUTOPROXY_AUTO_DETECT; | |
78 | + AutoProxyOptions.dwAutoDetectFlags = WINHTTP_AUTO_DETECT_TYPE_DHCP | WINHTTP_AUTO_DETECT_TYPE_DNS_A; | |
79 | + AutoProxyOptions.fAutoLogonIfChallenged = TRUE; | |
80 | + memset(&ProxyInfo, 0, sizeof(WINHTTP_PROXY_INFO)); | |
81 | + memset(&ProxyConfig, 0, sizeof(WINHTTP_CURRENT_USER_IE_PROXY_CONFIG)); | |
82 | + if(WinHttpGetProxyForUrl(hSession, Url, &AutoProxyOptions, &ProxyInfo)) | |
83 | + { | |
84 | + WinHttpSetOption(hRequest, WINHTTP_OPTION_PROXY, &ProxyInfo, sizeof(WINHTTP_PROXY_INFO)); | |
85 | + if(ProxyInfo.lpszProxy) | |
86 | + GlobalFree(ProxyInfo.lpszProxy); | |
87 | + if(ProxyInfo.lpszProxyBypass) | |
88 | + GlobalFree(ProxyInfo.lpszProxyBypass); | |
89 | + } | |
90 | + else if(WinHttpGetIEProxyConfigForCurrentUser(&ProxyConfig)) | |
91 | + { | |
92 | + if(!ProxyConfig.fAutoDetect) | |
93 | + { | |
94 | + if(ProxyConfig.lpszAutoConfigUrl) | |
95 | + { | |
96 | + memset(&AutoProxyOptions, 0, sizeof(WINHTTP_AUTOPROXY_OPTIONS)); | |
97 | + AutoProxyOptions.dwFlags = WINHTTP_AUTOPROXY_CONFIG_URL; | |
98 | + AutoProxyOptions.lpszAutoConfigUrl = ProxyConfig.lpszAutoConfigUrl; | |
99 | + AutoProxyOptions.fAutoLogonIfChallenged = TRUE; | |
100 | + memset(&ProxyInfo, 0, sizeof(WINHTTP_PROXY_INFO)); | |
101 | + if(WinHttpGetProxyForUrl(hSession, Url, &AutoProxyOptions, &ProxyInfo)) | |
102 | + { | |
103 | + WinHttpSetOption(hRequest, WINHTTP_OPTION_PROXY, &ProxyInfo, sizeof(WINHTTP_PROXY_INFO)); | |
104 | + if(ProxyInfo.lpszProxy) | |
105 | + GlobalFree(ProxyInfo.lpszProxy); | |
106 | + if(ProxyInfo.lpszProxyBypass) | |
107 | + GlobalFree(ProxyInfo.lpszProxyBypass); | |
108 | + } | |
109 | + } | |
110 | + else | |
111 | + { | |
112 | + memset(&ProxyInfo, 0, sizeof(WINHTTP_PROXY_INFO)); | |
113 | + ProxyInfo.dwAccessType = WINHTTP_ACCESS_TYPE_NAMED_PROXY; | |
114 | + ProxyInfo.lpszProxy = ProxyConfig.lpszProxy; | |
115 | + ProxyInfo.lpszProxyBypass = ProxyConfig.lpszProxyBypass; | |
116 | + WinHttpSetOption(hRequest, WINHTTP_OPTION_PROXY, &ProxyInfo, sizeof(WINHTTP_PROXY_INFO)); | |
117 | + } | |
118 | + } | |
119 | + if(ProxyConfig.lpszAutoConfigUrl) | |
120 | + GlobalFree(ProxyConfig.lpszAutoConfigUrl); | |
121 | + if(ProxyConfig.lpszProxy) | |
122 | + GlobalFree(ProxyConfig.lpszProxy); | |
123 | + if(ProxyConfig.lpszProxyBypass) | |
124 | + GlobalFree(ProxyConfig.lpszProxyBypass); | |
125 | + } | |
126 | + if(Url) | |
127 | + free(Url); | |
66 | 128 | if(WinHttpSendRequest(hRequest, WINHTTP_NO_ADDITIONAL_HEADERS, 0, WINHTTP_NO_REQUEST_DATA, 0, 0, 0)) |
67 | 129 | { |
68 | 130 | if(WinHttpReceiveResponse(hRequest, NULL)) |