diff options
-rw-r--r-- | updater/extern.cpp | 33 | ||||
-rw-r--r-- | updater/updater.dsp | 11 | ||||
-rw-r--r-- | updater/updater_9.vcproj | 58 |
3 files changed, 37 insertions, 65 deletions
diff --git a/updater/extern.cpp b/updater/extern.cpp index 915067d..565ba63 100644 --- a/updater/extern.cpp +++ b/updater/extern.cpp @@ -119,26 +119,23 @@ int ExternProcess(bool restart) { GetModuleFileName(hInst, szBuf, MAX_PATH);
}
-#ifdef _WIN64
- mir_sntprintf(szParams, SIZEOF(szParams), _T("RUNDLL32.EXE \"%s\",ExternalUpdate %s"), szBuf, data_filename);
- szProcDir = NULL;
-#else
- p = _tcsrchr(szBuf, _T('\\'));
- if (p) *p = 0;
- szProcDir = szBuf;
+ if (IsWinVerXPPlus())
+ {
+ mir_sntprintf(szParams, SIZEOF(szParams), _T("RUNDLL32.EXE \"%s\",ExternalUpdate %s"), szBuf, data_filename);
+ szProcDir = NULL;
+ }
+ else
+ {
+ p = _tcsrchr(szBuf, _T('\\'));
+ if (p) *p = 0;
+ szProcDir = szBuf;
- // rundll32 hates spaces in the <dll name> arg, but quotes aren't allowed in earlier versions...
- // GetShortPath can return paths with spaces (at least on XP with 8.3 filenames disabled)...
- // so we must 'CreateProcess' with the updater.dll location as the startup directory and pass only updater.dll as the arg
+ // rundll32 hates spaces in the <dll name> arg, but quotes aren't allowed in earlier versions...
+ // GetShortPath can return paths with spaces (at least on XP with 8.3 filenames disabled)...
+ // so we must 'CreateProcess' with the updater.dll location as the startup directory and pass only updater.dll as the arg
-#ifdef _MSC_VER
- // MSVC exports differently than gcc/mingw
- _stprintf(szParams, _T("RUNDLL32.EXE .\\updater.dll,_ExternalUpdate@16 %s"), data_filename);
-#else
- _stprintf(szParams, _T("RUNDLL32.EXE .\\updater.dll,ExternalUpdate@16 %s"), data_filename);
-#endif
-
-#endif
+ mir_sntprintf(szParams, SIZEOF(szParams), _T("RUNDLL32.EXE .\\updater.dll,ExternalUpdate %s"), data_filename);
+ }
PROCESS_INFORMATION pi = {0};
STARTUPINFO si = {0};
diff --git a/updater/updater.dsp b/updater/updater.dsp index 9c5e41a..b5baf79 100644 --- a/updater/updater.dsp +++ b/updater/updater.dsp @@ -165,21 +165,14 @@ SOURCE=.\conf_dialog.cpp !IF "$(CFG)" == "updater - Win32 Release"
-# ADD CPP /I "../../../include" /I "zbin"
-
!ELSEIF "$(CFG)" == "updater - Win32 Debug"
-# ADD CPP /I "../../../include" /I "zbin"
-
!ELSEIF "$(CFG)" == "updater - Win32 Release Unicode"
-# ADD CPP /I "../../include"
# SUBTRACT CPP /I "."
!ELSEIF "$(CFG)" == "updater - Win32 Debug Unicode"
-# ADD CPP /I "../../../include" /I "zbin"
-
!ENDIF
# End Source File
@@ -225,6 +218,10 @@ SOURCE=.\updater.cpp # End Source File
# Begin Source File
+SOURCE=.\updater.def
+# End Source File
+# Begin Source File
+
SOURCE=.\utils.cpp
# End Source File
# Begin Source File
diff --git a/updater/updater_9.vcproj b/updater/updater_9.vcproj index 880ce32..7feb7e6 100644 --- a/updater/updater_9.vcproj +++ b/updater/updater_9.vcproj @@ -51,14 +51,11 @@ <Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="zlib123;../../include;..\..\..\include"
+ AdditionalIncludeDirectories="zbin;../../include;..\..\..\include"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;UPDATER_EXPORTS;UNICODE"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
PrecompiledHeaderThrough="common.h"
- AssemblerListingLocation=".\updater___Win32_Debug_Unicode/"
- ObjectFile=".\updater___Win32_Debug_Unicode/"
- ProgramDataBaseFileName=".\updater___Win32_Debug_Unicode/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="true"
@@ -79,19 +76,18 @@ />
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="comctl32.lib ws2_32.lib"
+ AdditionalDependencies="comctl32.lib zlib.lib"
OutputFile="c:\miranda im 32\plugins\$(ProjectName).dll"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="zbin/x32"
ModuleDefinitionFile="updater.def"
GenerateDebugInformation="true"
- ProgramDatabaseFile=".\updater___Win32_Debug_Unicode/updater.pdb"
GenerateMapFile="true"
MapExports="true"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
- ImportLibrary="$(IntDir)/$(TargetName).lib"
+ ImportLibrary=""
TargetMachine="1"
/>
<Tool
@@ -149,14 +145,12 @@ <Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="zlib123;../../include;..\..\..\include"
+ AdditionalIncludeDirectories="zbin;../../include;..\..\..\include"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;UPDATER_EXPORTS;_CRT_SECURE_NO_WARNINGS"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
PrecompiledHeaderThrough="common.h"
AssemblerListingLocation=".\updater___Win32_Debug_Unicode/"
- ObjectFile=".\updater___Win32_Debug_Unicode/"
- ProgramDataBaseFileName=".\updater___Win32_Debug_Unicode/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="true"
@@ -177,7 +171,7 @@ />
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="comctl32.lib ws2_32.lib"
+ AdditionalDependencies="comctl32.lib zlib.lib"
OutputFile="c:\Miranda IM\plugins\updater.dll"
LinkIncremental="1"
SuppressStartupBanner="true"
@@ -247,14 +241,11 @@ <Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="zlib123;../../include;..\..\..\include"
+ AdditionalIncludeDirectories="zbin;../../include;..\..\..\include"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;UPDATER_EXPORTS"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
PrecompiledHeaderThrough="common.h"
- AssemblerListingLocation=".\Debug/"
- ObjectFile=".\Debug/"
- ProgramDataBaseFileName=".\Debug/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="true"
@@ -275,19 +266,18 @@ />
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="comctl32.lib ws2_32.lib"
+ AdditionalDependencies="comctl32.lib zlib.lib"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="zbin/x32"
ModuleDefinitionFile="updater.def"
GenerateDebugInformation="true"
- ProgramDatabaseFile=".\Debug/updater.pdb"
GenerateMapFile="true"
MapExports="true"
SubSystem="0"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
- ImportLibrary="$(IntDir)/$(TargetName).lib"
+ ImportLibrary=""
TargetMachine="1"
/>
<Tool
@@ -345,14 +335,12 @@ <Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="zlib123;../../include;..\..\..\include"
+ AdditionalIncludeDirectories="zbin;../../include;..\..\..\include"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;UPDATER_EXPORTS"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
PrecompiledHeaderThrough="common.h"
AssemblerListingLocation=".\Debug/"
- ObjectFile=".\Debug/"
- ProgramDataBaseFileName=".\Debug/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="true"
@@ -373,7 +361,7 @@ />
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="comctl32.lib ws2_32.lib"
+ AdditionalDependencies="comctl32.lib zlib.lib"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="zbin/x64"
@@ -446,7 +434,7 @@ InlineFunctionExpansion="1"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="2"
- AdditionalIncludeDirectories="zlib123;../../include;..\..\..\include"
+ AdditionalIncludeDirectories="zbin;../../include;..\..\..\include"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;UPDATER_EXPORTS;UNICODE"
StringPooling="true"
RuntimeLibrary="2"
@@ -455,9 +443,6 @@ FloatingPointModel="2"
RuntimeTypeInfo="false"
PrecompiledHeaderThrough="common.h"
- AssemblerListingLocation=".\updater___Win32_Release_Unicode/"
- ObjectFile=".\updater___Win32_Release_Unicode/"
- ProgramDataBaseFileName=".\updater___Win32_Release_Unicode/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="true"
@@ -478,20 +463,19 @@ <Tool
Name="VCLinkerTool"
IgnoreImportLibrary="true"
- AdditionalDependencies="comctl32.lib ws2_32.lib"
+ AdditionalDependencies="comctl32.lib zlib.lib"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="zbin/x32"
GenerateManifest="false"
ModuleDefinitionFile="updater.def"
GenerateDebugInformation="true"
- ProgramDatabaseFile=".\updater___Win32_Release_Unicode/updater.pdb"
OptimizeReferences="2"
EnableCOMDATFolding="2"
BaseAddress="0x22000000"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
- ImportLibrary="$(IntDir)/$(TargetName).lib"
+ ImportLibrary=""
TargetMachine="1"
/>
<Tool
@@ -653,7 +637,7 @@ InlineFunctionExpansion="1"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="2"
- AdditionalIncludeDirectories="zlib123;../../include;..\..\..\include"
+ AdditionalIncludeDirectories="zbin;../../include;..\..\..\include"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;UPDATER_EXPORTS"
StringPooling="true"
RuntimeLibrary="2"
@@ -662,9 +646,6 @@ FloatingPointModel="2"
RuntimeTypeInfo="false"
PrecompiledHeaderThrough="common.h"
- AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="true"
@@ -686,20 +667,19 @@ <Tool
Name="VCLinkerTool"
IgnoreImportLibrary="true"
- AdditionalDependencies="comctl32.lib ws2_32.lib"
+ AdditionalDependencies="comctl32.lib zlib.lib"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="zbin/x32"
GenerateManifest="false"
ModuleDefinitionFile="updater.def"
GenerateDebugInformation="true"
- ProgramDatabaseFile=".\Release/updater.pdb"
OptimizeReferences="2"
EnableCOMDATFolding="2"
BaseAddress="0x22000000"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
- ImportLibrary="$(IntDir)/$(TargetName).lib"
+ ImportLibrary=""
TargetMachine="1"
/>
<Tool
@@ -760,7 +740,7 @@ InlineFunctionExpansion="1"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="2"
- AdditionalIncludeDirectories="zlib123;../../include;..\..\..\include"
+ AdditionalIncludeDirectories="zbin;../../include;..\..\..\include"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;UPDATER_EXPORTS"
StringPooling="true"
RuntimeLibrary="2"
@@ -770,8 +750,6 @@ RuntimeTypeInfo="false"
PrecompiledHeaderThrough="common.h"
AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="true"
@@ -793,7 +771,7 @@ <Tool
Name="VCLinkerTool"
IgnoreImportLibrary="true"
- AdditionalDependencies="comctl32.lib ws2_32.lib"
+ AdditionalDependencies="comctl32.lib zlib.lib"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="zbin/x64"
|