go my file uploader
This commit is contained in:
38
plugins/Updater/CHANGELOG.txt
Normal file
38
plugins/Updater/CHANGELOG.txt
Normal file
@ -0,0 +1,38 @@
|
||||
1.7
|
||||
* Ignore v2.40 and above on XP and Vista.
|
||||
|
||||
1.6
|
||||
* Fixed background update check interval
|
||||
|
||||
1.5
|
||||
* Added dynamic URL support
|
||||
* Added digital signature verification
|
||||
|
||||
1.4
|
||||
* Added PNG images
|
||||
* Fixed offline crash
|
||||
* Improved background update check
|
||||
* Removed BMP images
|
||||
|
||||
1.3
|
||||
* Added revision checking
|
||||
* Fixed invalid xml crash
|
||||
* Fixed GDI handle leak
|
||||
* Fixed caching
|
||||
|
||||
1.2
|
||||
* Improved UI
|
||||
* Improved internet connectivity check for Vista and above (INetworkListManager)
|
||||
* Improved download speed calculation
|
||||
* Improved time remaining calculation
|
||||
* Fixed auto-update prompt location if PH minimized
|
||||
* Fixed install failures if hash check failed
|
||||
|
||||
1.1
|
||||
* Added download speed
|
||||
* Added remaining time
|
||||
* Fixed buffer zeroing
|
||||
* Fixed threading memory leak
|
||||
|
||||
1.0
|
||||
* Initial release
|
176
plugins/Updater/Updater.rc
Normal file
176
plugins/Updater/Updater.rc
Normal file
@ -0,0 +1,176 @@
|
||||
// Microsoft Visual C++ generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "winres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (Australia) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENA)
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_AUS
|
||||
#pragma code_page(1252)
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#include ""winres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,7,0,0
|
||||
PRODUCTVERSION 1,7,0,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x40004L
|
||||
FILETYPE 0x2L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "0c0904b0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "dmex"
|
||||
VALUE "FileDescription", "Update checker plugin for Process Hacker"
|
||||
VALUE "FileVersion", "1.7"
|
||||
VALUE "InternalName", "Updater"
|
||||
VALUE "LegalCopyright", "Licensed under the GNU GPL, v3."
|
||||
VALUE "OriginalFilename", "Updater.dll"
|
||||
VALUE "ProductName", "Update checker plugin for Process Hacker"
|
||||
VALUE "ProductVersion", "1.7"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0xc09, 1200
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_UPDATE DIALOGEX 0, 0, 259, 89
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
EXSTYLE WS_EX_APPWINDOW
|
||||
CAPTION "Process Hacker Updater"
|
||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||
BEGIN
|
||||
CONTROL "Check for new releases?",IDC_MESSAGE,"Static",SS_SIMPLE | SS_NOPREFIX | SS_WORDELLIPSIS | WS_GROUP,7,6,194,13,WS_EX_TRANSPARENT
|
||||
CONTROL "",IDC_RELDATE,"Static",SS_SIMPLE | SS_NOPREFIX | SS_WORDELLIPSIS | WS_GROUP,8,24,194,11,WS_EX_TRANSPARENT
|
||||
CONTROL "<a>View Changelog</a>",IDC_INFOSYSLINK,"SysLink",NOT WS_VISIBLE | WS_TABSTOP,8,39,89,11,WS_EX_TRANSPARENT
|
||||
CONTROL "",IDC_PROGRESS,"msctls_progress32",PBS_SMOOTH | NOT WS_VISIBLE,8,54,244,11
|
||||
CONTROL "",IDC_STATUS,"Static",SS_SIMPLE | SS_NOPREFIX | SS_WORDELLIPSIS | WS_GROUP,7,72,135,8,WS_EX_TRANSPARENT
|
||||
PUSHBUTTON "Start",IDC_DOWNLOAD,149,70,50,14
|
||||
PUSHBUTTON "Close",IDOK,203,70,50,14
|
||||
CONTROL "",IDC_UPDATEICON,"Static",SS_BITMAP | SS_CENTERIMAGE,224,0,32,32,WS_EX_TRANSPARENT
|
||||
END
|
||||
|
||||
IDD_OPTIONS DIALOGEX 0, 0, 215, 54
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Updater Options"
|
||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||
BEGIN
|
||||
CONTROL "Check for updates automatically",IDC_AUTOCHECKBOX,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,7,142,10
|
||||
DEFPUSHBUTTON "OK",IDOK,105,33,50,14
|
||||
PUSHBUTTON "Cancel",IDCANCEL,158,33,50,14
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO
|
||||
BEGIN
|
||||
IDD_UPDATE, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 252
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 84
|
||||
END
|
||||
|
||||
IDD_OPTIONS, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 208
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 47
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// AFX_DIALOG_LAYOUT
|
||||
//
|
||||
|
||||
IDD_UPDATE AFX_DIALOG_LAYOUT
|
||||
BEGIN
|
||||
0
|
||||
END
|
||||
|
||||
IDD_OPTIONS AFX_DIALOG_LAYOUT
|
||||
BEGIN
|
||||
0
|
||||
END
|
||||
|
||||
#endif // English (Australia) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
106
plugins/Updater/Updater.vcxproj
Normal file
106
plugins/Updater/Updater.vcxproj
Normal file
@ -0,0 +1,106 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{A0C1595C-FA3E-4B7A-936C-306BC6294C5E}</ProjectGuid>
|
||||
<RootNamespace>Updater</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectName>Updater</ProjectName>
|
||||
<WindowsTargetPlatformVersion>10.0.10586.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\Plugins.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LibraryPath>$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);$(NETFXKitsDir)Lib\um\x86;C:\Users\AirDog46\Downloads\processhacker-2.39-src\bin\Debug32</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LibraryPath>$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);$(NETFXKitsDir)Lib\um\x64;C:\Users\AirDog46\Downloads\processhacker-2.39-src\bin\Release64</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LibraryPath>$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);$(NETFXKitsDir)Lib\um\x86;$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);$(NETFXKitsDir)Lib\um\x64;C:\Users\AirDog46\Downloads\processhacker-2.39-src\bin\Release32</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LibraryPath>$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);$(NETFXKitsDir)Lib\um\x64;$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);$(NETFXKitsDir)Lib\um\x64;C:\Users\AirDog46\Downloads\processhacker-2.39-src\bin\Debug64</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Link>
|
||||
<AdditionalDependencies>winhttp.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<DelayLoadDLLs>winhttp.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Link>
|
||||
<AdditionalDependencies>winhttp.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<DelayLoadDLLs>winhttp.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Link>
|
||||
<AdditionalDependencies>winhttp.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<DelayLoadDLLs>winhttp.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Link>
|
||||
<AdditionalDependencies>winhttp.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<DelayLoadDLLs>winhttp.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.c" />
|
||||
<ClCompile Include="options.c" />
|
||||
<ClCompile Include="updater.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="updater.h" />
|
||||
<ClInclude Include="resource.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="CHANGELOG.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="Updater.rc" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
44
plugins/Updater/Updater.vcxproj.filters
Normal file
44
plugins/Updater/Updater.vcxproj.filters
Normal file
@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="options.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="updater.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="main.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="updater.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="resource.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="CHANGELOG.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="Updater.rc">
|
||||
<Filter>Resource Files</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
179
plugins/Updater/main.c
Normal file
179
plugins/Updater/main.c
Normal file
@ -0,0 +1,179 @@
|
||||
/*
|
||||
* Process Hacker Plugins -
|
||||
* Update Checker Plugin
|
||||
*
|
||||
* Copyright (C) 2011-2015 dmex
|
||||
*
|
||||
* This file is part of Process Hacker.
|
||||
*
|
||||
* Process Hacker 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Process Hacker 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 Process Hacker. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "updater.h"
|
||||
|
||||
PPH_PLUGIN PluginInstance;
|
||||
static PH_CALLBACK_REGISTRATION PluginMenuItemCallbackRegistration;
|
||||
static PH_CALLBACK_REGISTRATION MainMenuInitializingCallbackRegistration;
|
||||
static PH_CALLBACK_REGISTRATION MainWindowShowingCallbackRegistration;
|
||||
static PH_CALLBACK_REGISTRATION PluginShowOptionsCallbackRegistration;
|
||||
|
||||
VOID NTAPI MainWindowShowingCallback(
|
||||
_In_opt_ PVOID Parameter,
|
||||
_In_opt_ PVOID Context
|
||||
)
|
||||
{
|
||||
// Check if the user want's us to auto-check for updates.
|
||||
if (PhGetIntegerSetting(SETTING_NAME_AUTO_CHECK))
|
||||
{
|
||||
// All good, queue up our update check.
|
||||
StartInitialCheck();
|
||||
}
|
||||
}
|
||||
|
||||
VOID NTAPI MainMenuInitializingCallback(
|
||||
_In_opt_ PVOID Parameter,
|
||||
_In_opt_ PVOID Context
|
||||
)
|
||||
{
|
||||
PPH_PLUGIN_MENU_INFORMATION menuInfo = Parameter;
|
||||
|
||||
// Check this menu is the Help menu
|
||||
if (!menuInfo || menuInfo->u.MainMenu.SubMenuIndex != 4)
|
||||
return;
|
||||
|
||||
PhInsertEMenuItem(menuInfo->Menu, PhPluginCreateEMenuItem(PluginInstance, 0, UPDATE_MENUITEM, L"Check for updates", NULL), 0);
|
||||
}
|
||||
|
||||
VOID NTAPI MenuItemCallback(
|
||||
_In_opt_ PVOID Parameter,
|
||||
_In_opt_ PVOID Context
|
||||
)
|
||||
{
|
||||
PPH_PLUGIN_MENU_ITEM menuItem = Parameter;
|
||||
|
||||
if (menuItem && menuItem->Id == UPDATE_MENUITEM)
|
||||
{
|
||||
ShowUpdateDialog(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
VOID NTAPI ShowOptionsCallback(
|
||||
_In_opt_ PVOID Parameter,
|
||||
_In_opt_ PVOID Context
|
||||
)
|
||||
{
|
||||
DialogBox(
|
||||
PluginInstance->DllBase,
|
||||
MAKEINTRESOURCE(IDD_OPTIONS),
|
||||
(HWND)Parameter,
|
||||
OptionsDlgProc
|
||||
);
|
||||
}
|
||||
|
||||
PPH_STRING PhGetOpaqueXmlNodeText(
|
||||
_In_ mxml_node_t *xmlNode
|
||||
)
|
||||
{
|
||||
if (xmlNode && xmlNode->child && xmlNode->child->type == MXML_OPAQUE && xmlNode->child->value.opaque)
|
||||
{
|
||||
return PhConvertUtf8ToUtf16(xmlNode->child->value.opaque);
|
||||
}
|
||||
|
||||
return PhReferenceEmptyString();
|
||||
}
|
||||
|
||||
BOOL PhInstalledUsingSetup(
|
||||
VOID
|
||||
)
|
||||
{
|
||||
static PH_STRINGREF keyName = PH_STRINGREF_INIT(L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Process_Hacker2_is1");
|
||||
|
||||
HANDLE keyHandle = NULL;
|
||||
|
||||
// Check uninstall entries for the 'Process_Hacker2_is1' registry key.
|
||||
if (NT_SUCCESS(PhOpenKey(
|
||||
&keyHandle,
|
||||
KEY_READ,
|
||||
PH_KEY_LOCAL_MACHINE,
|
||||
&keyName,
|
||||
0
|
||||
)))
|
||||
{
|
||||
NtClose(keyHandle);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
LOGICAL DllMain(
|
||||
_In_ HINSTANCE Instance,
|
||||
_In_ ULONG Reason,
|
||||
_Reserved_ PVOID Reserved
|
||||
)
|
||||
{
|
||||
switch (Reason)
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
{
|
||||
PPH_PLUGIN_INFORMATION info;
|
||||
PH_SETTING_CREATE settings[] =
|
||||
{
|
||||
{ IntegerSettingType, SETTING_NAME_AUTO_CHECK, L"1" },
|
||||
{ StringSettingType, SETTING_NAME_LAST_CHECK, L"0" }
|
||||
};
|
||||
|
||||
PluginInstance = PhRegisterPlugin(PLUGIN_NAME, Instance, &info);
|
||||
|
||||
if (!PluginInstance)
|
||||
return FALSE;
|
||||
|
||||
info->DisplayName = L"Update Checker";
|
||||
info->Author = L"dmex";
|
||||
info->Description = L"Plugin for checking new Process Hacker releases via the Help menu.";
|
||||
info->Url = L"https://wj32.org/processhacker/forums/viewtopic.php?t=1121";
|
||||
info->HasOptions = TRUE;
|
||||
|
||||
PhRegisterCallback(
|
||||
PhGetGeneralCallback(GeneralCallbackMainWindowShowing),
|
||||
MainWindowShowingCallback,
|
||||
NULL,
|
||||
&MainWindowShowingCallbackRegistration
|
||||
);
|
||||
PhRegisterCallback(
|
||||
PhGetGeneralCallback(GeneralCallbackMainMenuInitializing),
|
||||
MainMenuInitializingCallback,
|
||||
NULL,
|
||||
&MainMenuInitializingCallbackRegistration
|
||||
);
|
||||
PhRegisterCallback(
|
||||
PhGetPluginCallback(PluginInstance, PluginCallbackMenuItem),
|
||||
MenuItemCallback,
|
||||
NULL,
|
||||
&PluginMenuItemCallbackRegistration
|
||||
);
|
||||
PhRegisterCallback(
|
||||
PhGetPluginCallback(PluginInstance, PluginCallbackShowOptions),
|
||||
ShowOptionsCallback,
|
||||
NULL,
|
||||
&PluginShowOptionsCallbackRegistration
|
||||
);
|
||||
|
||||
PhAddSettings(settings, ARRAYSIZE(settings));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
62
plugins/Updater/options.c
Normal file
62
plugins/Updater/options.c
Normal file
@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Process Hacker Plugins -
|
||||
* Update Checker Plugin
|
||||
*
|
||||
* Copyright (C) 2011-2015 dmex
|
||||
*
|
||||
* This file is part of Process Hacker.
|
||||
*
|
||||
* Process Hacker 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Process Hacker 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 Process Hacker. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "updater.h"
|
||||
|
||||
INT_PTR CALLBACK OptionsDlgProc(
|
||||
_In_ HWND hwndDlg,
|
||||
_In_ UINT uMsg,
|
||||
_In_ WPARAM wParam,
|
||||
_In_ LPARAM lParam
|
||||
)
|
||||
{
|
||||
switch (uMsg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
if (PhGetIntegerSetting(SETTING_NAME_AUTO_CHECK))
|
||||
Button_SetCheck(GetDlgItem(hwndDlg, IDC_AUTOCHECKBOX), BST_CHECKED);
|
||||
}
|
||||
break;
|
||||
case WM_COMMAND:
|
||||
{
|
||||
switch (GET_WM_COMMAND_ID(wParam, lParam))
|
||||
{
|
||||
case IDCANCEL:
|
||||
EndDialog(hwndDlg, IDCANCEL);
|
||||
break;
|
||||
case IDOK:
|
||||
{
|
||||
PhSetIntegerSetting(
|
||||
SETTING_NAME_AUTO_CHECK,
|
||||
Button_GetCheck(GetDlgItem(hwndDlg, IDC_AUTOCHECKBOX)) == BST_CHECKED);
|
||||
|
||||
EndDialog(hwndDlg, IDOK);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
26
plugins/Updater/resource.h
Normal file
26
plugins/Updater/resource.h
Normal file
@ -0,0 +1,26 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by Updater.rc
|
||||
//
|
||||
#define IDD_UPDATE 101
|
||||
#define IDD_OPTIONS 103
|
||||
#define IDB_PNG1 104
|
||||
#define IDC_MESSAGE 1001
|
||||
#define IDC_AUTOCHECKBOX 1002
|
||||
#define IDC_PROGRESS 1003
|
||||
#define IDC_RELDATE 1004
|
||||
#define IDC_STATUS 1005
|
||||
#define IDC_DOWNLOAD 1006
|
||||
#define IDC_UPDATEICON 1007
|
||||
#define IDC_INFOSYSLINK 1008
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 105
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1009
|
||||
#define _APS_NEXT_SYMED_VALUE 103
|
||||
#endif
|
||||
#endif
|
1495
plugins/Updater/updater.c
Normal file
1495
plugins/Updater/updater.c
Normal file
File diff suppressed because it is too large
Load Diff
130
plugins/Updater/updater.h
Normal file
130
plugins/Updater/updater.h
Normal file
@ -0,0 +1,130 @@
|
||||
/*
|
||||
* Process Hacker Plugins -
|
||||
* Update Checker Plugin
|
||||
*
|
||||
* Copyright (C) 2011-2015 dmex
|
||||
*
|
||||
* This file is part of Process Hacker.
|
||||
*
|
||||
* Process Hacker 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Process Hacker 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 Process Hacker. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __UPDATER_H__
|
||||
#define __UPDATER_H__
|
||||
|
||||
#define CINTERFACE
|
||||
#define COBJMACROS
|
||||
#define INITGUID
|
||||
#include <phdk.h>
|
||||
#include <phappresource.h>
|
||||
#include <verify.h>
|
||||
#include <mxml.h>
|
||||
#include <windowsx.h>
|
||||
#include <winhttp.h>
|
||||
|
||||
#include "resource.h"
|
||||
|
||||
// Force update checks to succeed with debug builds
|
||||
//#define DEBUG_UPDATE
|
||||
#define UPDATE_MENUITEM 1001
|
||||
#define PH_UPDATEISERRORED (WM_APP + 101)
|
||||
#define PH_UPDATEAVAILABLE (WM_APP + 102)
|
||||
#define PH_UPDATEISCURRENT (WM_APP + 103)
|
||||
#define PH_UPDATENEWER (WM_APP + 104)
|
||||
#define PH_UPDATESUCCESS (WM_APP + 105)
|
||||
#define PH_UPDATEFAILURE (WM_APP + 106)
|
||||
#define PH_UPDATENOTSUPPORTED (WM_APP + 107)
|
||||
#define WM_SHOWDIALOG (WM_APP + 150)
|
||||
|
||||
#define PLUGIN_NAME L"ProcessHacker.UpdateChecker"
|
||||
#define SETTING_NAME_AUTO_CHECK (PLUGIN_NAME L".PromptStart")
|
||||
#define SETTING_NAME_LAST_CHECK (PLUGIN_NAME L".LastUpdateCheckTime")
|
||||
|
||||
#define MAKEDLLVERULL(major, minor, build, revision) \
|
||||
(((ULONGLONG)(major) << 48) | \
|
||||
((ULONGLONG)(minor) << 32) | \
|
||||
((ULONGLONG)(build) << 16) | \
|
||||
((ULONGLONG)(revision) << 0))
|
||||
|
||||
#define Control_Visible(hWnd, visible) \
|
||||
ShowWindow(hWnd, visible ? SW_SHOW : SW_HIDE);
|
||||
|
||||
extern PPH_PLUGIN PluginInstance;
|
||||
|
||||
typedef enum _PH_UPDATER_STATE
|
||||
{
|
||||
PhUpdateDefault = 0,
|
||||
PhUpdateDownload = 1,
|
||||
PhUpdateInstall = 2,
|
||||
PhUpdateMaximum = 3
|
||||
} PH_UPDATER_STATE;
|
||||
|
||||
typedef struct _PH_UPDATER_CONTEXT
|
||||
{
|
||||
BOOLEAN HaveData;
|
||||
PH_UPDATER_STATE UpdaterState;
|
||||
HBITMAP IconBitmap;
|
||||
HICON IconHandle;
|
||||
HFONT FontHandle;
|
||||
HWND StatusHandle;
|
||||
HWND ProgressHandle;
|
||||
HWND DialogHandle;
|
||||
|
||||
ULONG MinorVersion;
|
||||
ULONG MajorVersion;
|
||||
ULONG RevisionVersion;
|
||||
ULONG CurrentMinorVersion;
|
||||
ULONG CurrentMajorVersion;
|
||||
ULONG CurrentRevisionVersion;
|
||||
PPH_STRING Version;
|
||||
PPH_STRING RevVersion;
|
||||
PPH_STRING RelDate;
|
||||
PPH_STRING Size;
|
||||
PPH_STRING Hash;
|
||||
PPH_STRING ReleaseNotesUrl;
|
||||
PPH_STRING SetupFileDownloadUrl;
|
||||
PPH_STRING SetupFilePath;
|
||||
} PH_UPDATER_CONTEXT, *PPH_UPDATER_CONTEXT;
|
||||
|
||||
VOID ShowUpdateDialog(
|
||||
_In_opt_ PPH_UPDATER_CONTEXT Context
|
||||
);
|
||||
|
||||
VOID StartInitialCheck(
|
||||
VOID
|
||||
);
|
||||
|
||||
PPH_STRING PhGetOpaqueXmlNodeText(
|
||||
_In_ mxml_node_t *xmlNode
|
||||
);
|
||||
|
||||
BOOL PhInstalledUsingSetup(
|
||||
VOID
|
||||
);
|
||||
|
||||
INT_PTR CALLBACK UpdaterWndProc(
|
||||
_In_ HWND hwndDlg,
|
||||
_In_ UINT uMsg,
|
||||
_In_ WPARAM wParam,
|
||||
_In_ LPARAM lParam
|
||||
);
|
||||
|
||||
INT_PTR CALLBACK OptionsDlgProc(
|
||||
_In_ HWND hwndDlg,
|
||||
_In_ UINT uMsg,
|
||||
_In_ WPARAM wParam,
|
||||
_In_ LPARAM lParam
|
||||
);
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user