diff --git a/win/HGCheckNewApp/HGCheckNewApp.cpp b/win/HGCheckNewApp/HGCheckNewApp.cpp new file mode 100644 index 0000000..1931231 --- /dev/null +++ b/win/HGCheckNewApp/HGCheckNewApp.cpp @@ -0,0 +1,121 @@ +#include +#include +#include + +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; +} diff --git a/win/HGCheckNewApp/HGCheckNewApp.vcxproj b/win/HGCheckNewApp/HGCheckNewApp.vcxproj new file mode 100644 index 0000000..94e62da --- /dev/null +++ b/win/HGCheckNewApp/HGCheckNewApp.vcxproj @@ -0,0 +1,309 @@ + + + + + Debug + Win32 + + + HWRelease + Win32 + + + HWRelease + x64 + + + LSCRelease + Win32 + + + LSCRelease + x64 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {aecddb0f-9344-441e-a98a-9c88f3f49479} + HGCheckNewApp + 10.0 + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + false + v142 + true + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + false + v142 + true + Unicode + + + Application + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + false + + + false + LSCCheckNewApp + + + false + HWCheckNewApp + + + true + + + false + + + false + LSCCheckNewApp + + + false + HWCheckNewApp + + + + Level3 + true + WIN32;_DEBUG;_WINDOWS;OEM_HUAGAO;%(PreprocessorDefinitions) + true + MultiThreadedDebug + + + Windows + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_WINDOWS;OEM_HUAGAO;%(PreprocessorDefinitions) + true + MultiThreaded + + + Windows + true + true + true + + + copy $(OutDir)HGCheckNewApp.exe $(SolutionDir)..\x86\Release\ + + + + + Level3 + true + true + true + WIN32;NDEBUG;_WINDOWS;OEM_LISICHENG;%(PreprocessorDefinitions) + true + MultiThreaded + + + Windows + true + true + true + + + copy $(OutDir)LSCCheckNewApp.exe $(SolutionDir)..\x86\Release\ + + + + + Level3 + true + true + true + WIN32;NDEBUG;_WINDOWS;OEM_HANWANG;%(PreprocessorDefinitions) + true + MultiThreaded + + + Windows + true + true + true + + + copy $(OutDir)HWCheckNewApp.exe $(SolutionDir)..\x86\Release\ + + + + + Level3 + true + _DEBUG;_WINDOWS;OEM_HUAGAO;%(PreprocessorDefinitions) + true + MultiThreadedDebug + + + Windows + true + + + + + Level3 + true + true + true + NDEBUG;_WINDOWS;OEM_HUAGAO;%(PreprocessorDefinitions) + true + MultiThreaded + + + Windows + true + true + true + + + copy $(OutDir)HGCheckNewApp.exe $(SolutionDir)..\x64\Release\ + + + + + Level3 + true + true + true + NDEBUG;_WINDOWS;OEM_LISICHENG;%(PreprocessorDefinitions) + true + MultiThreaded + + + Windows + true + true + true + + + copy $(OutDir)LSCCheckNewApp.exe $(SolutionDir)..\x64\Release\ + + + + + Level3 + true + true + true + NDEBUG;_WINDOWS;OEM_HANWANG;%(PreprocessorDefinitions) + true + MultiThreaded + + + Windows + true + true + true + + + copy $(OutDir)HWCheckNewApp.exe $(SolutionDir)..\x64\Release\ + + + + + + + + + \ No newline at end of file diff --git a/win/package/hanvon/HanvonScan_App_Setup_4.15.10000.22217.exe b/win/package/hanvon/HanvonScan_App_Setup_4.15.10000.22217.exe index 235d30b..42b0e9f 100644 Binary files a/win/package/hanvon/HanvonScan_App_Setup_4.15.10000.22217.exe and b/win/package/hanvon/HanvonScan_App_Setup_4.15.10000.22217.exe differ diff --git a/win/package/hanvon/HanvonScan_App_Setup_x64_4.16.10100.22218.exe b/win/package/hanvon/HanvonScan_App_Setup_x64_4.16.10100.22218.exe index 44e5f21..6bc7fd9 100644 Binary files a/win/package/hanvon/HanvonScan_App_Setup_x64_4.16.10100.22218.exe and b/win/package/hanvon/HanvonScan_App_Setup_x64_4.16.10100.22218.exe differ diff --git a/win/package/huagao/HuaGoScan_App_Setup_4.15.10000.22217.exe b/win/package/huagao/HuaGoScan_App_Setup_4.15.10000.22217.exe index 6d64522..3f0fcfe 100644 Binary files a/win/package/huagao/HuaGoScan_App_Setup_4.15.10000.22217.exe and b/win/package/huagao/HuaGoScan_App_Setup_4.15.10000.22217.exe differ diff --git a/win/package/huagao/HuaGoScan_App_Setup_x64_4.16.10100.22218.exe b/win/package/huagao/HuaGoScan_App_Setup_x64_4.16.10100.22218.exe index c4d8f7e..6738214 100644 Binary files a/win/package/huagao/HuaGoScan_App_Setup_x64_4.16.10100.22218.exe and b/win/package/huagao/HuaGoScan_App_Setup_x64_4.16.10100.22218.exe differ diff --git a/win/package/lanxum/LanxumScan_App_Setup_4.15.10000.22217.exe b/win/package/lanxum/LanxumScan_App_Setup_4.15.10000.22217.exe index 2760bc8..6aa82ec 100644 Binary files a/win/package/lanxum/LanxumScan_App_Setup_4.15.10000.22217.exe and b/win/package/lanxum/LanxumScan_App_Setup_4.15.10000.22217.exe differ diff --git a/win/package/lanxum/LanxumScan_App_Setup_x64_4.16.10100.22218.exe b/win/package/lanxum/LanxumScan_App_Setup_x64_4.16.10100.22218.exe index a3e6b66..f34c24c 100644 Binary files a/win/package/lanxum/LanxumScan_App_Setup_x64_4.16.10100.22218.exe and b/win/package/lanxum/LanxumScan_App_Setup_x64_4.16.10100.22218.exe differ diff --git a/win/remove_old_app/HGRemoveOldApp.sln b/win/remove_old_app/HGRemoveOldApp.sln index e752251..6fd7bbd 100644 --- a/win/remove_old_app/HGRemoveOldApp.sln +++ b/win/remove_old_app/HGRemoveOldApp.sln @@ -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 diff --git a/win/setup/scanner/HanvonScan_App_Setup.iss b/win/setup/scanner/HanvonScan_App_Setup.iss index db8a2b3..f4647f2 100644 --- a/win/setup/scanner/HanvonScan_App_Setup.iss +++ b/win/setup/scanner/HanvonScan_App_Setup.iss @@ -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); diff --git a/win/setup/scanner/HanvonScan_App_Setup_x64.iss b/win/setup/scanner/HanvonScan_App_Setup_x64.iss index 4dfb3cc..12e426e 100644 --- a/win/setup/scanner/HanvonScan_App_Setup_x64.iss +++ b/win/setup/scanner/HanvonScan_App_Setup_x64.iss @@ -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); diff --git a/win/setup/scanner/HuaGoScan_App_Setup.iss b/win/setup/scanner/HuaGoScan_App_Setup.iss index 3549c9d..6645a5c 100644 --- a/win/setup/scanner/HuaGoScan_App_Setup.iss +++ b/win/setup/scanner/HuaGoScan_App_Setup.iss @@ -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); diff --git a/win/setup/scanner/HuaGoScan_App_Setup_x64.iss b/win/setup/scanner/HuaGoScan_App_Setup_x64.iss index a37a031..8e330dd 100644 --- a/win/setup/scanner/HuaGoScan_App_Setup_x64.iss +++ b/win/setup/scanner/HuaGoScan_App_Setup_x64.iss @@ -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); diff --git a/win/setup/scanner/LanxumScan_App_Setup.iss b/win/setup/scanner/LanxumScan_App_Setup.iss index 47d73a7..ffb53fd 100644 --- a/win/setup/scanner/LanxumScan_App_Setup.iss +++ b/win/setup/scanner/LanxumScan_App_Setup.iss @@ -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); diff --git a/win/setup/scanner/LanxumScan_App_Setup_x64.iss b/win/setup/scanner/LanxumScan_App_Setup_x64.iss index 5ba3b88..c5caf48 100644 --- a/win/setup/scanner/LanxumScan_App_Setup_x64.iss +++ b/win/setup/scanner/LanxumScan_App_Setup_x64.iss @@ -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); diff --git a/win/x64/Release/HGCheckNewApp.exe b/win/x64/Release/HGCheckNewApp.exe new file mode 100644 index 0000000..a23d588 Binary files /dev/null and b/win/x64/Release/HGCheckNewApp.exe differ diff --git a/win/x64/Release/HWCheckNewApp.exe b/win/x64/Release/HWCheckNewApp.exe new file mode 100644 index 0000000..b4d4787 Binary files /dev/null and b/win/x64/Release/HWCheckNewApp.exe differ diff --git a/win/x64/Release/IsTask.dll b/win/x64/Release/IsTask.dll deleted file mode 100644 index 20f4fad..0000000 Binary files a/win/x64/Release/IsTask.dll and /dev/null differ diff --git a/win/x64/Release/LSCCheckNewApp.exe b/win/x64/Release/LSCCheckNewApp.exe new file mode 100644 index 0000000..e5f47f2 Binary files /dev/null and b/win/x64/Release/LSCCheckNewApp.exe differ diff --git a/win/x86/Release/HGCheckNewApp.exe b/win/x86/Release/HGCheckNewApp.exe new file mode 100644 index 0000000..6669b26 Binary files /dev/null and b/win/x86/Release/HGCheckNewApp.exe differ diff --git a/win/x86/Release/HWCheckNewApp.exe b/win/x86/Release/HWCheckNewApp.exe new file mode 100644 index 0000000..9758a13 Binary files /dev/null and b/win/x86/Release/HWCheckNewApp.exe differ diff --git a/win/x86/Release/LSCCheckNewApp.exe b/win/x86/Release/LSCCheckNewApp.exe new file mode 100644 index 0000000..12c5cc2 Binary files /dev/null and b/win/x86/Release/LSCCheckNewApp.exe differ