mirror of
https://github.com/Open-Shell/Open-Shell-Menu.git
synced 2026-04-11 17:37:22 +10:00
Setup: Remove warning about very old ClassicShell version
Latest version of ClassicShell was 4.3.1. There is no reason to display any warning about very old versions (< 2.0.0). Besides, this will remove dependency on version.dll which could be misused for DLL hijacking attack. Fixes #72
This commit is contained in:
@@ -16,7 +16,6 @@
|
||||
// It unpacks the right installer into the temp directory and executes it.
|
||||
|
||||
typedef BOOL (WINAPI *FIsWow64Process)( HANDLE hProcess, PBOOL Wow64Process );
|
||||
typedef BOOL (WINAPI *FQueryFullProcessImageName)( HANDLE hProcess, DWORD dwFlags, LPTSTR lpExeName, PDWORD lpdwSize );
|
||||
|
||||
|
||||
|
||||
@@ -326,49 +325,6 @@ int APIENTRY wWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCm
|
||||
BOOL b64=FALSE;
|
||||
isWow64Process(GetCurrentProcess(),&b64);
|
||||
|
||||
// look for an old version of the classic start menu (2.0.0 or older) and show a warning if it is still running. the uninstaller for such old versions doesn't close the start menu
|
||||
HWND hwnd=FindWindow(L"ClassicStartMenu.CStartHookWindow",L"StartHookWindow");
|
||||
if (hwnd)
|
||||
{
|
||||
bool bStartMenu=false;
|
||||
|
||||
DWORD id;
|
||||
GetWindowThreadProcessId(hwnd,&id);
|
||||
HANDLE process=OpenProcess(PROCESS_QUERY_INFORMATION|PROCESS_VM_READ,FALSE,id);
|
||||
if (process)
|
||||
{
|
||||
bStartMenu=true;
|
||||
wchar_t path[_MAX_PATH];
|
||||
DWORD size=_countof(path);
|
||||
|
||||
FQueryFullProcessImageName queryFullProcessImageName=(FQueryFullProcessImageName)GetProcAddress(hKernel32,"QueryFullProcessImageNameW");
|
||||
if (queryFullProcessImageName && queryFullProcessImageName(process,0,path,&size))
|
||||
{
|
||||
DWORD q;
|
||||
DWORD size=GetFileVersionInfoSize(path,&q);
|
||||
if (size)
|
||||
{
|
||||
std::vector<char> buf(size);
|
||||
if (GetFileVersionInfo(path,0,size,&buf[0]))
|
||||
{
|
||||
VS_FIXEDFILEINFO *pVer;
|
||||
UINT len;
|
||||
if (VerQueryValue(&buf[0],L"\\",(void**)&pVer,&len) && pVer->dwProductVersionMS>0x20000)
|
||||
bStartMenu=false;
|
||||
}
|
||||
}
|
||||
}
|
||||
CloseHandle(process);
|
||||
}
|
||||
if (bStartMenu)
|
||||
{
|
||||
wchar_t strTitle[256];
|
||||
if (!LoadString(hInstance,IDS_APP_TITLE,strTitle,_countof(strTitle))) strTitle[0]=0;
|
||||
wchar_t strText[1024];
|
||||
if (!LoadString(hInstance,IDS_OLDSTARTMENU,strText,_countof(strText))) strText[0]=0;
|
||||
MessageBox(NULL,strText,strTitle,MB_OK|MB_ICONWARNING);
|
||||
}
|
||||
}
|
||||
/*
|
||||
// warning about being beta
|
||||
if (!bQuiet)
|
||||
|
||||
@@ -148,7 +148,6 @@ END
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
IDS_APP_TITLE "Open-Shell Setup"
|
||||
IDS_OLDSTARTMENU "Warning!\nAn old version of the classic start menu is still running. Please close it before installing the new version to avoid crashing Explorer. Right click on the start button and select ""Exit""."
|
||||
IDS_ERR_CORRUPTED "Failed to extract setup file '%s'. The MSI resource is corrupted."
|
||||
END
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#define IDS_APP_NAME 100
|
||||
#define IDS_APP_TITLE 100
|
||||
#define IDI_APPICON 101
|
||||
#define IDS_OLDSTARTMENU 101
|
||||
#define IDS_ERR_CORRUPTED 102
|
||||
#define IDR_MSI_FILE32 132
|
||||
#define IDR_MSI_FILE64 164
|
||||
|
||||
Reference in New Issue
Block a user