解决64位安装包卸载前不能正常判断程序是否正在运行的问题

This commit is contained in:
luoliangyi 2022-08-09 10:14:40 +08:00
parent 3f4799b110
commit 5d4ea8c652
22 changed files with 522 additions and 128 deletions

View File

@ -0,0 +1,121 @@
#include <Windows.h>
#include <atlstr.h>
#include <tlhelp32.h>
static CStringA GetInstallLocation(const CStringA& guid)
{
CStringA strInstallLoc;
HKEY hKey = NULL;
CStringA strSubKey;
strSubKey.Format("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\%s", (LPCSTR)guid);
RegOpenKeyExA(HKEY_LOCAL_MACHINE, strSubKey, 0, KEY_QUERY_VALUE, &hKey);
if (NULL != hKey)
{
CHAR szData[MAX_PATH] = { 0 };
DWORD cbData = MAX_PATH;
if (ERROR_SUCCESS == RegQueryValueExA(hKey, "InstallLocation", NULL, NULL, (LPBYTE)szData, &cbData))
{
strInstallLoc = szData;
}
RegCloseKey(hKey);
}
return strInstallLoc;
}
static bool AppIsRun(const CStringA& guid, const CStringA& appName)
{
CStringA strInstallLoc = GetInstallLocation(guid);
if (strInstallLoc.IsEmpty())
{
return false;
}
CStringW strAppPath2(strInstallLoc);
CStringW strAppName2(appName);
bool ret = false;
HANDLE hSnapshot = ::CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
if (hSnapshot != INVALID_HANDLE_VALUE)
{
PROCESSENTRY32 pe;
pe.dwSize = sizeof(PROCESSENTRY32);
BOOL bFindFirstProcess = ::Process32First(hSnapshot, &pe);
if (bFindFirstProcess)
{
do
{
WCHAR exeFullPath[1024] = { 0 };
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pe.th32ProcessID);
if (NULL != hProcess)
{
DWORD bufferLen = 1024;
::QueryFullProcessImageName(hProcess, 0, exeFullPath, &bufferLen);
::CloseHandle(hProcess);
}
CStringW strExeFullPath(exeFullPath);
int pos = strExeFullPath.ReverseFind('\\');
if (-1 != pos)
{
CStringW strExeName = strExeFullPath.Right(strExeFullPath.GetLength() - pos - 1);
strExeFullPath.MakeLower();
strAppPath2.MakeLower();
if (0 == _wcsicmp(strExeName, strAppName2) && NULL != wcsstr(strExeFullPath, strAppPath2))
{
ret = true;
break;
}
}
} while (::Process32Next(hSnapshot, &pe));
}
::CloseHandle(hSnapshot);
}
return ret;
}
int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
_In_opt_ HINSTANCE hPrevInstance,
_In_ LPWSTR lpCmdLine,
_In_ int nCmdShow)
{
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
CStringA strAppGuid, strAppName;
#if defined(OEM_HANWANG)
#ifdef _WIN64
strAppGuid = "{91B3FC8D-CA10-4754-9339-6794D4D922F6}_is1";
#else
strAppGuid = "{4486975C-CBCF-430B-BED1-427866D1738E}_is1";
#endif
strAppName = "HanvonScan.exe";
#elif defined(OEM_LISICHENG)
#ifdef _WIN64
strAppGuid = "{05FD7C3E-C683-4FB4-9DD4-E4DE94985BEF}_is1";
#else
strAppGuid = "{F2890F43-A51C-4379-BB79-992616B1D6BD}_is1";
#endif
strAppName = "LanxumScan.exe";
#else
#ifdef _WIN64
strAppGuid = "{F50A4E10-3E42-446C-A63A-DF7848C61B31}_is1";
#else
strAppGuid = "{7076DC53-5C2F-4216-9783-2A6F954FEB3E}_is1";
#endif
strAppName = "HuaGoScan.exe";
#endif
if (AppIsRun(strAppGuid, strAppName))
{
return 2;
}
return 0;
}

View File

@ -0,0 +1,309 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="HWRelease|Win32">
<Configuration>HWRelease</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="HWRelease|x64">
<Configuration>HWRelease</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="LSCRelease|Win32">
<Configuration>LSCRelease</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="LSCRelease|x64">
<Configuration>LSCRelease</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{aecddb0f-9344-441e-a98a-9c88f3f49479}</ProjectGuid>
<RootNamespace>HGCheckNewApp</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='LSCRelease|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='HWRelease|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='LSCRelease|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='HWRelease|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='LSCRelease|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='HWRelease|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='LSCRelease|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='HWRelease|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='LSCRelease|Win32'">
<LinkIncremental>false</LinkIncremental>
<TargetName>LSCCheckNewApp</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='HWRelease|Win32'">
<LinkIncremental>false</LinkIncremental>
<TargetName>HWCheckNewApp</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='LSCRelease|x64'">
<LinkIncremental>false</LinkIncremental>
<TargetName>LSCCheckNewApp</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='HWRelease|x64'">
<LinkIncremental>false</LinkIncremental>
<TargetName>HWCheckNewApp</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;OEM_HUAGAO;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;OEM_HUAGAO;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<PostBuildEvent>
<Command>copy $(OutDir)HGCheckNewApp.exe $(SolutionDir)..\x86\Release\</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='LSCRelease|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;OEM_LISICHENG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<PostBuildEvent>
<Command>copy $(OutDir)LSCCheckNewApp.exe $(SolutionDir)..\x86\Release\</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='HWRelease|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;OEM_HANWANG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<PostBuildEvent>
<Command>copy $(OutDir)HWCheckNewApp.exe $(SolutionDir)..\x86\Release\</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_WINDOWS;OEM_HUAGAO;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_WINDOWS;OEM_HUAGAO;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<PostBuildEvent>
<Command>copy $(OutDir)HGCheckNewApp.exe $(SolutionDir)..\x64\Release\</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='LSCRelease|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_WINDOWS;OEM_LISICHENG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<PostBuildEvent>
<Command>copy $(OutDir)LSCCheckNewApp.exe $(SolutionDir)..\x64\Release\</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='HWRelease|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_WINDOWS;OEM_HANWANG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<PostBuildEvent>
<Command>copy $(OutDir)HWCheckNewApp.exe $(SolutionDir)..\x64\Release\</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="HGCheckNewApp.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -5,6 +5,8 @@ VisualStudioVersion = 16.0.32228.343
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HGRemoveOldApp", "HGRemoveOldApp.vcxproj", "{69A2127B-5734-48AE-834C-2F6995EAD33E}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HGCheckNewApp", "..\HGCheckNewApp\HGCheckNewApp.vcxproj", "{AECDDB0F-9344-441E-A98A-9C88F3F49479}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
@ -33,6 +35,22 @@ Global
{69A2127B-5734-48AE-834C-2F6995EAD33E}.Release|x64.Build.0 = Release|x64
{69A2127B-5734-48AE-834C-2F6995EAD33E}.Release|x86.ActiveCfg = Release|Win32
{69A2127B-5734-48AE-834C-2F6995EAD33E}.Release|x86.Build.0 = Release|Win32
{AECDDB0F-9344-441E-A98A-9C88F3F49479}.Debug|x64.ActiveCfg = Debug|x64
{AECDDB0F-9344-441E-A98A-9C88F3F49479}.Debug|x64.Build.0 = Debug|x64
{AECDDB0F-9344-441E-A98A-9C88F3F49479}.Debug|x86.ActiveCfg = Debug|Win32
{AECDDB0F-9344-441E-A98A-9C88F3F49479}.Debug|x86.Build.0 = Debug|Win32
{AECDDB0F-9344-441E-A98A-9C88F3F49479}.HWRelease|x64.ActiveCfg = HWRelease|x64
{AECDDB0F-9344-441E-A98A-9C88F3F49479}.HWRelease|x64.Build.0 = HWRelease|x64
{AECDDB0F-9344-441E-A98A-9C88F3F49479}.HWRelease|x86.ActiveCfg = HWRelease|Win32
{AECDDB0F-9344-441E-A98A-9C88F3F49479}.HWRelease|x86.Build.0 = HWRelease|Win32
{AECDDB0F-9344-441E-A98A-9C88F3F49479}.LSCRelease|x64.ActiveCfg = LSCRelease|x64
{AECDDB0F-9344-441E-A98A-9C88F3F49479}.LSCRelease|x64.Build.0 = LSCRelease|x64
{AECDDB0F-9344-441E-A98A-9C88F3F49479}.LSCRelease|x86.ActiveCfg = LSCRelease|Win32
{AECDDB0F-9344-441E-A98A-9C88F3F49479}.LSCRelease|x86.Build.0 = LSCRelease|Win32
{AECDDB0F-9344-441E-A98A-9C88F3F49479}.Release|x64.ActiveCfg = Release|x64
{AECDDB0F-9344-441E-A98A-9C88F3F49479}.Release|x64.Build.0 = Release|x64
{AECDDB0F-9344-441E-A98A-9C88F3F49479}.Release|x86.ActiveCfg = Release|Win32
{AECDDB0F-9344-441E-A98A-9C88F3F49479}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -47,7 +47,6 @@ Source: ".\HanvonScan_App.ico"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\..\..\code_app\doc\scanner\HanvonScan_App_Help_manual.pdf"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\x86\Release\hwusbdev.key"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\x86\Release\IsTask.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\x86\Qt\iconengines\*"; DestDir: "{app}\iconengines\"; Flags: ignoreversion
Source: "..\..\x86\Qt\imageformats\*"; DestDir: "{app}\imageformats\"; Flags: ignoreversion
@ -101,7 +100,8 @@ Source: "..\..\x86\Release\DPInst32.exe"; DestDir: "{app}\"; Flags: ignoreversi
Source: "..\..\x64\Release\DPInst64.exe"; DestDir: "{app}\"; Flags: ignoreversion recursesubdirs; Check: IsWin64
; ÁÙʱʹÓÃ
Source: "..\..\x86\Release\HWRemoveOldApp.exe"; DestDir: "{tmp}\"; Flags: ignoreversion
Source: "..\..\x86\Release\HWRemoveOldApp.exe"; DestDir: "{tmp}\"; Flags: ignoreversion
Source: "..\..\x86\Release\HWCheckNewApp.exe"; DestDir: "{app}\"; Flags: ignoreversion
[INI]
@ -114,21 +114,10 @@ Name: "{group}\{cm:UninstallProgram, {#MyAppName}}"; Filename: "{uninstallexe}";
[Registry]
Root: HKLM; Subkey: "Software\HanvonScan"; ValueType: string; ValueName: "AppDirectory"; ValueData: "{app}"; Flags: uninsdeletekey
Root: HKLM; Subkey: "Software\HanvonScan"; ValueType: string; ValueName: "Application"; ValueData: "{app}\LanvonScan.exe"; Flags: uninsdeletekey
Root: HKLM; Subkey: "Software\HanvonScan"; ValueType: string; ValueName: "Application"; ValueData: "{app}\HanvonScan.exe"; Flags: uninsdeletekey
Root: HKLM; Subkey: "Software\HanvonScan"; ValueType: string; ValueName: "AppVersion"; ValueData: "{#MyAppVersion}"; Flags: uninsdeletekey
[Code]
function RunTask(FileName: string; bFullpath: Boolean): Boolean;
external 'RunTask@files:ISTask.dll stdcall delayload';
function KillTask(ExeFileName: string): Integer;
external 'KillTask@files:ISTask.dll stdcall delayload';
// 卸载前判断进程是否在运行
function RunTaskU(FileName: string; bFullpath: Boolean): Boolean;
external 'RunTask@{app}/ISTask.dll stdcall delayload uninstallonly';
function KillTaskU(ExeFileName: string): Integer;
external 'KillTask@{app}/ISTask.dll stdcall delayload uninstallonly';
function InitializeSetup(): boolean;
var
ErrorCode: Integer;
@ -165,16 +154,18 @@ var
ErrorCode: Integer;
begin
Result := false;
if RunTaskU('HanvonScan.exe', false) then
if Exec(ExpandConstant('{app}\HWCheckNewApp.exe'), '', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode) then
begin
MsgBox('请关闭扫描软件再卸载!', mbInformation, MB_OK);
if 0 = ErrorCode then
begin
ShellExec('', ExpandConstant('{app}\HWUpgradeApp.exe'), '-type=postuninstallinfo -appName=Scanner -desc=uninstall', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode);
Result := true;
end
else
begin
MsgBox('请关闭扫描软件再卸载!', mbInformation, MB_OK);
end
end
else
begin
ShellExec('', ExpandConstant('{app}\HWUpgradeApp.exe'), '-type=postuninstallinfo -appName=Scanner -desc=uninstall', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode);
Result:= true;
end
UnloadDll(ExpandConstant('{app}/ISTask.dll'));
end;
procedure CurPageChanged(CurPageID: Integer);

View File

@ -48,7 +48,6 @@ Source: ".\HanvonScan_App.ico"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\..\..\code_app\doc\scanner\HanvonScan_App_Help_manual.pdf"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\x64\Release\hwusbdev.key"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\x64\Release\IsTask.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\x64\Qt\iconengines\*"; DestDir: "{app}\iconengines\"; Flags: ignoreversion
Source: "..\..\x64\Qt\imageformats\*"; DestDir: "{app}\imageformats\"; Flags: ignoreversion
@ -101,7 +100,8 @@ Source: "..\..\x64\Release\scannerusb.cat"; DestDir: "{app}\driver\"; Flags: ig
Source: "..\..\x64\Release\DPInst64.exe"; DestDir: "{app}\"; Flags: ignoreversion recursesubdirs;
; ÁÙʱʹÓÃ
Source: "..\..\x86\Release\HWRemoveOldApp.exe"; DestDir: "{tmp}\"; Flags: ignoreversion
Source: "..\..\x86\Release\HWRemoveOldApp.exe"; DestDir: "{tmp}\"; Flags: ignoreversion
Source: "..\..\x64\Release\HWCheckNewApp.exe"; DestDir: "{app}\"; Flags: ignoreversion
[INI]
@ -114,21 +114,10 @@ Name: "{group}\{cm:UninstallProgram, {#MyAppName}}"; Filename: "{uninstallexe}";
[Registry]
Root: HKLM; Subkey: "Software\HanvonScan"; ValueType: string; ValueName: "AppDirectory"; ValueData: "{app}"; Flags: uninsdeletekey
Root: HKLM; Subkey: "Software\HanvonScan"; ValueType: string; ValueName: "Application"; ValueData: "{app}\LanvonScan.exe"; Flags: uninsdeletekey
Root: HKLM; Subkey: "Software\HanvonScan"; ValueType: string; ValueName: "Application"; ValueData: "{app}\HanvonScan.exe"; Flags: uninsdeletekey
Root: HKLM; Subkey: "Software\HanvonScan"; ValueType: string; ValueName: "AppVersion"; ValueData: "{#MyAppVersion}"; Flags: uninsdeletekey
[Code]
function RunTask(FileName: string; bFullpath: Boolean): Boolean;
external 'RunTask@files:ISTask.dll stdcall delayload';
function KillTask(ExeFileName: string): Integer;
external 'KillTask@files:ISTask.dll stdcall delayload';
// 卸载前判断进程是否在运行
function RunTaskU(FileName: string; bFullpath: Boolean): Boolean;
external 'RunTask@{app}/ISTask.dll stdcall delayload uninstallonly';
function KillTaskU(ExeFileName: string): Integer;
external 'KillTask@{app}/ISTask.dll stdcall delayload uninstallonly';
function InitializeSetup(): boolean;
var
ErrorCode: Integer;
@ -165,16 +154,18 @@ var
ErrorCode: Integer;
begin
Result := false;
if RunTaskU('HanvonScan.exe', false) then
if Exec(ExpandConstant('{app}\HWCheckNewApp.exe'), '', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode) then
begin
MsgBox('请关闭扫描软件再卸载!', mbInformation, MB_OK);
if 0 = ErrorCode then
begin
ShellExec('', ExpandConstant('{app}\HWUpgradeApp.exe'), '-type=postuninstallinfo -appName=Scanner -desc=uninstall', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode);
Result := true;
end
else
begin
MsgBox('请关闭扫描软件再卸载!', mbInformation, MB_OK);
end
end
else
begin
ShellExec('', ExpandConstant('{app}\HWUpgradeApp.exe'), '-type=postuninstallinfo -appName=Scanner -desc=uninstall', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode);
Result:= true;
end
UnloadDll(ExpandConstant('{app}/ISTask.dll'));
end;
procedure CurPageChanged(CurPageID: Integer);

View File

@ -48,7 +48,6 @@ Source: ".\HuaGoScan_App.ico"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\..\..\code_app\doc\scanner\HuaGoScan_App_Help_manual.pdf"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\x86\Release\hwusbdev.key"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\x86\Release\IsTask.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\x86\Qt\iconengines\*"; DestDir: "{app}\iconengines\"; Flags: ignoreversion
Source: "..\..\x86\Qt\imageformats\*"; DestDir: "{app}\imageformats\"; Flags: ignoreversion
@ -103,7 +102,8 @@ Source: "..\..\x86\Release\DPInst32.exe"; DestDir: "{app}\"; Flags: ignoreversi
Source: "..\..\x64\Release\DPInst64.exe"; DestDir: "{app}\"; Flags: ignoreversion recursesubdirs; Check: IsWin64
; ÁÙʱʹÓÃ
Source: "..\..\x86\Release\HGRemoveOldApp.exe"; DestDir: "{tmp}\"; Flags: ignoreversion
Source: "..\..\x86\Release\HGRemoveOldApp.exe"; DestDir: "{tmp}\"; Flags: ignoreversion
Source: "..\..\x86\Release\HGCheckNewApp.exe"; DestDir: "{app}\"; Flags: ignoreversion
[INI]
@ -120,17 +120,6 @@ Root: HKLM; Subkey: "Software\HuaGoScan"; ValueType: string; ValueName: "Applica
Root: HKLM; Subkey: "Software\HuaGoScan"; ValueType: string; ValueName: "AppVersion"; ValueData: "{#MyAppVersion}"; Flags: uninsdeletekey
[Code]
function RunTask(FileName: string; bFullpath: Boolean): Boolean;
external 'RunTask@files:ISTask.dll stdcall delayload';
function KillTask(ExeFileName: string): Integer;
external 'KillTask@files:ISTask.dll stdcall delayload';
// 卸载前判断进程是否在运行
function RunTaskU(FileName: string; bFullpath: Boolean): Boolean;
external 'RunTask@{app}/ISTask.dll stdcall delayload uninstallonly';
function KillTaskU(ExeFileName: string): Integer;
external 'KillTask@{app}/ISTask.dll stdcall delayload uninstallonly';
function InitializeSetup(): boolean;
var
ErrorCode: Integer;
@ -167,16 +156,18 @@ var
ErrorCode: Integer;
begin
Result := false;
if RunTaskU('HuaGoScan.exe', false) then
if Exec(ExpandConstant('{app}\HGCheckNewApp.exe'), '', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode) then
begin
MsgBox('请关闭扫描软件再卸载!', mbInformation, MB_OK);
if 0 = ErrorCode then
begin
ShellExec('', ExpandConstant('{app}\HGUpgradeApp.exe'), '-type=postuninstallinfo -appName=Scanner -desc=uninstall', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode);
Result := true;
end
else
begin
MsgBox('请关闭扫描软件再卸载!', mbInformation, MB_OK);
end
end
else
begin
ShellExec('', ExpandConstant('{app}\HGUpgradeApp.exe'), '-type=postuninstallinfo -appName=Scanner -desc=uninstall', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode);
Result:= true;
end
UnloadDll(ExpandConstant('{app}/ISTask.dll'));
end;
procedure CurPageChanged(CurPageID: Integer);

View File

@ -49,7 +49,6 @@ Source: ".\HuaGoScan_App.ico"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\..\..\code_app\doc\scanner\HuaGoScan_App_Help_manual.pdf"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\x64\Release\hwusbdev.key"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\x64\Release\IsTask.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\x64\Qt\iconengines\*"; DestDir: "{app}\iconengines\"; Flags: ignoreversion
Source: "..\..\x64\Qt\imageformats\*"; DestDir: "{app}\imageformats\"; Flags: ignoreversion
@ -103,7 +102,8 @@ Source: "..\..\x64\Release\scannerusb.cat"; DestDir: "{app}\driver\"; Flags: ig
Source: "..\..\x64\Release\DPInst64.exe"; DestDir: "{app}\"; Flags: ignoreversion recursesubdirs;
; ÁÙʱʹÓÃ
Source: "..\..\x86\Release\HGRemoveOldApp.exe"; DestDir: "{tmp}\"; Flags: ignoreversion
Source: "..\..\x86\Release\HGRemoveOldApp.exe"; DestDir: "{tmp}\"; Flags: ignoreversion
Source: "..\..\x64\Release\HGCheckNewApp.exe"; DestDir: "{app}\"; Flags: ignoreversion
[INI]
@ -120,17 +120,6 @@ Root: HKLM; Subkey: "Software\HuaGoScan"; ValueType: string; ValueName: "Applica
Root: HKLM; Subkey: "Software\HuaGoScan"; ValueType: string; ValueName: "AppVersion"; ValueData: "{#MyAppVersion}"; Flags: uninsdeletekey
[Code]
function RunTask(FileName: string; bFullpath: Boolean): Boolean;
external 'RunTask@files:ISTask.dll stdcall delayload';
function KillTask(ExeFileName: string): Integer;
external 'KillTask@files:ISTask.dll stdcall delayload';
// 卸载前判断进程是否在运行
function RunTaskU(FileName: string; bFullpath: Boolean): Boolean;
external 'RunTask@{app}/ISTask.dll stdcall delayload uninstallonly';
function KillTaskU(ExeFileName: string): Integer;
external 'KillTask@{app}/ISTask.dll stdcall delayload uninstallonly';
function InitializeSetup(): boolean;
var
ErrorCode: Integer;
@ -167,16 +156,18 @@ var
ErrorCode: Integer;
begin
Result := false;
if RunTaskU('HuaGoScan.exe', false) then
if Exec(ExpandConstant('{app}\HGCheckNewApp.exe'), '', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode) then
begin
MsgBox('请关闭扫描软件再卸载!', mbInformation, MB_OK);
if 0 = ErrorCode then
begin
ShellExec('', ExpandConstant('{app}\HGUpgradeApp.exe'), '-type=postuninstallinfo -appName=Scanner -desc=uninstall', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode);
Result := true;
end
else
begin
MsgBox('请关闭扫描软件再卸载!', mbInformation, MB_OK);
end
end
else
begin
ShellExec('', ExpandConstant('{app}\HGUpgradeApp.exe'), '-type=postuninstallinfo -appName=Scanner -desc=uninstall', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode);
Result:= true;
end
UnloadDll(ExpandConstant('{app}/ISTask.dll'));
end;
procedure CurPageChanged(CurPageID: Integer);

View File

@ -49,7 +49,6 @@ Source: ".\LanxumScan_App.ico"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\..\..\code_app\doc\scanner\LanxumScan_App_Help_manual.pdf"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\x86\Release\hwusbdev.key"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\x86\Release\IsTask.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\x86\Qt\iconengines\*"; DestDir: "{app}\iconengines\"; Flags: ignoreversion
Source: "..\..\x86\Qt\imageformats\*"; DestDir: "{app}\imageformats\"; Flags: ignoreversion
@ -105,7 +104,8 @@ Source: "..\..\x86\Release\DPInst32.exe"; DestDir: "{app}\"; Flags: ignoreversi
Source: "..\..\x64\Release\DPInst64.exe"; DestDir: "{app}\"; Flags: ignoreversion recursesubdirs; Check: IsWin64
; ÁÙʱʹÓÃ
Source: "..\..\x86\Release\LSCRemoveOldApp.exe"; DestDir: "{tmp}\"; Flags: ignoreversion
Source: "..\..\x86\Release\LSCRemoveOldApp.exe"; DestDir: "{tmp}\"; Flags: ignoreversion
Source: "..\..\x86\Release\LSCCheckNewApp.exe"; DestDir: "{app}\"; Flags: ignoreversion
[INI]
@ -121,17 +121,6 @@ Root: HKLM; Subkey: "Software\LanxumScan"; ValueType: string; ValueName: "Applic
Root: HKLM; Subkey: "Software\LanxumScan"; ValueType: string; ValueName: "AppVersion"; ValueData: "{#MyAppVersion}"; Flags: uninsdeletekey
[Code]
function RunTask(FileName: string; bFullpath: Boolean): Boolean;
external 'RunTask@files:ISTask.dll stdcall delayload';
function KillTask(ExeFileName: string): Integer;
external 'KillTask@files:ISTask.dll stdcall delayload';
// 卸载前判断进程是否在运行
function RunTaskU(FileName: string; bFullpath: Boolean): Boolean;
external 'RunTask@{app}/ISTask.dll stdcall delayload uninstallonly';
function KillTaskU(ExeFileName: string): Integer;
external 'KillTask@{app}/ISTask.dll stdcall delayload uninstallonly';
function InitializeSetup(): boolean;
var
ErrorCode: Integer;
@ -168,16 +157,18 @@ var
ErrorCode: Integer;
begin
Result := false;
if RunTaskU('LanxumScan.exe', false) then
if Exec(ExpandConstant('{app}\LSCCheckNewApp.exe'), '', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode) then
begin
MsgBox('请关闭扫描软件再卸载!', mbInformation, MB_OK);
if 0 = ErrorCode then
begin
ShellExec('', ExpandConstant('{app}\LSCUpgradeApp.exe'), '-type=postuninstallinfo -appName=Scanner -desc=uninstall', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode);
Result := true;
end
else
begin
MsgBox('请关闭扫描软件再卸载!', mbInformation, MB_OK);
end
end
else
begin
ShellExec('', ExpandConstant('{app}\LSCUpgradeApp.exe'), '-type=postuninstallinfo -appName=Scanner -desc=uninstall', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode);
Result:= true;
end
UnloadDll(ExpandConstant('{app}/ISTask.dll'));
end;
procedure CurPageChanged(CurPageID: Integer);

View File

@ -50,7 +50,6 @@ Source: ".\LanxumScan_App.ico"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\..\..\code_app\doc\scanner\LanxumScan_App_Help_manual.pdf"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\x64\Release\hwusbdev.key"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\x64\Release\IsTask.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\..\x64\Qt\iconengines\*"; DestDir: "{app}\iconengines\"; Flags: ignoreversion
Source: "..\..\x64\Qt\imageformats\*"; DestDir: "{app}\imageformats\"; Flags: ignoreversion
@ -105,7 +104,8 @@ Source: "..\..\x64\Release\scannerusb.cat"; DestDir: "{app}\driver\"; Flags: ig
Source: "..\..\x64\Release\DPInst64.exe"; DestDir: "{app}\"; Flags: ignoreversion recursesubdirs;
; ÁÙʱʹÓÃ
Source: "..\..\x86\Release\LSCRemoveOldApp.exe"; DestDir: "{tmp}\"; Flags: ignoreversion
Source: "..\..\x86\Release\LSCRemoveOldApp.exe"; DestDir: "{tmp}\"; Flags: ignoreversion
Source: "..\..\x64\Release\LSCCheckNewApp.exe"; DestDir: "{app}\"; Flags: ignoreversion
[INI]
@ -121,17 +121,6 @@ Root: HKLM; Subkey: "Software\LanxumScan"; ValueType: string; ValueName: "Applic
Root: HKLM; Subkey: "Software\LanxumScan"; ValueType: string; ValueName: "AppVersion"; ValueData: "{#MyAppVersion}"; Flags: uninsdeletekey
[Code]
function RunTask(FileName: string; bFullpath: Boolean): Boolean;
external 'RunTask@files:ISTask.dll stdcall delayload';
function KillTask(ExeFileName: string): Integer;
external 'KillTask@files:ISTask.dll stdcall delayload';
// 卸载前判断进程是否在运行
function RunTaskU(FileName: string; bFullpath: Boolean): Boolean;
external 'RunTask@{app}/ISTask.dll stdcall delayload uninstallonly';
function KillTaskU(ExeFileName: string): Integer;
external 'KillTask@{app}/ISTask.dll stdcall delayload uninstallonly';
function InitializeSetup(): boolean;
var
ErrorCode: Integer;
@ -168,16 +157,18 @@ var
ErrorCode: Integer;
begin
Result := false;
if RunTaskU('LanxumScan.exe', false) then
if Exec(ExpandConstant('{app}\LSCCheckNewApp.exe'), '', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode) then
begin
MsgBox('请关闭扫描软件再卸载!', mbInformation, MB_OK);
if 0 = ErrorCode then
begin
ShellExec('', ExpandConstant('{app}\LSCUpgradeApp.exe'), '-type=postuninstallinfo -appName=Scanner -desc=uninstall', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode);
Result := true;
end
else
begin
MsgBox('请关闭扫描软件再卸载!', mbInformation, MB_OK);
end
end
else
begin
ShellExec('', ExpandConstant('{app}\LSCUpgradeApp.exe'), '-type=postuninstallinfo -appName=Scanner -desc=uninstall', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode);
Result:= true;
end
UnloadDll(ExpandConstant('{app}/ISTask.dll'));
end;
procedure CurPageChanged(CurPageID: Integer);

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.