From cbe3cb21f5bca61a03bbd4ae811ee906e09b3f4f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 13 Jun 2015 16:55:17 +0000 Subject: - miranda32.exe now does nothing bug extends PATH to %miranda_root%\libs and loads mir_app.dll; - everything that was in miranda32.exe (including resources) moved to mir_app.dll; - exports from mir_app.dll now available for using directly, without perversions; - src/stdplug.h deleted; git-svn-id: http://svn.miranda-ng.org/main/trunk@14143 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/miranda32/miranda32.vcxproj | 30 ++++++++++++++++ src/miranda32/miranda32.vcxproj.filters | 4 +++ src/miranda32/res/miranda32.exe.manifest | 25 +++++++++++++ src/miranda32/res/resource.rc | 21 +++++++++++ src/miranda32/res/version.rc | 53 +++++++++++++++++++++++++++ src/miranda32/src/miranda.cpp | 62 ++++++++++++++++++++++++++++++++ src/miranda32/src/stdafx.cxx | 19 ++++++++++ src/miranda32/src/stdafx.h | 28 +++++++++++++++ 8 files changed, 242 insertions(+) create mode 100644 src/miranda32/miranda32.vcxproj create mode 100644 src/miranda32/miranda32.vcxproj.filters create mode 100644 src/miranda32/res/miranda32.exe.manifest create mode 100644 src/miranda32/res/resource.rc create mode 100644 src/miranda32/res/version.rc create mode 100644 src/miranda32/src/miranda.cpp create mode 100644 src/miranda32/src/stdafx.cxx create mode 100644 src/miranda32/src/stdafx.h (limited to 'src/miranda32') diff --git a/src/miranda32/miranda32.vcxproj b/src/miranda32/miranda32.vcxproj new file mode 100644 index 0000000000..e6037379a5 --- /dev/null +++ b/src/miranda32/miranda32.vcxproj @@ -0,0 +1,30 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + Miranda + Miranda32 + Miranda64 + {F9916510-9055-4C9F-997A-3755DEC1511B} + + + + + \ No newline at end of file diff --git a/src/miranda32/miranda32.vcxproj.filters b/src/miranda32/miranda32.vcxproj.filters new file mode 100644 index 0000000000..de5ad9f66c --- /dev/null +++ b/src/miranda32/miranda32.vcxproj.filters @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/miranda32/res/miranda32.exe.manifest b/src/miranda32/res/miranda32.exe.manifest new file mode 100644 index 0000000000..b0c140a148 --- /dev/null +++ b/src/miranda32/res/miranda32.exe.manifest @@ -0,0 +1,25 @@ + + + Miranda + + + + + + + + + + + + + + + + + + + + diff --git a/src/miranda32/res/resource.rc b/src/miranda32/res/resource.rc new file mode 100644 index 0000000000..ae457d069e --- /dev/null +++ b/src/miranda32/res/resource.rc @@ -0,0 +1,21 @@ +// Microsoft Visual C++ generated resource script. +// +#include "..\..\mir_app\src\resource.h" + +#include +#include + +///////////////////////////////////////////////////////////////////////////// +// English (United States) resources + +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_MIRANDA ICON "../../mir_app/res/miranda_logo.ico" diff --git a/src/miranda32/res/version.rc b/src/miranda32/res/version.rc new file mode 100644 index 0000000000..8f42a6229f --- /dev/null +++ b/src/miranda32/res/version.rc @@ -0,0 +1,53 @@ +#ifdef APSTUDIO_INVOKED +#error this file is not editable by Microsoft Visual C++ +#endif //APSTUDIO_INVOKED + +#include +#include + +#include "../../include/m_version.h" + +#ifndef _MAC +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION MIRANDA_VERSION_FILEVERSION + PRODUCTVERSION MIRANDA_VERSION_FILEVERSION + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "000004b0" + BEGIN + VALUE "Comments", "Licensed under the terms of the GNU General Public License\0" + VALUE "CompanyName", "Miranda NG Team\0" + VALUE "FileDescription", "Miranda NG\0" + VALUE "FileVersion", MIRANDA_VERSION_DISPLAY + VALUE "InternalName", "miranda32\0" + VALUE "LegalCopyright", "Copyright © 2000-11 Miranda IM, 2012-15 Miranda NG project. This software is released under the terms of the GNU General Public License.\0" + VALUE "LegalTrademarks", "\0" + VALUE "OriginalFilename", "miranda32.exe\0" + VALUE "PrivateBuild", "\0" + VALUE "ProductName", "Miranda NG\0" + VALUE "ProductVersion", MIRANDA_VERSION_DISPLAY + VALUE "SpecialBuild", "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0, 1200 + END +END + +#endif // !_MAC diff --git a/src/miranda32/src/miranda.cpp b/src/miranda32/src/miranda.cpp new file mode 100644 index 0000000000..029c56562f --- /dev/null +++ b/src/miranda32/src/miranda.cpp @@ -0,0 +1,62 @@ +/* + +Miranda NG: the free IM client for Microsoft* Windows* + +Copyright (ñ) 2012-15 Miranda NG project (http://miranda-ng.org), +all portions of this codebase are copyrighted to the people +listed in contributors.txt. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ + +#include "stdafx.h" + +int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE, LPTSTR cmdLine, int) +{ + TCHAR tszPath[MAX_PATH]; + GetModuleFileName(hInstance, tszPath, _countof(tszPath)); + + TCHAR *p = _tcsrchr(tszPath, '\\'); + if (p) + p[1] = 0; + + _tcsncat(tszPath, _T("libs"), _TRUNCATE); + DWORD cbPath = (DWORD)_tcslen(tszPath); + + DWORD cbSize = GetEnvironmentVariable(_T("PATH"), NULL, 0); + TCHAR *ptszVal = new TCHAR[cbSize + MAX_PATH + 2]; + _tcscpy(ptszVal, tszPath); + _tcscat(ptszVal, _T(";")); + GetEnvironmentVariable(_T("PATH"), ptszVal + cbPath + 1, cbSize); + SetEnvironmentVariable(_T("PATH"), ptszVal); + + HINSTANCE hMirApp = LoadLibraryA("mir_app.dll"); + if (hMirApp == NULL) { + MessageBox(NULL, _T("mir_app.dll cannot be loaded"), _T("Fatal error"), MB_ICONERROR | MB_OK); + return 1; + } + + typedef int (WINAPI *pfnMain)(LPTSTR); + pfnMain fnMain = (pfnMain)GetProcAddress(hMirApp, "mir_main"); + if (fnMain == NULL) { + MessageBox(NULL, _T("invalid mir_app.dll present, program exiting"), _T("Fatal error"), MB_ICONERROR | MB_OK); + return 2; + } + + int retVal = fnMain(cmdLine); + FreeLibrary(hMirApp); + return retVal; +} diff --git a/src/miranda32/src/stdafx.cxx b/src/miranda32/src/stdafx.cxx new file mode 100644 index 0000000000..5d3cae4e8e --- /dev/null +++ b/src/miranda32/src/stdafx.cxx @@ -0,0 +1,19 @@ +/* + +Copyright (C) 2012-15 Miranda NG team (http://miranda-ng.org) + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation version 2 +of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include "stdafx.h" \ No newline at end of file diff --git a/src/miranda32/src/stdafx.h b/src/miranda32/src/stdafx.h new file mode 100644 index 0000000000..4d29d7be51 --- /dev/null +++ b/src/miranda32/src/stdafx.h @@ -0,0 +1,28 @@ +/* + +Miranda NG: the free IM client for Microsoft* Windows* + +Copyright (ñ) 2012-15 Miranda NG project (http://miranda-ng.org), +Copyright (c) 2000-12 Miranda IM project, +all portions of this codebase are copyrighted to the people +listed in contributors.txt. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include + +#include + -- cgit v1.2.3