[NEW] Prevent from launching updater under XP due to the obsolet security

layer
This commit is contained in:
Don Ho 2015-05-22 21:11:08 +02:00
parent f74bb0813b
commit d3c7ade18c
4 changed files with 35 additions and 23 deletions

View File

@ -832,7 +832,7 @@ BEGIN
POPUP "&?"
BEGIN
MENUITEM "Help Contents", IDM_HELP
//MENUITEM "Help Contents", IDM_HELP
MENUITEM "Command Line Arguments...", IDM_CMDLINEARGUMENTS
MENUITEM SEPARATOR
MENUITEM "Notepad++ Home", IDM_HOMESWEETHOME
@ -876,7 +876,7 @@ BEGIN
LTEXT "Author :",IDC_STATIC,21,45,31,8
LTEXT "Notepad++ team",IDC_AUTHOR_NAME,78,45,70,8
LTEXT "Home Page :",IDC_STATIC,21,59,47,8
LTEXT "http://notepad-plus-plus.org/",IDC_HOME_ADDR,78,59,126,8
LTEXT "https://notepad-plus-plus.org/",IDC_HOME_ADDR,78,59,126,8
GROUPBOX "GNU General Public Licence",IDC_STATIC,19,75,231,131,BS_CENTER
DEFPUSHBUTTON "OK",IDOK,106,215,50,14,BS_FLAT,WS_EX_STATICEDGE
// IDC_LICENCE_EDIT should be the last line, don't know why

View File

@ -2197,12 +2197,12 @@ void Notepad_plus::command(int id)
case IDM_HOMESWEETHOME :
{
::ShellExecute(NULL, TEXT("open"), TEXT("http://notepad-plus-plus.org/"), NULL, NULL, SW_SHOWNORMAL);
::ShellExecute(NULL, TEXT("open"), TEXT("https://notepad-plus-plus.org/"), NULL, NULL, SW_SHOWNORMAL);
break;
}
case IDM_PROJECTPAGE :
{
::ShellExecute(NULL, TEXT("open"), TEXT("http://sourceforge.net/projects/notepad-plus/"), NULL, NULL, SW_SHOWNORMAL);
::ShellExecute(NULL, TEXT("open"), TEXT("https://github.com/donho/notepad-plus-plus/"), NULL, NULL, SW_SHOWNORMAL);
break;
}
@ -2232,9 +2232,21 @@ void Notepad_plus::command(int id)
case IDM_UPDATE_NPP :
case IDM_CONFUPDATERPROXY :
{
// wingup doesn't work with the obsolet security layer (API) under xp since downloadings are secured with SSL on notepad_plus_plus.org
winVer ver = NppParameters::getInstance()->getWinVersion();
if (ver <= WV_XP)
{
long res = ::MessageBox(NULL, TEXT("Notepad++ updater is not compatible with XP due to its obsolet security layer.\rDo you want to go to Notepad++ page to download it?"), TEXT("Notepad++ Updater"), MB_OK);
if (res == IDYES)
{
::ShellExecute(NULL, TEXT("open"), TEXT("https://notepad-plus-plus.org/download/"), NULL, NULL, SW_SHOWNORMAL);
}
}
else
{
generic_string updaterDir = (NppParameters::getInstance())->getNppPath();
PathAppend(updaterDir ,TEXT("updater"));
PathAppend(updaterDir, TEXT("updater"));
generic_string updaterFullPath = updaterDir;
PathAppend(updaterFullPath, TEXT("gup.exe"));
@ -2248,6 +2260,7 @@ void Notepad_plus::command(int id)
Process updater(updaterFullPath.c_str(), param.c_str(), updaterDir.c_str());
updater.run();
}
break;
}

View File

@ -58,13 +58,10 @@ BOOL CALLBACK AboutDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam)
_emailLink.init(_hInst, _hSelf);
//_emailLink.create(::GetDlgItem(_hSelf, IDC_AUTHOR_NAME), TEXT("mailto:don.h@free.fr"));
_emailLink.create(::GetDlgItem(_hSelf, IDC_AUTHOR_NAME), TEXT("http://notepad-plus-plus.org/contributors"));
_emailLink.create(::GetDlgItem(_hSelf, IDC_AUTHOR_NAME), TEXT("https://notepad-plus-plus.org/contributors"));
_pageLink.init(_hInst, _hSelf);
_pageLink.create(::GetDlgItem(_hSelf, IDC_HOME_ADDR), TEXT("http://notepad-plus-plus.org/"));
//_onLineHelp.init(_hInst, _hSelf);
//_onLineHelp.create(::GetDlgItem(_hSelf, IDC_ONLINEHELP_ADDR), TEXT("http://notepad-plus.sourceforge.net/uk/generalFAQ.php"));
_pageLink.create(::GetDlgItem(_hSelf, IDC_HOME_ADDR), TEXT("https://notepad-plus-plus.org/"));
getClientRect(_rc);

View File

@ -411,7 +411,10 @@ DEVOMER*/
doUpdate = false;
}
if (TheFirstOne && isUpExist && doUpdate)
// wingup doesn't work with the obsolet security layer (API) under xp since downloadings are secured with SSL on notepad_plus_plus.org
winVer ver = pNppParameters->getWinVersion();
bool isGtXP = ver > WV_XP;
if (TheFirstOne && isUpExist && doUpdate && isGtXP)
{
Process updater(updaterFullPath.c_str(), version.c_str(), updaterDir.c_str());
updater.run();
@ -430,7 +433,6 @@ DEVOMER*/
// Tell UAC that lower integrity processes are allowed to send WM_COPYDATA messages to this process (or window)
// This allows opening new files to already opened elevated Notepad++ process via explorer context menu.
winVer ver = pNppParameters->getWinVersion();
if (ver >= WV_VISTA || ver == WV_UNKNOWN)
{
HMODULE hDll = GetModuleHandle(TEXT("user32.dll"));