Browse files

License Headers added to files

Added backup facility for copy
Fixed a bug with copy not checking the md5 correctly
Fixed a bug with MD5 that made incorrect md5sum's were generated

Fixed solution so that debug and release both build correctly for ansi and unicode

Added author, homepage and source url to description
Fixed timing issue if plugin manager was opened before plugins.xml was downloaded
Fixed bug if install/update/remove was clicked whilst still downloading the plugins.xml

Fixed bug if plugin dll file did not have a FileVersion property, but did have a versioninfo structure

Added category to plugin
Fixed message box parents all over the place, so they are now all owned ultimately by N++
Some fixes for the ANSI build - mostly excluding char forms of functions if ANSI build is in use
Centred all dialogs

Added check to ensure gpup.exe exists.
Added reinstall button to installed tab
  • Loading branch information...
1 parent f6fda49 commit a6a42b25b78345c44b618dd6fc09ff74fe3d1811 @bruderstein committed Jul 12, 2009
Showing with 2,680 additions and 238 deletions.
  1. +129 −4 NppPlugin/projects/2005/NppPlugin.vcproj
  2. +128 −3 TinyXml/projects/2005/TinyXml.vcproj
  3. +177 −7 gpup/projects/2005/gpup.vcproj
  4. +21 −0 gpup/src/Options.cpp
  5. +20 −0 gpup/src/Options.h
  6. +24 −4 gpup/src/gpup.cpp
  7. +20 −0 gpup/src/gpup.h
  8. +20 −0 gpup/src/stdafx.cpp
  9. +20 −0 gpup/src/stdafx.h
  10. +21 −0 gpup/src/tstring.h
  11. +24 −3 libinstall/include/libinstall/CopyStep.h
  12. +19 −0 libinstall/include/libinstall/Decompress.h
  13. +20 −1 libinstall/include/libinstall/DeleteStep.h
  14. +19 −0 libinstall/include/libinstall/DirectLinkSearch.h
  15. +37 −0 libinstall/include/libinstall/DirectoryUtil.h
  16. +19 −0 libinstall/include/libinstall/DownloadManager.h
  17. +20 −1 libinstall/include/libinstall/DownloadStep.h
  18. +19 −0 libinstall/include/libinstall/FileBuffer.h
  19. +21 −1 libinstall/include/libinstall/InstallStep.h
  20. +19 −1 libinstall/include/libinstall/InstallStepFactory.h
  21. +19 −0 libinstall/include/libinstall/VariableHandler.h
  22. +25 −1 libinstall/include/libinstall/WcharMbcsConverter.h
  23. +19 −0 libinstall/include/libinstall/md5.h
  24. +18 −0 libinstall/include/libinstall/tstring.h
  25. +140 −7 libinstall/projects/2005/libinstall.vcproj
  26. +85 −20 libinstall/src/CopyStep.cpp
  27. +62 −9 libinstall/src/Decompress.cpp
  28. +21 −1 libinstall/src/DeleteStep.cpp
  29. +18 −0 libinstall/src/DirectLinkSearch.cpp
  30. +73 −0 libinstall/src/DirectoryUtil.cpp
  31. +2 −2 libinstall/src/DownloadStep.cpp
  32. +19 −0 libinstall/src/FileBuffer.cpp
  33. +28 −2 libinstall/src/InstallStepFactory.cpp
  34. +19 −0 libinstall/src/VariableHandler.cpp
  35. +24 −3 libinstall/src/WcharMbcsConverter.cpp
  36. +35 −8 libinstall/src/md5.cpp
  37. +66 −0 pluginManager/projects/2005/PluginManager.sln
  38. +169 −15 pluginManager/projects/2005/PluginManager.vcproj
  39. +3 −0 pluginManager/src/AboutDlg/AboutDialog.cpp
  40. +160 −0 pluginManager/src/NotifyUpdatesDialog.cpp
  41. +65 −0 pluginManager/src/NotifyUpdatesDialog.h
  42. +74 −2 pluginManager/src/Plugin.cpp
  43. +32 −3 pluginManager/src/Plugin.h
  44. +124 −52 pluginManager/src/PluginList.cpp
  45. +37 −2 pluginManager/src/PluginList.h
  46. +62 −27 pluginManager/src/PluginListView.cpp
  47. +19 −0 pluginManager/src/PluginListView.h
  48. +6 −8 pluginManager/src/PluginManager.cpp
  49. +5 −2 pluginManager/src/PluginManager.h
  50. +53 −11 pluginManager/src/PluginManager.rc
  51. +51 −15 pluginManager/src/PluginVersion.cpp
  52. +32 −3 pluginManager/src/PluginVersion.h
  53. +39 −1 pluginManager/src/ProgressDialog.cpp
  54. +2 −0 pluginManager/src/ProgressDialog.h
  55. +20 −0 pluginManager/src/SettingsDialog.cpp
  56. +35 −5 pluginManager/src/Utility.cpp
  57. +20 −1 pluginManager/src/Utility.h
  58. +2 −2 pluginManager/src/WcharMbcsConverter.cpp
  59. +49 −6 pluginManager/src/pluginmanagerdialog.cpp
  60. +3 −1 pluginManager/src/resource.h
  61. +19 −0 pluginManager/src/tstring.h
  62. +129 −4 unzip/projects/2005/unzip.vcproj
View
133 NppPlugin/projects/2005/NppPlugin.vcproj
@@ -17,7 +17,7 @@
<Configurations>
<Configuration
Name="Debug|Win32"
- OutputDirectory="..\..\bin\$(ConfigurationName)"
+ OutputDirectory="$(ProjectDir)\..\..\bin\$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1"
@@ -80,7 +80,7 @@
</Configuration>
<Configuration
Name="Release|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ OutputDirectory="$(ProjectDir)\..\..\bin\$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1"
@@ -103,9 +103,134 @@
/>
<Tool
Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\include"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
- RuntimeLibrary="2"
- UsePrecompiledHeader="2"
+ RuntimeLibrary="0"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="ANSI-Debug|Win32"
+ OutputDirectory="$(ProjectDir)\..\..\bin\$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="4"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\include"
+ PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="ANSI-Release|Win32"
+ OutputDirectory="$(ProjectDir)\..\..\bin\$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="4"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\include"
+ PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
+ RuntimeLibrary="0"
+ UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
View
131 TinyXml/projects/2005/TinyXml.vcproj
@@ -17,7 +17,7 @@
<Configurations>
<Configuration
Name="Debug|Win32"
- OutputDirectory="..\..\bin\$(ConfigurationName)"
+ OutputDirectory="$(ProjectDir)\..\..\bin\$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1"
@@ -80,7 +80,7 @@
</Configuration>
<Configuration
Name="Release|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ OutputDirectory="$(ProjectDir)\..\..\bin\$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1"
@@ -103,11 +103,136 @@
/>
<Tool
Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\include"
+ PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;TIXML_USE_STL"
+ RuntimeLibrary="0"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="ANSI-Debug|Win32"
+ OutputDirectory="$(ProjectDir)\..\..\bin\$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="4"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\include"
PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;TIXML_USE_STL"
- RuntimeLibrary="2"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="ANSI-Release|Win32"
+ OutputDirectory="$(ProjectDir)\..\..\bin\$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="4"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\include"
+ PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;TIXML_USE_STL"
+ RuntimeLibrary="0"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
View
184 gpup/projects/2005/gpup.vcproj
@@ -17,7 +17,7 @@
<Configurations>
<Configuration
Name="Debug|Win32"
- OutputDirectory="$(ProjectDir)$(ConfigurationName)"
+ OutputDirectory="$(ProjectDir)\..\..\bin\$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
@@ -41,7 +41,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\libinstall\include;..\..\src;..\..\..\tinyxml\include"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;TIXML_USE_STL"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;TIXML_USE_STL;CURL_STATICLIB"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -61,7 +61,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="Ws2_32.lib ..\..\..\libinstall\bin\$(ConfigurationName)\libinstall.lib ..\..\..\TinyXml\bin\$(ConfigurationName)\TinyXml.lib ..\..\..\unzip\bin\$(ConfigurationName)\unzip.lib libcurld.lib zlibd.lib"
+ AdditionalDependencies="shlwapi.lib Ws2_32.lib ..\..\..\libinstall\bin\$(ConfigurationName)\libinstall.lib ..\..\..\TinyXml\bin\$(ConfigurationName)\TinyXml.lib ..\..\..\unzip\bin\$(ConfigurationName)\unzip.lib libcurld.lib zlibd.lib"
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="2"
@@ -94,7 +94,7 @@
</Configuration>
<Configuration
Name="Release|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ OutputDirectory="$(ProjectDir)\..\..\bin\$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
@@ -117,8 +117,8 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\..\libinstall\src;..\..\src;..\..\src\tinyxml"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+ AdditionalIncludeDirectories="..\..\..\libinstall\include;..\..\src;..\..\..\tinyxml\include"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;TIXML_USE_STL;CURL_STATICLIB"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
WarningLevel="3"
@@ -136,7 +136,161 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="..\..\..\libinstall\bin\libinstall.lib"
+ AdditionalDependencies="shlwapi.lib Ws2_32.lib ..\..\..\libinstall\bin\$(ConfigurationName)\libinstall.lib ..\..\..\TinyXml\bin\$(ConfigurationName)\TinyXml.lib ..\..\..\unzip\bin\$(ConfigurationName)\unzip.lib libcurl.lib zlib.lib"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="ANSI-Debug|Win32"
+ OutputDirectory="$(ProjectDir)\..\..\bin\$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\libinstall\include;..\..\src;..\..\..\tinyxml\include"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;TIXML_USE_STL;CURL_STATICLIB"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="shlwapi.lib Ws2_32.lib ..\..\..\libinstall\bin\$(ConfigurationName)\libinstall.lib ..\..\..\TinyXml\bin\$(ConfigurationName)\TinyXml.lib ..\..\..\unzip\bin\$(ConfigurationName)\unzip.lib libcurld.lib zlibd.lib"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="ANSI-Release|Win32"
+ OutputDirectory="$(ProjectDir)\..\..\bin\$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\..\libinstall\include;..\..\src;..\..\..\tinyxml\include"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;TIXML_USE_STL;CURL_STATICLIB"
+ RuntimeLibrary="0"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="shlwapi.lib Ws2_32.lib ..\..\..\libinstall\bin\$(ConfigurationName)\libinstall.lib ..\..\..\TinyXml\bin\$(ConfigurationName)\TinyXml.lib ..\..\..\unzip\bin\$(ConfigurationName)\unzip.lib libcurl.lib zlib.lib"
LinkIncremental="1"
GenerateDebugInformation="true"
SubSystem="2"
@@ -205,6 +359,22 @@
UsePrecompiledHeader="1"
/>
</FileConfiguration>
+ <FileConfiguration
+ Name="ANSI-Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="ANSI-Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
</File>
</Filter>
<Filter
View
21 gpup/src/Options.cpp
@@ -1,3 +1,24 @@
+/*
+This file is part of GPUP, which is part of Plugin Manager
+Plugin for Notepad++
+
+Copyright (C)2009 Dave Brotherstone <davegb@pobox.com>
+
+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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
#include "stdafx.h"
#include "Options.h"
View
20 gpup/src/Options.h
@@ -1,3 +1,23 @@
+/*
+This file is part of Plugin Manager Plugin for Notepad++
+Copyright (C)2009 Dave Brotherstone <davegb@pobox.com>
+
+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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
+
#ifndef _OPTIONS_H
#define _OPTIONS_H
View
28 gpup/src/gpup.cpp
@@ -1,5 +1,23 @@
-// gpup.cpp : Defines the entry point for the application.
-//
+/*
+This file is part of GPUP, which is part of Plugin Manager
+Plugin for Notepad++
+
+Copyright (C)2009 Dave Brotherstone <davegb@pobox.com>
+
+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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
#include "stdafx.h"
#include "gpup.h"
@@ -247,7 +265,8 @@ BOOL processActionsFile(const tstring& actionsFile)
stepStatus = installStep->perform(basePath, // basePath
&stillToComplete, // forGpup (still can't achieve, so basically a fail)
boost::bind(&setStatus, _1), // status update function
- boost::bind(&stepProgress, _1)); // step progress function
+ boost::bind(&stepProgress, _1),
+ NULL); // step progress function
// If it said it needed to do it in GPUP, then maybe N++ hasn't quite
@@ -261,7 +280,8 @@ BOOL processActionsFile(const tstring& actionsFile)
stepStatus = installStep->perform(basePath, // basePath
&stillToComplete, // forGpup (still can't achieve, so basically a fail)
boost::bind(&setStatus, _1), // status update function
- boost::bind(&stepProgress, _1)); // step progress function
+ boost::bind(&stepProgress, _1), // step progress function
+ NULL);
}
View
20 gpup/src/gpup.h
@@ -1,3 +1,23 @@
#pragma once
+/*
+This file is part of GPUP, which is part of Plugin Manager
+Plugin for Notepad++
+
+Copyright (C)2009 Dave Brotherstone <davegb@pobox.com>
+
+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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
#include "resource.h"
View
20 gpup/src/stdafx.cpp
@@ -1,3 +1,23 @@
+/*
+This file is part of GPUP, which is part of Plugin Manager
+Plugin for Notepad++
+
+Copyright (C)2009 Dave Brotherstone <davegb@pobox.com>
+
+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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
// stdafx.cpp : source file that includes just the standard includes
// gpup.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
View
20 gpup/src/stdafx.h
@@ -1,3 +1,23 @@
+/*
+This file is part of GPUP, which is part of Plugin Manager
+Plugin for Notepad++
+
+Copyright (C)2009 Dave Brotherstone <davegb@pobox.com>
+
+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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
View
21 gpup/src/tstring.h
@@ -1,3 +1,24 @@
+/*
+This file is part of GPUP, which is part of Plugin Manager
+Plugin for Notepad++
+
+Copyright (C)2009 Dave Brotherstone <davegb@pobox.com>
+
+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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
#ifndef _TSTRING_H
#define _TSTRING_H
#include <tchar.h>
View
27 libinstall/include/libinstall/CopyStep.h
@@ -1,3 +1,23 @@
+/*
+This file is part of Plugin Manager Plugin for Notepad++
+
+Copyright (C)2009 Dave Brotherstone <davegb@pobox.com>
+
+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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
#ifndef _COPYSTEP_H
#define _COPYSTEP_H
#include <windows.h>
@@ -6,7 +26,7 @@
#include <tchar.h>
#include "tstring.h"
-#define VALIDATE_BASEURL _T("http://localhost:100/validate.php?md5=")
+#define VALIDATE_BASEURL _T("http://npppm.brotherstone.co.uk/validate.php?md5=")
#define VALIDATE_RESULT_OK "ok"
#define VALIDATE_RESULT_UNKNOWN "unknown"
#define VALIDATE_RESULT_BANNED "banned"
@@ -24,13 +44,13 @@ class CopyStep : public InstallStep
{
public:
CopyStep(const TCHAR* from, const TCHAR* to, BOOL attemptReplace, BOOL validate,
- const char* proxy, long proxyPort);
+ BOOL backup, const char* proxy, const long proxyPort);
~CopyStep() {};
StepStatus perform(tstring& basePath, TiXmlElement* forGpup,
boost::function<void(const TCHAR*)> setStatus,
- boost::function<void(const int)> stepProgress);
+ boost::function<void(const int)> stepProgress, const HWND windowParent);
private:
@@ -45,6 +65,7 @@ class CopyStep : public InstallStep
BOOL _failIfExists;
BOOL _validate;
+ BOOL _backup;
};
#endif
View
19 libinstall/include/libinstall/Decompress.h
@@ -1,3 +1,22 @@
+/*
+This file is part of Plugin Manager Plugin for Notepad++
+
+Copyright (C)2009 Dave Brotherstone <davegb@pobox.com>
+
+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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
#ifndef _DECOMPRESS_H
#define _DECOMPRESS_H
View
21 libinstall/include/libinstall/DeleteStep.h
@@ -1,3 +1,22 @@
+/*
+This file is part of Plugin Manager Plugin for Notepad++
+
+Copyright (C)2009 Dave Brotherstone <davegb@pobox.com>
+
+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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
#ifndef _DELETESTEP_H
#define _DELETESTEP_H
#include <windows.h>
@@ -15,7 +34,7 @@ class DeleteStep : public InstallStep
StepStatus perform(tstring& basePath, TiXmlElement* forGpup,
boost::function<void(const TCHAR*)> setStatus,
- boost::function<void(const int)> stepProgress);
+ boost::function<void(const int)> stepProgress, const HWND windowParent);
private:
tstring _file;
View
19 libinstall/include/libinstall/DirectLinkSearch.h
@@ -1,3 +1,22 @@
+/*
+This file is part of Plugin Manager Plugin for Notepad++
+
+Copyright (C)2009 Dave Brotherstone <davegb@pobox.com>
+
+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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
#ifndef _DIRECTLINKSEARCH_H
#define _DIRECTLINKSEARCH_H
View
37 libinstall/include/libinstall/DirectoryUtil.h
@@ -0,0 +1,37 @@
+/*
+This file is part of Plugin Manager Plugin for Notepad++
+
+Copyright (C)2009 Dave Brotherstone <davegb@pobox.com>
+
+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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
+#ifndef _DIRECTORYUTIL_H
+#define _DIRECTORYUTIL_H
+
+#include <tchar.h>
+
+// Copied from windows.h to avoid dependency
+typedef int BOOL;
+
+class DirectoryUtil
+{
+public:
+ static BOOL createDirectories(const TCHAR* dir);
+
+
+};
+
+#endif
View
19 libinstall/include/libinstall/DownloadManager.h
@@ -1,3 +1,22 @@
+/*
+This file is part of Plugin Manager Plugin for Notepad++
+
+Copyright (C)2009 Dave Brotherstone <davegb@pobox.com>
+
+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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
#pragma once
#include <TCHAR.H>
View
21 libinstall/include/libinstall/DownloadStep.h
@@ -1,3 +1,22 @@
+/*
+This file is part of Plugin Manager Plugin for Notepad++
+
+Copyright (C)2009 Dave Brotherstone <davegb@pobox.com>
+
+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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
#ifndef _DOWNLOADSTEP_H
#define _DOWNLOADSTEP_H
#include <windows.h>
@@ -15,7 +34,7 @@ class DownloadStep : public InstallStep
StepStatus perform(tstring& basePath, TiXmlElement* forGpup,
boost::function<void(const TCHAR*)> setStatus,
- boost::function<void(const int)> stepProgress);
+ boost::function<void(const int)> stepProgress, const HWND windowParent);
private:
tstring _url;
View
19 libinstall/include/libinstall/FileBuffer.h
@@ -1,3 +1,22 @@
+/*
+This file is part of Plugin Manager Plugin for Notepad++
+
+Copyright (C)2009 Dave Brotherstone <davegb@pobox.com>
+
+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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
#ifndef _FILEBUFFER_H
#define _FILEBUFFER_H
View
22 libinstall/include/libinstall/InstallStep.h
@@ -1,3 +1,22 @@
+/*
+This file is part of Plugin Manager Plugin for Notepad++
+
+Copyright (C)2009 Dave Brotherstone <davegb@pobox.com>
+
+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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
#ifndef _INSTALLSTEP_H
#define _INSTALLSTEP_H
@@ -24,7 +43,8 @@ class InstallStep
virtual StepStatus perform(tstring &/*basePath*/, TiXmlElement* /*forGpup*/,
boost::function<void(const TCHAR*)> setStatus,
- boost::function<void(const int)> stepProgress) { return STEPSTATUS_SUCCESS; };
+ boost::function<void(const int)> stepProgress,
+ const HWND /*windowParent */) { return STEPSTATUS_SUCCESS; };
protected:
// void setTstring(const char *src, tstring &dest);
View
20 libinstall/include/libinstall/InstallStepFactory.h
@@ -1,3 +1,22 @@
+/*
+This file is part of Plugin Manager Plugin for Notepad++
+
+Copyright (C)2009 Dave Brotherstone <davegb@pobox.com>
+
+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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
#ifndef _INSTALLSTEPFACTORY_H
#define _INSTALLSTEPFACTORY_H
#include <boost/shared_ptr.hpp>
@@ -16,7 +35,6 @@ class InstallStepFactory
private:
VariableHandler* _variableHandler;
-
};
View
19 libinstall/include/libinstall/VariableHandler.h
@@ -1,3 +1,22 @@
+/*
+This file is part of Plugin Manager Plugin for Notepad++
+
+Copyright (C)2009 Dave Brotherstone <davegb@pobox.com>
+
+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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
#ifndef _VARIABLEHANDLER_H
#define _VARIABLEHANDLER_H
View
26 libinstall/include/libinstall/WcharMbcsConverter.h
@@ -1,3 +1,25 @@
+/*
+This file is part of Plugin Manager Plugin for Notepad++
+
+Copyright (C)2009 Dave Brotherstone <davegb@pobox.com>
+
+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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+#ifndef _WCHARMBCSCONVERTER_H
+#define _WCHARMBCSCONVERTER_H
+
#include <boost/shared_ptr.hpp>
#include <tchar.h>
@@ -12,4 +34,6 @@ class WcharMbcsConverter {
static boost::shared_ptr<char> tchar2char(const TCHAR* tStr);
-};
+};
+
+#endif
View
19 libinstall/include/libinstall/md5.h
@@ -1,3 +1,22 @@
+/*
+This file is part of Plugin Manager Plugin for Notepad++
+
+Copyright (C)2009 Dave Brotherstone <davegb@pobox.com>
+
+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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
#include <tchar.h>
#define BUFSIZE 4096
View
18 libinstall/include/libinstall/tstring.h
@@ -1,4 +1,22 @@
+/*
+This file is part of Plugin Manager Plugin for Notepad++
+Copyright (C)2009 Dave Brotherstone <davegb@pobox.com>
+
+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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
#ifndef _TSTRING_H
#define _TSTRING_H
#include <tchar.h>
View
147 libinstall/projects/2005/libinstall.vcproj
@@ -17,7 +17,7 @@
<Configurations>
<Configuration
Name="Debug|Win32"
- OutputDirectory="..\..\bin\$(ConfigurationName)"
+ OutputDirectory="$(ProjectDir)\..\..\bin\$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1"
@@ -83,7 +83,7 @@
</Configuration>
<Configuration
Name="Release|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ OutputDirectory="$(ProjectDir)\..\..\bin\$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1"
@@ -106,10 +106,139 @@
/>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS"
- RuntimeLibrary="2"
+ AdditionalIncludeDirectories="..\..\..\tinyxml\include;..\..\..\unzip\include;..\..\include"
+ PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;NOUNCRYPT;TIXML_USE_STL;CURL_STATICLIB"
+ RuntimeLibrary="0"
+ DefaultCharIsUnsigned="true"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="ANSI-Debug|Win32"
+ OutputDirectory="$(ProjectDir)\..\..\bin\$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="4"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\tinyxml\include;..\..\..\unzip\include;..\..\include"
+ PreprocessorDefinitions="WIN32;_DEBUG;_LIB;NOUNCRYPT;TIXML_USE_STL;_CRT_SECURE_NO_WARNINGS;CURL_STATICLIB"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ DefaultCharIsUnsigned="true"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ IgnoreAllDefaultLibraries="false"
+ IgnoreDefaultLibraryNames=""
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="ANSI-Release|Win32"
+ OutputDirectory="$(ProjectDir)\..\..\bin\$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="4"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\..\tinyxml\include;..\..\..\unzip\include;..\..\include"
+ PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;NOUNCRYPT;TIXML_USE_STL;CURL_STATICLIB"
+ RuntimeLibrary="0"
DefaultCharIsUnsigned="true"
- UsePrecompiledHeader="2"
+ UsePrecompiledHeader="0"
WarningLevel="4"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
@@ -164,11 +293,11 @@
>
</File>
<File
- RelativePath="..\..\src\DeleteStep.cpp"
+ RelativePath="..\..\src\DirectLinkSearch.cpp"
>
</File>
<File
- RelativePath="..\..\src\DirectLinkSearch.cpp"
+ RelativePath="..\..\src\DirectoryUtil.cpp"
>
</File>
<File
@@ -222,6 +351,10 @@
>
</File>
<File
+ RelativePath="..\..\include\libinstall\DirectoryUtil.h"
+ >
+ </File>
+ <File
RelativePath="..\..\include\libinstall\DownloadManager.h"
>
</File>
View
105 libinstall/src/CopyStep.cpp
@@ -1,31 +1,53 @@
+/*
+This file is part of Plugin Manager Plugin for Notepad++
+
+Copyright (C)2009 Dave Brotherstone <davegb@pobox.com>
+
+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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
#include <tchar.h>
#include <string.h>
#include <windows.h>
+#include <shlwapi.h>
+#include <list>
#include <boost/function.hpp>
#include "libinstall/InstallStep.h"
#include "libinstall/CopyStep.h"
#include "libinstall/DownloadManager.h"
#include "libinstall/md5.h"
#include "libinstall/tstring.h"
-
+#include "libinstall/DirectoryUtil.h"
using namespace std;
-CopyStep::CopyStep(const TCHAR *from, const TCHAR *to, BOOL attemptReplace, BOOL validate, const char* proxy, long proxyPort)
+CopyStep::CopyStep(const TCHAR *from, const TCHAR *to, BOOL attemptReplace, BOOL validate, BOOL backup, const char* proxy, const long proxyPort)
{
_from = from;
_to = to;
_failIfExists = !attemptReplace;
- _validate = validate;
- _proxy = proxy;
- _proxyPort = proxyPort;
+ _validate = validate;
+ _backup = backup;
+ _proxy = proxy;
+ _proxyPort = proxyPort;
}
ValidateStatus CopyStep::Validate(tstring& file)
{
DownloadManager download;
- TCHAR localMD5[MD5::HASH_LENGTH + 1];
- MD5::hash(file.c_str(), localMD5, MD5::HASH_LENGTH + 1);
+ TCHAR localMD5[(MD5::HASH_LENGTH * 2) + 1];
+ MD5::hash(file.c_str(), localMD5, (MD5::HASH_LENGTH * 2) + 1);
tstring validateUrl = VALIDATE_BASEURL;
validateUrl.append(localMD5);
string validateResult;
@@ -48,7 +70,8 @@ ValidateStatus CopyStep::Validate(tstring& file)
StepStatus CopyStep::perform(tstring &basePath, TiXmlElement* forGpup,
boost::function<void(const TCHAR*)> setStatus,
- boost::function<void(const int)> stepProgress)
+ boost::function<void(const int)> stepProgress,
+ const HWND windowParent)
{
StepStatus status = STEPSTATUS_SUCCESS;
@@ -64,6 +87,14 @@ StepStatus CopyStep::perform(tstring &basePath, TiXmlElement* forGpup,
tstring fromDir;
tstring toPath = _to;
+
+ // Check destination directory exists
+ if (!::PathFileExists(_to.c_str()))
+ {
+ DirectoryUtil::createDirectories(_to.c_str());
+ }
+
+
toPath.append(_T("\\"));
tstring::size_type backSlash = fromPath.find_last_of(_T("\\"));
@@ -108,7 +139,7 @@ StepStatus CopyStep::perform(tstring &basePath, TiXmlElement* forGpup,
msg.append(foundData.cFileName);
msg.append(_T("' needed to install or update a plugin. Do you want to copy this file anyway (not recommended)?"));
- int userChoice = ::MessageBox(NULL, msg.c_str(), _T("Plugin Manager"), MB_ICONWARNING | MB_YESNO);
+ int userChoice = ::MessageBox(windowParent, msg.c_str(), _T("Plugin Manager"), MB_ICONWARNING | MB_YESNO);
if (userChoice == IDYES)
{
@@ -129,7 +160,7 @@ StepStatus CopyStep::perform(tstring &basePath, TiXmlElement* forGpup,
msg.append(foundData.cFileName);
msg.append(_T("' has been identified as unstable, incorrect or dangerous. It is NOT recommended you install this file. Do you want to install this file anyway?"));
- int userChoice = ::MessageBox(NULL, msg.c_str(), _T("Plugin Manager"), MB_ICONWARNING | MB_YESNO);
+ int userChoice = ::MessageBox(windowParent, msg.c_str(), _T("Plugin Manager"), MB_ICONWARNING | MB_YESNO);
if (userChoice == IDYES)
{
@@ -150,18 +181,52 @@ StepStatus CopyStep::perform(tstring &basePath, TiXmlElement* forGpup,
else
copy = true;
- if (copy && !::CopyFile(src.c_str(), dest.c_str(), _failIfExists))
+ if (copy)
{
- status = STEPSTATUS_NEEDGPUP;
- // Add file to forGpup doc
-
- TiXmlElement* copy = new TiXmlElement(_T("copy"));
-
- copy->SetAttribute(_T("from"), src.c_str());
- copy->SetAttribute(_T("to"), _to.c_str());
- copy->SetAttribute(_T("replace"), _T("true"));
- forGpup->LinkEndChild(copy);
+ if (_backup && ::PathFileExists(dest.c_str()))
+ {
+ tstring baseBackupPath(dest);
+ baseBackupPath.append(_T(".backup"));
+ tstring backupPath(baseBackupPath);
+ int counter = 1;
+ TCHAR buf[10];
+
+ // Keep checking the paths - if there's more than 500, tough.
+ while(::PathFileExists(backupPath.c_str()) && counter < 500)
+ {
+ ++counter;
+ _itot_s(counter, buf, 10, 10);
+ backupPath = baseBackupPath;
+ backupPath.append(buf);
+ }
+
+ // If there's 500 backups, give it a silly name.
+ if (counter >= 500)
+ {
+ backupPath = baseBackupPath;
+ backupPath.append(_T("_too_many_backups"));
+ }
+
+ ::CopyFile(dest.c_str(), backupPath.c_str(), FALSE);
+ }
+
+ if (!::CopyFile(src.c_str(), dest.c_str(), _failIfExists))
+ {
+ status = STEPSTATUS_NEEDGPUP;
+ // Add file to forGpup doc
+
+ TiXmlElement* copy = new TiXmlElement(_T("copy"));
+
+ copy->SetAttribute(_T("from"), src.c_str());
+ copy->SetAttribute(_T("to"), _to.c_str());
+ copy->SetAttribute(_T("replace"), _T("true"));
+ if (_backup)
+ copy->SetAttribute(_T("backup"), _T("true"));
+
+ forGpup->LinkEndChild(copy);
+
+ }
}
} while(status != STEPSTATUS_FAIL && ::FindNextFile(hFindFile, &foundData));
}
View
71 libinstall/src/Decompress.cpp
@@ -1,8 +1,29 @@
+/*
+This file is part of Plugin Manager Plugin for Notepad++
+
+Copyright (C)2009 Dave Brotherstone <davegb@pobox.com>
+
+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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
#include <string>
+#include <shlwapi.h>
#include <boost/shared_ptr.hpp>
#include "libinstall/Decompress.h"
#include "libinstall/WcharMbcsConverter.h"
#include "libinstall/tstring.h"
+#include "libinstall/DirectoryUtil.h"
#include "unzip.h"
@@ -47,29 +68,61 @@ BOOL Decompress::unzip(const tstring &zipFile, const tstring &destDir)
outputDir.append(filename);
outputDir.erase(outputDir.size() - 1);
::CreateDirectoryA(outputDir.c_str(), NULL);
+ unzCloseCurrentFile(hZip);
}
else
{
char buffer[BUFFER_SIZE];
int bytesRead;
- FILE *fp;
+ FILE *fp = NULL;
string outputFilename;
setString(destDir, outputFilename);
outputFilename.append(filename);
- fopen_s(&fp, outputFilename.c_str(), "wb");
+
+ string::size_type pos = outputFilename.find_first_of(_T('/'));
+ // Replace all the forward slashes with backward ones
+ while (pos != string::npos)
+ {
- do
+ outputFilename.replace(pos, 1, 1, _T('\\'));
+ pos = outputFilename.find_first_of(_T('/'), pos);
+ }
+
+ // Now grab the directory name of the output
+ pos = outputFilename.find_last_of(_T('\\'));
+
+ if (pos != string::npos)
{
- bytesRead = unzReadCurrentFile(hZip, buffer, BUFFER_SIZE);
+ // If it doesn't exist, create it (and its parents)
+ string outputDir = string(outputFilename, 0, pos);
+ if (!::PathFileExistsA(outputDir.c_str()))
+ {
+ shared_ptr<TCHAR> outputDirToCreate = WcharMbcsConverter::char2tchar(outputDir.c_str());
+ DirectoryUtil::createDirectories(outputDirToCreate.get());
+ }
+ }
+
+ if (fopen_s(&fp, outputFilename.c_str(), "wb") == 0)
+ {
+ do
+ {
+ bytesRead = unzReadCurrentFile(hZip, buffer, BUFFER_SIZE);
+
+ if (bytesRead > 0)
+ fwrite(buffer, bytesRead, 1, fp);
- if (bytesRead > 0)
- fwrite(buffer, bytesRead, 1, fp);
-
- } while(bytesRead > 0);
-
+ } while(bytesRead > 0);
+ }
+ else
+ {
+ // Opening output file failed, so close the zip and fail the step
+ unzClose(hZip);
+ return FALSE;
+ }
+
unzCloseCurrentFile(hZip);
fclose(fp);
}
View
22 libinstall/src/DeleteStep.cpp
@@ -1,3 +1,22 @@
+/*
+This file is part of Plugin Manager Plugin for Notepad++
+
+Copyright (C)2009 Dave Brotherstone <davegb@pobox.com>
+
+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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
#include <tchar.h>
#include <string.h>
#include <windows.h>
@@ -17,7 +36,8 @@ DeleteStep::DeleteStep(const TCHAR *file)
StepStatus DeleteStep::perform(tstring& /*basePath*/, TiXmlElement* forGpup,
boost::function<void(const TCHAR*)> setStatus,
- boost::function<void(const int)> stepProgress)
+ boost::function<void(const int)> stepProgress,
+ const HWND /*windowParent*/)
{
StepStatus status = STEPSTATUS_FAIL;
View
18 libinstall/src/DirectLinkSearch.cpp
@@ -1,4 +1,22 @@
+/*
+This file is part of Plugin Manager Plugin for Notepad++
+Copyright (C)2009 Dave Brotherstone <davegb@pobox.com>
+
+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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
#include <tchar.h>
#include <string>
#include <iostream>
View
73 libinstall/src/DirectoryUtil.cpp
@@ -0,0 +1,73 @@
+/*
+This file is part of Plugin Manager Plugin for Notepad++
+
+Copyright (C)2009 Dave Brotherstone <davegb@pobox.com>
+
+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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+#include "libinstall/DirectoryUtil.h"
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <list>
+#include "libinstall/tstring.h"
+#include "libinstall/DirectoryUtil.h"
+
+using namespace std;
+
+BOOL DirectoryUtil::createDirectories(const TCHAR *dir)
+{
+ BOOL created = FALSE;
+
+ if (!::CreateDirectory(dir, NULL))
+ {
+ tstring createPath = dir;
+ list<tstring> pathsToCreate;
+
+ // Add the deepest directory to the top of the list, so it will be created last
+ pathsToCreate.push_back(createPath);
+
+ do {
+
+ createPath.erase(createPath.find_last_of(_T('\\')));
+ if (!::CreateDirectory(createPath.c_str(), NULL))
+ {
+ pathsToCreate.push_back(createPath);
+ }
+ else
+ {
+ created = TRUE;
+ }
+
+ } while (createPath.find(_T('\\')) != tstring::npos
+ && !created);
+
+ if (created)
+ {
+ for(list<tstring>::reverse_iterator iter = pathsToCreate.rbegin(); iter != pathsToCreate.rend(); iter++)
+ {
+ ::CreateDirectory(iter->c_str(), NULL);
+ }
+ }
+ }
+ else
+ {
+ created = TRUE;
+ }
+
+ return created;
+
+}
+
View
4 libinstall/src/DownloadStep.cpp
@@ -27,7 +27,7 @@ DownloadStep::DownloadStep(const TCHAR *url, const TCHAR *filename, const char*
StepStatus DownloadStep::perform(tstring &basePath, TiXmlElement* forGpup,
boost::function<void(const TCHAR*)> setStatus,
- boost::function<void(const int)> stepProgress)
+ boost::function<void(const int)> stepProgress, const HWND windowParent)
{
DownloadManager downloadManager;
@@ -72,7 +72,7 @@ StepStatus DownloadStep::perform(tstring &basePath, TiXmlElement* forGpup,
if (realLink.get())
{
_url = realLink.get();
- return perform(basePath, forGpup, setStatus, stepProgress);
+ return perform(basePath, forGpup, setStatus, stepProgress, windowParent);
}
else
return STEPSTATUS_FAIL;
View
19 libinstall/src/FileBuffer.cpp
@@ -1,3 +1,22 @@
+/*
+This file is part of Plugin Manager Plugin for Notepad++
+
+Copyright (C)2009 Dave Brotherstone <davegb@pobox.com>
+
+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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
#include <string>
#include <iostream>
#include <boost/shared_ptr.hpp>
View
30 libinstall/src/InstallStepFactory.cpp
@@ -1,3 +1,22 @@
+/*
+This file is part of Plugin Manager Plugin for Notepad++
+
+Copyright (C)2009 Dave Brotherstone <davegb@pobox.com>
+
+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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
#include "libinstall/InstallStepFactory.h"
#include "libinstall/DownloadStep.h"
#include "libinstall/CopyStep.h"
@@ -30,15 +49,22 @@ shared_ptr<InstallStep> InstallStepFactory::create(TiXmlElement* element, const
const TCHAR *tTo = element->Attribute(_T("to"));
const TCHAR *tReplace = element->Attribute(_T("replace"));
const TCHAR *tValidate = element->Attribute(_T("validate"));
+ const TCHAR *tBackup = element->Attribute(_T("backup"));
+
BOOL attemptReplace = FALSE;
- BOOL validate = FALSE;
+ BOOL validate = FALSE;
+ BOOL backup = FALSE;
if (tReplace && !_tcscmp(tReplace, _T("true")))
attemptReplace = TRUE;
if (tValidate && !_tcscmp(tValidate, _T("true")))
validate = TRUE;
+ if (tBackup && !_tcscmp(tBackup, _T("true")))
+ backup = TRUE;
+
+
tstring from;
tstring to;
if (tFrom)
@@ -53,7 +79,7 @@ shared_ptr<InstallStep> InstallStepFactory::create(TiXmlElement* element, const
_variableHandler->replaceVariables(to);
}
- installStep.reset(new CopyStep(from.c_str(), to.c_str(), attemptReplace, validate, proxy, proxyPort));
+ installStep.reset(new CopyStep(from.c_str(), to.c_str(), attemptReplace, validate, backup, proxy, proxyPort));
}
else if (!_tcscmp(element->Value(), _T("delete")))
{
View
19 libinstall/src/VariableHandler.cpp
@@ -1,3 +1,22 @@
+/*
+This file is part of Plugin Manager Plugin for Notepad++
+
+Copyright (C)2009 Dave Brotherstone <davegb@pobox.com>
+
+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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
#include "libinstall/VariableHandler.h"
#include "libinstall/tstring.h"
View
27 libinstall/src/WcharMbcsConverter.cpp
@@ -1,3 +1,22 @@
+/*
+This file is part of Plugin Manager Plugin for Notepad++
+
+Copyright (C)2009 Dave Brotherstone <davegb@pobox.com>
+
+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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
#include <boost/shared_ptr.hpp>
#include <windows.h>
#include "libinstall/WcharMbcsConverter.h"
@@ -56,7 +75,7 @@ shared_ptr<TCHAR> WcharMbcsConverter::char2tchar(const char* mbStr)
#ifdef _UNICODE
return char2wchar(mbStr);
#else
- int len = strlen(mbStr) + 1
+ int len = strlen(mbStr) + 1;
shared_ptr<TCHAR> result(new TCHAR[len]);
strcpy_s(result.get(), len, mbStr);
return result;
@@ -68,9 +87,11 @@ shared_ptr<char> WcharMbcsConverter::tchar2char(const TCHAR* tStr)
#ifdef _UNICODE
return wchar2char(tStr);
#else
- int len = _tcslen(tStr) + 1
+ int len = _tcslen(tStr) + 1;
shared_ptr<TCHAR> result(new TCHAR[len]);
strcpy_s(result.get(), len, tStr);
return result;
#endif
-}
+}
+
+
View
43 libinstall/src/md5.cpp
@@ -1,3 +1,22 @@
+/*
+This file is part of Plugin Manager Plugin for Notepad++
+
+Copyright (C)2009 Dave Brotherstone <davegb@pobox.com>
+
+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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
#include <stdio.h>
#include <windows.h>
#include <Wincrypt.h>
@@ -42,30 +61,38 @@ BOOL MD5::hash(const TCHAR *filename, TCHAR *hashBuffer, int hashBufferLength)
PROV_RSA_FULL,
CRYPT_VERIFYCONTEXT))
{
+ CloseHandle(hFile);
return FALSE;
}
if (!CryptCreateHash(hProv, CALG_MD5, 0, 0, &hHash))
{
+ CryptReleaseContext(hProv, 0);
+ CloseHandle(hFile);
return FALSE;
}
- do
+ do
{
- if (!ReadFile(hFile, rgbFile, BUFSIZE, &cbRead, NULL))
- return FALSE;
-
- if (0 == cbRead)
- {
- break;
- }
+ bResult = ReadFile(hFile, rgbFile, BUFSIZE, &cbRead, NULL);
+ if (!bResult || 0 == cbRead)
+ break;
+
if (!CryptHashData(hHash, rgbFile, cbRead, 0))
{
return FALSE;
}
} while (bResult);
+
+ if (bResult == FALSE)
+ {
+ CryptReleaseContext(hProv, 0);
+ CryptDestroyHash(hHash);
+ CloseHandle(hFile);
+ return FALSE;
+ }
cbHash = MD5LEN;
View
66 pluginManager/projects/2005/PluginManager.sln
@@ -29,6 +29,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gpup", "..\..\..\gpup\proje
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ ANSI-Debug|Any CPU = ANSI-Debug|Any CPU
+ ANSI-Debug|Mixed Platforms = ANSI-Debug|Mixed Platforms
+ ANSI-Debug|Win32 = ANSI-Debug|Win32
+ ANSI-Release|Any CPU = ANSI-Release|Any CPU
+ ANSI-Release|Mixed Platforms = ANSI-Release|Mixed Platforms
+ ANSI-Release|Win32 = ANSI-Release|Win32
Debug|Any CPU = Debug|Any CPU
Debug|Mixed Platforms = Debug|Mixed Platforms
Debug|Win32 = Debug|Win32
@@ -37,6 +43,16 @@ Global
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {0A9F9D63-C282-4AE8-9F80-A6D5F541AD12}.ANSI-Debug|Any CPU.ActiveCfg = ANSI-Debug|Win32
+ {0A9F9D63-C282-4AE8-9F80-A6D5F541AD12}.ANSI-Debug|Mixed Platforms.ActiveCfg = ANSI-Debug|Win32
+ {0A9F9D63-C282-4AE8-9F80-A6D5F541AD12}.ANSI-Debug|Mixed Platforms.Build.0 = ANSI-Debug|Win32
+ {0A9F9D63-C282-4AE8-9F80-A6D5F541AD12}.ANSI-Debug|Win32.ActiveCfg = ANSI-Debug|Win32
+ {0A9F9D63-C282-4AE8-9F80-A6D5F541AD12}.ANSI-Debug|Win32.Build.0 = ANSI-Debug|Win32
+ {0A9F9D63-C282-4AE8-9F80-A6D5F541AD12}.ANSI-Release|Any CPU.ActiveCfg = ANSI-Release|Win32
+ {0A9F9D63-C282-4AE8-9F80-A6D5F541AD12}.ANSI-Release|Mixed Platforms.ActiveCfg = ANSI-Release|Win32
+ {0A9F9D63-C282-4AE8-9F80-A6D5F541AD12}.ANSI-Release|Mixed Platforms.Build.0 = ANSI-Release|Win32
+ {0A9F9D63-C282-4AE8-9F80-A6D5F541AD12}.ANSI-Release|Win32.ActiveCfg = ANSI-Release|Win32
+ {0A9F9D63-C282-4AE8-9F80-A6D5F541AD12}.ANSI-Release|Win32.Build.0 = ANSI-Release|Win32
{0A9F9D63-C282-4AE8-9F80-A6D5F541AD12}.Debug|Any CPU.ActiveCfg = Debug|Win32
{0A9F9D63-C282-4AE8-9F80-A6D5F541AD12}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{0A9F9D63-C282-4AE8-9F80-A6D5F541AD12}.Debug|Mixed Platforms.Build.0 = Debug|Win32
@@ -47,6 +63,16 @@ Global
{0A9F9D63-C282-4AE8-9F80-A6D5F541AD12}.Release|Mixed Platforms.Build.0 = Release|Win32
{0A9F9D63-C282-4AE8-9F80-A6D5F541AD12}.Release|Win32.ActiveCfg = Release|Win32
{0A9F9D63-C282-4AE8-9F80-A6D5F541AD12}.Release|Win32.Build.0 = Release|Win32
+ {F8F0B077-8778-4CB9-9B54-EC67A3D2C750}.ANSI-Debug|Any CPU.ActiveCfg = ANSI-Debug|Win32
+ {F8F0B077-8778-4CB9-9B54-EC67A3D2C750}.ANSI-Debug|Mixed Platforms.ActiveCfg = ANSI-Debug|Win32
+ {F8F0B077-8778-4CB9-9B54-EC67A3D2C750}.ANSI-Debug|Mixed Platforms.Build.0 = ANSI-Debug|Win32
+ {F8F0B077-8778-4CB9-9B54-EC67A3D2C750}.ANSI-Debug|Win32.ActiveCfg = ANSI-Debug|Win32
+ {F8F0B077-8778-4CB9-9B54-EC67A3D2C750}.ANSI-Debug|Win32.Build.0 = ANSI-Debug|Win32
+ {F8F0B077-8778-4CB9-9B54-EC67A3D2C750}.ANSI-Release|Any CPU.ActiveCfg = ANSI-Release|Win32
+ {F8F0B077-8778-4CB9-9B54-EC67A3D2C750}.ANSI-Release|Mixed Platforms.ActiveCfg = ANSI-Release|Win32
+ {F8F0B077-8778-4CB9-9B54-EC67A3D2C750}.ANSI-Release|Mixed Platforms.Build.0 = ANSI-Release|Win32
+ {F8F0B077-8778-4CB9-9B54-EC67A3D2C750}.ANSI-Release|Win32.ActiveCfg = ANSI-Release|Win32
+ {F8F0B077-8778-4CB9-9B54-EC67A3D2C750}.ANSI-Release|Win32.Build.0 = ANSI-Release|Win32
{F8F0B077-8778-4CB9-9B54-EC67A3D2C750}.Debug|Any CPU.ActiveCfg = Debug|Win32
{F8F0B077-8778-4CB9-9B54-EC67A3D2C750}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{F8F0B077-8778-4CB9-9B54-EC67A3D2C750}.Debug|Mixed Platforms.Build.0 = Debug|Win32
@@ -57,6 +83,16 @@ Global
{F8F0B077-8778-4CB9-9B54-EC67A3D2C750}.Release|Mixed Platforms.Build.0 = Release|Win32
{F8F0B077-8778-4CB9-9B54-EC67A3D2C750}.Release|Win32.ActiveCfg = Release|Win32
{F8F0B077-8778-4CB9-9B54-EC67A3D2C750}.Release|Win32.Build.0 = Release|Win32
+ {C83E2A6F-9747-4855-9D61-A88359450ED6}.ANSI-Debug|Any CPU.ActiveCfg = ANSI-Debug|Win32
+ {C83E2A6F-9747-4855-9D61-A88359450ED6}.ANSI-Debug|Mixed Platforms.ActiveCfg = ANSI-Debug|Win32
+ {C83E2A6F-9747-4855-9D61-A88359450ED6}.ANSI-Debug|Mixed Platforms.Build.0 = ANSI-Debug|Win32
+ {C83E2A6F-9747-4855-9D61-A88359450ED6}.ANSI-Debug|Win32.ActiveCfg = ANSI-Debug|Win32
+ {C83E2A6F-9747-4855-9D61-A88359450ED6}.ANSI-Debug|Win32.Build.0 = ANSI-Debug|Win32
+ {C83E2A6F-9747-4855-9D61-A88359450ED6}.ANSI-Release|Any CPU.ActiveCfg = ANSI-Release|Win32
+ {C83E2A6F-9747-4855-9D61-A88359450ED6}.ANSI-Release|Mixed Platforms.ActiveCfg = ANSI-Release|Win32
+ {C83E2A6F-9747-4855-9D61-A88359450ED6}.ANSI-Release|Mixed Platforms.Build.0 = ANSI-Release|Win32
+ {C83E2A6F-9747-4855-9D61-A88359450ED6}.ANSI-Release|Win32.ActiveCfg = ANSI-Release|Win32
+ {C83E2A6F-9747-4855-9D61-A88359450ED6}.ANSI-Release|Win32.Build.0 = ANSI-Release|Win32
{C83E2A6F-9747-4855-9D61-A88359450ED6}.Debug|Any CPU.ActiveCfg = Debug|Win32
{C83E2A6F-9747-4855-9D61-A88359450ED6}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{C83E2A6F-9747-4855-9D61-A88359450ED6}.Debug|Mixed Platforms.Build.0 = Debug|Win32
@@ -67,6 +103,16 @@ Global
{C83E2A6F-9747-4855-9D61-A88359450ED6}.Release|Mixed Platforms.Build.0 = Release|Win32
{C83E2A6F-9747-4855-9D61-A88359450ED6}.Release|Win32.ActiveCfg = Release|Win32
{C83E2A6F-9747-4855-9D61-A88359450ED6}.Release|Win32.Build.0 = Release|Win32
+ {E3DCABE9-3953-4A81-8B71-DEF9AD21753B}.ANSI-Debug|Any CPU.ActiveCfg = ANSI-Debug|Win32
+ {E3DCABE9-3953-4A81-8B71-DEF9AD21753B}.ANSI-Debug|Mixed Platforms.ActiveCfg = ANSI-Debug|Win32
+ {E3DCABE9-3953-4A81-8B71-DEF9AD21753B}.ANSI-Debug|Mixed Platforms.Build.0 = ANSI-Debug|Win32
+ {E3DCABE9-3953-4A81-8B71-DEF9AD21753B}.ANSI-Debug|Win32.ActiveCfg = ANSI-Debug|Win32
+ {E3DCABE9-3953-4A81-8B71-DEF9AD21753B}.ANSI-Debug|Win32.Build.0 = ANSI-Debug|Win32
+ {E3DCABE9-3953-4A81-8B71-DEF9AD21753B}.ANSI-Release|Any CPU.ActiveCfg = ANSI-Release|Win32
+ {E3DCABE9-3953-4A81-8B71-DEF9AD21753B}.ANSI-Release|Mixed Platforms.ActiveCfg = ANSI-Release|Win32
+ {E3DCABE9-3953-4A81-8B71-DEF9AD21753B}.ANSI-Release|Mixed Platforms.Build.0 = ANSI-Release|Win32
+ {E3DCABE9-3953-4A81-8B71-DEF9AD21753B}.ANSI-Release|Win32.ActiveCfg = ANSI-Release|Win32
+ {E3DCABE9-3953-4A81-8B71-DEF9AD21753B}.ANSI-Release|Win32.Build.0 = ANSI-Release|Win32
{E3DCABE9-3953-4A81-8B71-DEF9AD21753B}.Debug|Any CPU.ActiveCfg = Debug|Win32
{E3DCABE9-3953-4A81-8B71-DEF9AD21753B}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{E3DCABE9-3953-4A81-8B71-DEF9AD21753B}.Debug|Mixed Platforms.Build.0 = Debug|Win32
@@ -77,6 +123,16 @@ Global
{E3DCABE9-3953-4A81-8B71-DEF9AD21753B}.Release|Mixed Platforms.Build.0 = Release|Win32
{E3DCABE9-3953-4A81-8B71-DEF9AD21753B}.Release|Win32.ActiveCfg = Release|Win32
{E3DCABE9-3953-4A81-8B71-DEF9AD21753B}.Release|Win32.Build.0 = Release|Win32
+ {69CC76EB-0183-4622-929C-02E860A66A23}.ANSI-Debug|Any CPU.ActiveCfg = ANSI-Debug|Win32
+ {69CC76EB-0183-4622-929C-02E860A66A23}.ANSI-Debug|Mixed Platforms.ActiveCfg = ANSI-Debug|Win32
+ {69CC76EB-0183-4622-929C-02E860A66A23}.ANSI-Debug|Mixed Platforms.Build.0 = ANSI-Debug|Win32
+ {69CC76EB-0183-4622-929C-02E860A66A23}.ANSI-Debug|Win32.ActiveCfg = ANSI-Debug|Win32
+ {69CC76EB-0183-4622-929C-02E860A66A23}.ANSI-Debug|Win32.Build.0 = ANSI-Debug|Win32
+ {69CC76EB-0183-4622-929C-02E860A66A23}.ANSI-Release|Any CPU.ActiveCfg = ANSI-Release|Win32
+ {69CC76EB-0183-4622-929C-02E860A66A23}.ANSI-Release|Mixed Platforms.ActiveCfg = ANSI-Release|Win32
+ {69CC76EB-0183-4622-929C-02E860A66A23}.ANSI-Release|Mixed Platforms.Build.0 = ANSI-Release|Win32
+ {69CC76EB-0183-4622-929C-02E860A66A23}.ANSI-Release|Win32.ActiveCfg = ANSI-Release|Win32
+ {69CC76EB-0183-4622-929C-02E860A66A23}.ANSI-Release|Win32.Build.0 = ANSI-Release|Win32
{69CC76EB-0183-4622-929C-02E860A66A23}.Debug|Any CPU.ActiveCfg = Debug|Win32
{69CC76EB-0183-4622-929C-02E860A66A23}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{69CC76EB-0183-4622-929C-02E860A66A23}.Debug|Mixed Platforms.Build.0 = Debug|Win32
@@ -87,6 +143,16 @@ Global
{69CC76EB-0183-4622-929C-02E860A66A23}.Release|Mixed Platforms.Build.0 = Release|Win32
{69CC76EB-0183-4622-929C-02E860A66A23}.Release|Win32.ActiveCfg = Release|Win32
{69CC76EB-0183-4622-929C-02E860A66A23}.Release|Win32.Build.0 = Release|Win32
+ {182656A0-B2AE-4955-9A2D-D8705FA52B27}.ANSI-Debug|Any CPU.ActiveCfg = ANSI-Debug|Win32
+ {182656A0-B2AE-4955-9A2D-D8705FA52B27}.ANSI-Debug|Mixed Platforms.ActiveCfg = ANSI-Debug|Win32
+ {182656A0-B2AE-4955-9A2D-D8705FA52B27}.ANSI-Debug|Mixed Platforms.Build.0 = ANSI-Debug|Win32
+ {182656A0-B2AE-4955-9A2D-D8705FA52B27}.ANSI-Debug|Win32.ActiveCfg = ANSI-Debug|Win32
+ {182656A0-B2AE-4955-9A2D-D8705FA52B27}.ANSI-Debug|Win32.Build.0 = ANSI-Debug|Win32
+ {182656A0-B2AE-4955-9A2D-D8705FA52B27}.ANSI-Release|Any CPU.ActiveCfg = ANSI-Release|Win32