Browse Source

!10404 启动优化项目
Merge pull request !10404 from 80374374/feature_installscripts

Gifur 1 year ago
parent
commit
352955e511

+ 6 - 8
CMakeLists.txt

@@ -283,9 +283,6 @@ if(CONAN_CACHE_CLEAR)
 	conan_local_remove()
 endif(CONAN_CACHE_CLEAR)
 
-conan_cmake_run(REQUIRES Audio/2024.0118.01@LR04.02_MediaRes/testing
-BASIC_SETUP CMAKE_TARGETS)
-
 include(DependencyConanFiles)
 
 set(RVC_CONAN_DEP_LIBS ${CONAN_BIN_DIRS})
@@ -485,6 +482,7 @@ set(RVC_CONFIG_PATH    "${PACK_INSTALL_PREFIX_CUR_VER}/cfg")
 set(RVC_VENDOR_PATH  "${PACK_INSTALL_PREFIX_CUR_VER}/dep")
 set(RVC_SHARED_PATH   "${PACK_INSTALL_PREFIX_CUR_VER}/share")
 set(RVC_RESOURCE_PATH   "${PACK_INSTALL_PREFIX_CUR_VER}/res")
+set(RVC_EXTEND_PATH   "${PACK_INSTALL_PREFIX_CUR_VER}/ext")
 #win
 set(RVC_CHROMIUM_PATH "${RVC_RUNTIME_PATH}/Chromium")
 set(CMAKE_INSTALL_INCLUDEDIR ${RVC_INCLUDE_PATH})
@@ -665,13 +663,11 @@ else(MSVC)
 	endif(NOT DEVOPS_ON)
 
 	install(CODE "execute_process(COMMAND 'chmod 0777 ${CMAKE_SOURCE_DIR}/addin/packaging/DEBIAN/*')")
-	install(FILES "${CMAKE_SOURCE_DIR}/addin/packaging/DEBIAN/logo.png"
-		"${CMAKE_SOURCE_DIR}/addin/packaging/DEBIAN/spexplorerauto.desktop"
+	install(FILES "${CMAKE_SOURCE_DIR}/addin/packaging/DEBIAN/spexplorerauto.desktop"
 		DESTINATION "${PACK_INSTALL_RVC_DIR}/Resources" COMPONENT resources)
 endif(MSVC)
 
 install(FILES "${CMAKE_SOURCE_DIR}/addin/assets/VTM.ico"
-	"${CMAKE_SOURCE_DIR}/addin/packaging/DEBIAN/WallPaper1280.png"
 	"${CMAKE_SOURCE_DIR}/addin/packaging/DEBIAN/WallPaper1920.png"
 	DESTINATION "${PACK_INSTALL_RVC_DIR}/Resources" COMPONENT resources)
 
@@ -819,8 +815,6 @@ install(FILES ${ENTITY_INTERFACE_XML_FILES} DESTINATION "${PACK_INSTALL_PREFIX_C
 file(GLOB RVC_RESOURCE_FILES LIST_DIRECTORIES FALSE "${CMAKE_SOURCE_DIR}/addin/assets/*")
 install(FILES ${RVC_RESOURCE_FILES} DESTINATION ${RVC_RUNTIME_PATH} COMPONENT resources)
 
-install(DIRECTORY "${CONAN_RES_DIRS_AUDIO}" DESTINATION "${PACK_INSTALL_DATA_DIR}" COMPONENT resources)
-
 if(CONAN_RES_DIRS_SOGOUIME)
 	message(STATUS "include sogou input installation.")
 	install(DIRECTORY "${CONAN_RES_DIRS_SOGOUIME}" DESTINATION "${PACK_INSTALL_DATA_DIR}" COMPONENT resources)
@@ -857,6 +851,10 @@ if(WITH_PDB_SAVEV2)
 	install(CODE "MESSAGE(\"----Pack PDB File Done----\")" COMPONENT symbols)
 endif(WITH_PDB_SAVEV2)
 
+if(MSVC AND DEVOPS_ON_CMAKE_PRD)
+	install(DIRECTORY "${CMAKE_SOURCE_DIR}/addin/din/OFSUpgrade/autostart_unify" DESTINATION "${RVC_EXTEND_PATH}" COMPONENT resources)
+endif(MSVC AND DEVOPS_ON_CMAKE_PRD)
+
 #appoint the component to install , except header file here.
  #set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
 set(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE TRUE)

+ 2 - 2
Module/include/CommEntityUtil.hpp

@@ -667,7 +667,7 @@ static std::string W2S(const std::wstring wstr)
 		std::memset(str, 0, sizeof(char) * (n + 1));
 		::WideCharToMultiByte(CP_ACP, 0, wstr.c_str(), -1, &str[0], n, NULL, NULL);
 		std::string strr(str);
-		delete str;
+		delete [] str;
 		return strr;
 	}
 #else
@@ -689,7 +689,7 @@ static std::wstring S2W(const std::string str)
 		std::memset(wstr, 0, (n + 1) * sizeof(wchar_t));
 		::MultiByteToWideChar(CP_ACP, 0, str.c_str(), -1, &wstr[0], n);
 		std::wstring strr(wstr);
-		delete wstr;
+		delete [] wstr;
 		return strr;
 	}
 #else

+ 69 - 9
Module/mod_ResourceWatcher/ResourceWatcherFSM.cpp

@@ -1868,20 +1868,20 @@ void ResourceWatcherFSM::DetectDestopFileAndWarn(bool bClear, CSimpleStringA& st
     char sys_disk = '\0';
     bufCharCount = INFO_BUFFER_SIZE;
     if (!GetComputerName(infoBuf, &bufCharCount))
-        DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("GetComputerName failed, GLE=%u", GetLastError());
-    else DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Computer name:      %s", infoBuf);
+        DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("GetComputerName failed, GLE=%u", GetLastError());
+    else DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("Computer name:      %s", infoBuf);
 
     // Get and display the user name. 
     ZeroMemory(infoBuf, INFO_BUFFER_SIZE);
     bufCharCount = INFO_BUFFER_SIZE;
     if (!GetUserName(infoBuf, &bufCharCount)) {
-        DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("GetUserName failed, GLE=%u", GetLastError());
+        DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("GetUserName failed, GLE=%u", GetLastError());
     }
     else
     {
 		CSimpleStringA filelist(true);
 		int dirCount(0), fileCount(0);
-        DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("User name:          %s", infoBuf);
+        DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("User name:          %s", infoBuf);
         CSimpleStringA desktopFullPath = CSimpleStringA::Format("C:\\Users\\%s\\Desktop", infoBuf);
         CSimpleStringA desktopPublicPath("C:\\Users\\Public\\Desktop");
         CAutoArray<CSimpleStringA> desktopPaths;
@@ -1897,19 +1897,19 @@ void ResourceWatcherFSM::DetectDestopFileAndWarn(bool bClear, CSimpleStringA& st
 					char* filename = strrchr(file, '\\');
 					if (filename != NULL) { filename += 1; }
 					else { filename = file; }
-                    DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("filename:%s", filename);
+                    DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("filename:%s", filename);
                     bool toRecord = true;
 					if (bClear) {
 						std::string strLowFileName = SP::Utility::ToLower(std::string(filename));
 						if (strFileSaveList.IsNullOrEmpty() || strFileSaveList.IndexOf(strLowFileName.c_str()) == -1) {
-							DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("delete desktop file:%s", filename);
+							DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("delete desktop file:%s", filename);
 							RemoveFileA(file);
 							if (!ExistsFileA(file)) {
 								toRecord = false;
 							}
 						}
 						else {
-							DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("skip to delete: %s", filename);
+							DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("skip to delete: %s", filename);
 						}
 					}
                     if (toRecord) {
@@ -1933,10 +1933,10 @@ void ResourceWatcherFSM::DetectDestopFileAndWarn(bool bClear, CSimpleStringA& st
 					char* dirname = strrchr(dir, '\\');
 					if (dirname != NULL) { dirname += 1; }
 					else { dirname = dir; }
-                    DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("dir name:%s", dirname);
+                    DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("dir name:%s", dirname);
                     bool toRecord = true;
 					if (bClear) {
-						DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("remove desktop dir:%s", dirname);
+						DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("remove desktop dir:%s", dirname);
 						RemoveDirRecursiveA(dir);
 						if (!ExistsDirA(dir)) {
 							toRecord = false;
@@ -1962,6 +1962,66 @@ void ResourceWatcherFSM::DetectDestopFileAndWarn(bool bClear, CSimpleStringA& st
     }
 }
 
+void ResourceWatcherFSM::DetectAutoStartFileAndWarn()
+{
+    const DWORD INFO_BUFFER_SIZE = 2048;
+    char infoBuf[INFO_BUFFER_SIZE];
+    DWORD bufCharCount = INFO_BUFFER_SIZE;
+    char sys_disk = '\0';
+    bufCharCount = INFO_BUFFER_SIZE;
+    if (!GetComputerName(infoBuf, &bufCharCount))
+        DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("GetComputerName failed, GLE=%u", GetLastError());
+    else DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("Computer name:      %s", infoBuf);
+
+    // Get and display the user name. 
+    ZeroMemory(infoBuf, INFO_BUFFER_SIZE);
+    bufCharCount = INFO_BUFFER_SIZE;
+    if (!GetUserName(infoBuf, &bufCharCount)) {
+        DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("GetUserName failed, GLE=%u", GetLastError());
+    }
+    else
+    {
+        DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("User name:          %s", infoBuf);
+        CSimpleStringA startMenuFullPath = CSimpleStringA::Format("C:\\Users\\%s\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup", infoBuf);
+        CSimpleStringA startMenuPublicPath("C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp");
+        CAutoArray<CSimpleStringA> desktopPaths;
+        CAutoArray<CSimpleStringA> fileContents;
+        CAutoArray<unsigned int> fileCounts;
+        desktopPaths.Init(2);
+        fileContents.Init(2);
+        fileCounts.Init(2);
+        desktopPaths[0] = startMenuFullPath;
+        desktopPaths[1] = startMenuPublicPath;
+        fileContents[0] = "";
+        fileContents[1] = "";
+        fileCounts[0] = 0;
+        fileCounts[1] = 0;
+        for (int k = 0; k < desktopPaths.GetCount(); ++k) {
+            CSimpleStringA& curPath = desktopPaths[k];
+            CSimpleStringA& curVal = fileContents[k];
+            auto arr = fileutil_get_sub_files(curPath);
+            if (arr != NULL) {
+                for (int i = 0; i < arr->nelts; ++i) {
+                    char* file = ARRAY_IDX(arr, i, char*);
+                    char* filename = strrchr(file, '\\');
+                    if (filename != NULL) { filename += 1; }
+                    else { filename = file; }
+                    fileCounts[k]++;
+                    DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("filename:%s", filename);
+                    if (!curVal.IsNullOrEmpty()) {
+                        curVal += "|";
+                    }
+                    curVal += filename;
+                }
+                toolkit_array_free2(arr);
+            }
+        }
+        LogWarn(Severity_Low, Error_Debug, LOG_INFO_AUTOSTART_FILESTATUS
+            , CSimpleStringA::Format("{\"subject\":\"autostart_file\",\"username\":\"%s\",\"user\":\"%s\",\"public\":\"%s\"}"
+                ,infoBuf, fileContents[0].GetData(), fileContents[1].GetData()));
+    }
+}
+
 ErrorCodeEnum ResourceWatcherFSM::DetectVTMInstalledBySetup(BOOL& fYes)
 {
     HKEY key;

+ 3 - 0
Module/mod_ResourceWatcher/ResourceWatcherFSM.h

@@ -338,6 +338,8 @@ public:
 	BOOL IsHasSetAutoStartupByFolder(CSimpleStringA& strPath, bool& scriptsType);
 	void DetectVersionHasChangedAndWarn();
 	void DetectDestopFileAndWarn(bool bClear, CSimpleStringA& strFileSaveList);
+	void DetectAutoStartFileAndWarn();
+
 	ErrorCodeEnum DetectVTMInstalledBySetup(BOOL& fYes);
 
 	void DetectVersionHasChangedAndWarnCover()
@@ -420,6 +422,7 @@ struct ClearDesktopFileTask : public ITaskSp
 	void Process()
 	{
 		m_pFSM->DetectAndClearDesktopFile();
+		m_pFSM->DetectAutoStartFileAndWarn();
 	}
 };
 

+ 1 - 0
Module/mod_ResourceWatcher/ResourceWatcher_UserCode.h

@@ -73,6 +73,7 @@
 #define LOG_INFO_DESKTOP_FILESTATUS	0x50A00055
 #define LOG_INFO_INSTALL_BY_SETUP	0x50A00056
 #define LOG_WARN_FILE_DELETE_FAILED	0x50A00057
+#define LOG_INFO_AUTOSTART_FILESTATUS	0x50A00058
 
 #define LOG_RESOURCEWATCHER_OSD_RECOVER_ENABLE 0x50A00060
 #define LOG_RESOURCEWATCHER_OSD_REMOVE_SUCC 0x50A00061

BIN
addin/din/OFSUpgrade/autostart_unify/VTM.ico


BIN
addin/din/OFSUpgrade/autostart_unify/WallPaper1920.png


+ 261 - 0
addin/din/OFSUpgrade/autostart_unify/setdesktop.bat

@@ -0,0 +1,261 @@
+@echo off
+@setlocal enabledelayedexpansion
+@set CurrentDir=%~dp0
+@cd /d %CurrentDir%
+@set ROOT=%cd%
+@set ret=-1
+@set errmsg=all process has been executed succ
+@set resultFile=%CurrentDir%result.log
+@set tmpLogFile=D:\\test.txt
+@set supportBS=1
+@echo result=-1^&msg=install begin >%resultFile%
+@echo [RVCTermianal] ========== Install Start ==========
+@echo %date:~0,4%-%date:~5,2%-%date:~8,2% %time:~0,2%:%time:~3,2%:%time:~6,2%
+@echo Current Dir: %CurrentDir%
+@echo ROOT Dir: %ROOT%
+::rem get os bit
+reg query HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0 /v "Identifier" | find "64 Family" >NUL 2>nul && set OS=64BIT || set OS=32BIT
+if %OS%==32BIT (
+    @echo [DEBUg] x86 platform
+) else (
+	@echo [DEBUg] x64 platform
+)
+@Set RunVersionPath=
+@rem 0:explorer.exe
+@rem 1:vbs
+@rem 2:vtm.exe
+@rem 3:startmenu lnk from RVCTermimalApplicationSetup
+@rem 4:startmenu lnk from install scripts
+@rem 404:unknown
+@Set CurAutoStartType=404
+@set NewAutoStartLnkName=spexplorerauto.lnk
+
+@rem 获取当前的rvc目录
+@Set RVCPath=
+@Set RVCResourcePath=
+@for %%a in ("%~dp0.") do for %%b in ("%%~dpa.") do set RVCPath=%%~dpb
+
+
+@rem 获取Resources的目录
+@set testRVCPath=%RVCPath%
+@echo testRVCPath=%testRVCPath%
+@for %%i in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do call set testRVCPath=%%testRVCPath:%%i=%%i%%
+@echo %testRVCPath% | findstr "rvc\\" >nul && (
+	@Set RVCResourcePath=%RVCPath%Resources
+)
+@echo RVCResourcePath=%RVCResourcePath%
+@if "%RVCResourcePath%" == "" (
+	@set errmsg=cannot found rvc path[%RVCPath%]
+	@set ret=-10
+	@goto UserError
+)
+@if not exist "%RVCResourcePath%" md "%RVCResourcePath%"
+@set DestAppIconPath=%RVCResourcePath%\VTM.ico
+@set SrcAppIconPath=%ROOT%\VTM.ico
+@if not exist "%DestAppIconPath%" (
+	@if not exist "%SrcAppIconPath%" (
+		@set errmsg=%SrcAppIconPath% does not exist
+		@set ret=-4
+		@goto UserError
+	)
+	@copy "%SrcAppIconPath%" %DestAppIconPath%
+)
+
+@rem 设置桌面壁纸
+:SetWallpaper
+@echo result=-1^&msg=set wallpaper >%resultFile%
+@set RVCWallpaperName=WallPaper1920.png
+@set regKey=HKEY_CURRENT_USER\Control Panel\Desktop
+@set regValue=Wallpaper
+@set regData=
+for /f "tokens=2*" %%a in ('reg query "%regKey%" /v "%regValue%" ^| findstr /i "%regValue%"') do (
+    set regData=%%b
+)
+@echo [DEBUG] The value of %regValue% is: %regData%
+@if "%regData%" == "" (
+	set supportBS=0
+	echo [DEBUG] to get Wallpaper twice
+	for /f "tokens=2*" %%a in ('reg query "\"%regKey%\"" /v "%regValue%" ^| findstr /i "%regValue%"') do (
+		set regData=%%b
+	)
+)
+echo [DEBUG] The value of %regValue% is: %regData%
+@if "%regData%" == "" (
+	@set errmsg=cannot found Wallpaper value
+	@set ret=-5
+	@goto UserError
+)
+@set WallpaperRegVal=%regData%
+@echo %regData% | findstr "%RVCWallpaperName%" >nul && (
+	@if exist %WallpaperRegVal% (
+		@echo [DEBUG] Wallpaper has been set before
+		@set errmsg=Wallpaper has been set before
+		@goto ClearSysDesktopIcon
+	)
+)
+@set WallpaperPath=%ROOT%\%RVCWallpaperName%
+@set backupWallPaperPath=%ROOT%\\%RVCWallpaperName%
+@if not exist "%WallpaperPath%" (
+	@Set errmsg=%WallpaperPath% does not exist
+	@set ret=-6
+	@goto UserError
+)
+@if not exist C:\Windows\Web\Wallpaper\%RVCWallpaperName% (
+	@if exist "C:\Windows\Web\Wallpaper" (
+		@copy "%WallpaperPath%" C:\Windows\Web\Wallpaper
+		@set WallpaperPath=C:\Windows\Web\Wallpaper\%RVCWallpaperName%
+		@set backupWallPaperPath=C:\\Windows\\Web\\Wallpaper\\%RVCWallpaperName%
+	) else (
+		@copy "%WallpaperPath%" %RVCResourcePath%
+		@set WallpaperPath=%RVCResourcePath%\%RVCWallpaperName%
+		@set backupWallPaperPath=%RVCResourcePath%\\%RVCWallpaperName%
+	)
+) else (
+	@set WallpaperPath=C:\Windows\Web\Wallpaper\%RVCWallpaperName%
+	@set backupWallPaperPath=C:\\Windows\\Web\\Wallpaper\\%RVCWallpaperName%
+)
+
+@echo [DEBUG] WallpaperPath=%WallpaperPath%
+reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d "%WallpaperPath%" /f 
+reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v WallpaperStyle /t REG_DWORD /d 2 /f
+@if %errorlevel% neq 0 (
+	echo add for Desktop first failed
+	reg add "\"HKEY_CURRENT_USER\Control Panel\Desktop\"" /v Wallpaper /t REG_SZ /d "%WallpaperPath%" /f 
+	reg add "\"HKEY_CURRENT_USER\Control Panel\Desktop\"" /v WallpaperStyle /t REG_DWORD /d 2 /f
+	@if !errorlevel! neq 0 (
+		@set errmsg=Set Wallpaper failed
+		@set ret=-11
+		@goto UserError
+	)
+)
+
+@rem 清理桌面系统图标
+:ClearSysDesktopIcon
+@set errmsg=to clear desktop system icon
+reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /v {20D04FE0-3AEA-1069-A2D8-08002B30309D} /t REG_DWORD /d 1 /f
+reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" /v {20D04FE0-3AEA-1069-A2D8-08002B30309D} /t REG_DWORD /d 1 /f
+reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /v {645FF040-5081-101B-9F08-00AA002F954E} /t REG_DWORD /d 1 /f
+reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" /v {645FF040-5081-101B-9F08-00AA002F954E} /t REG_DWORD /d 1 /f
+reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /v {F02C1A0D-BE21-4350-88B0-7367FC96EF3C} /t REG_DWORD /d 1 /f
+reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" /v {F02C1A0D-BE21-4350-88B0-7367FC96EF3C} /t REG_DWORD /d 1 /f
+reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /v {5399E694-6CE5-4D6C-8FCE-1D8870FDCBA0} /t REG_DWORD /d 1 /f
+reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" /v {5399E694-6CE5-4D6C-8FCE-1D8870FDCBA0} /t REG_DWORD /d 1 /f
+reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /v {59031a47-3f72-44a7-89c5-5595fe6b30ee} /t REG_DWORD /d 1 /f
+reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" /v {59031a47-3f72-44a7-89c5-5595fe6b30ee} /t REG_DWORD /d 1 /f
+
+@rem 设置桌面图标
+: setDesktopIcon
+
+@echo result=-1^&msg=set app desktop icon >%resultFile%
+@set errmsg=set app desktop icon
+@if not "%RunVersionPath%" == "" (
+	@if exist "%RunVersionPath%" (
+		if exist "%RunVersionPath%vtm.exe" (
+			@echo version path got previously
+			@goto SkipGetRunVersionPath
+		)
+	)
+)
+@echo [DEBUG] to get version path from syspath
+@set SYSPATH=%Path%
+@set VendorPath=%RVC_VENDOR_HOME%
+@rem 拆分环境变量获取Run/version目录
+@set manuSysPath=%SYSPATH%
+@for %%i in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do call set manuSysPath=%%manuSysPath:%%i=%%i%%
+@echo path=%manuSysPath%
+@rem Mark1
+@set prefixPath=
+@set tofind=run\version
+@set aimStr=version
+@set aimLen=7
+@set foundstr=
+
+:loop
+::从环境变量中得到版本的路径
+@for /f "tokens=1* delims=;" %%a in ("%manuSysPath%") do (
+	@set str=%%a
+	@echo !str! | findstr "%tofind%" >nul && (
+		@set foundstr=!str!
+		@goto foundit
+	)
+	@set manuSysPath=%%b
+)
+if defined manuSysPath goto :loop
+if "%foundstr%" == "" (
+	@set errmsg=cannot fetch Run path from Env::path
+	@set ret=-7
+	@goto UserError
+)
+:foundit
+@rem 从全路径里头获取version结尾
+@echo foundstr=%foundstr%
+@set fulStr=%foundstr%
+
+:next
+if not "%fulStr%" == "" (
+	@set /a num+=1
+	if "!fulStr:~0,%aimLen%!" == "%aimStr%" goto subfoundit
+	@set fulStr=%fulStr:~1%
+	goto next
+)
+@set /a num=0
+
+:subfoundit
+@echo num=%num%
+@set /a realnum=%aimLen%+%num%
+@if %num% neq 0 (
+	@set prefixPath=!foundstr:~0,%realnum%!
+)
+@echo prefixPath=%prefixPath%
+@if "prefixPath" == "" (
+	@set errmsg=cannot get run version path
+	@set ret=-8
+	@goto UserError
+)
+@set RunVersionPath=%prefixPath%
+@echo RunVersionPath=%RunVersionPath%
+:SkipGetRunVersionPath
+@rem 得到vtm.exe全路径
+@set vtmfulPath=%RunVersionPath%vtm.exe
+@echo vtm exe full path is %vtmfulPath%
+@if not exist "%vtmfulPath%" (
+	@echo [ERROR] %vtmfulPath% does not exist
+	@set errmsg=%vtmfulPath% does not exist
+	@set ret=-9
+	@goto UserError
+)
+
+@set desk_path=%USERPROFILE%\Desktop
+@set desk_path_pub=C:\Users\Public\Desktop
+@for %%a in (%desk_path%\*) do echo [DEBUG] desktop file: "%%a"
+@for %%a in (%desk_path_pub%\*) do echo [DEBUG] public desktop file: "%%a"
+@echo to clear desktop file
+@for /d %%a in (%desk_path%\*) do rd /S /Q "%%a"
+@for /d %%a in (%desk_path_pub%\*) do rd /S /Q "%%a"
+@for %%a in (%desk_path%\*) do del "%%a"
+@for %%a in (%desk_path_pub%\*) do del "%%a"
+
+mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b1=a.CreateShortcut(a.SpecialFolders(""Desktop"") & ""\可视柜台.lnk""):b1.TargetPath=""%vtmfulPath%"":b1.WorkingDirectory=""%RunVersionPath%"":b1.Description=""招行可视柜台终端应用"":b1.Save:close")
+@if exist "%desk_path%\可视柜台.lnk" (
+	@echo [DEBUG] deskop icon is exist
+)
+
+@echo [DEBUG] set deskop app icon done
+@set errmsg=all process has been executed succ
+
+:Done
+@set ret=0
+@echo all process has been executed done
+@goto End
+
+:Error
+@set ret=-1
+
+:UserError
+@echo [Error] %errmsg%
+
+:End
+@echo result=%ret%^&msg=%errmsg% >%resultFile%
+@echo result=%ret%^&msg=%errmsg%
+@echo %date:~0,4%-%date:~5,2%-%date:~8,2% %time:~0,2%:%time:~3,2%:%time:~6,2%
+@exit 0

+ 440 - 0
addin/din/OFSUpgrade/autostart_unify/settings.bat

@@ -0,0 +1,440 @@
+@echo off
+@setlocal enabledelayedexpansion
+@set CurrentDir=%~dp0
+@cd /d %CurrentDir%
+@set ROOT=%cd%
+@set ret=-1
+@set errmsg=all process has been executed succ
+@set resultFile=%CurrentDir%result.log
+@set tmpLogFile=D:\\test.txt
+@set supportBS=1
+@echo result=-1^&msg=install begin >%resultFile%
+@echo [RVCTermianal] ========== Install Start ==========
+@echo %date:~0,4%-%date:~5,2%-%date:~8,2% %time:~0,2%:%time:~3,2%:%time:~6,2%
+@echo Current Dir: %CurrentDir%
+@echo ROOT Dir: %ROOT%
+::rem get os bit
+reg query HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0 /v "Identifier" | find "64 Family" >NUL 2>nul && set OS=64BIT || set OS=32BIT
+if %OS%==32BIT (
+    @echo [DEBUg] x86 platform
+) else (
+	@echo [DEBUg] x64 platform
+)
+@Set RunVersionPath=
+@rem 0:explorer.exe
+@rem 1:vbs
+@rem 2:vtm.exe
+@rem 3:startmenu lnk from RVCTermimalApplicationSetup
+@rem 4:startmenu lnk from install scripts
+@rem 404:unknown
+@Set CurAutoStartType=404
+@set NewAutoStartLnkName=spexplorerauto.lnk
+
+@rem 获取当前的rvc目录
+@Set RVCPath=
+@Set RVCResourcePath=
+@for %%a in ("%~dp0.") do for %%b in ("%%~dpa.") do set RVCPath=%%~dpb
+
+
+@rem 获取Resources的目录
+@set testRVCPath=%RVCPath%
+@echo testRVCPath=%testRVCPath%
+@for %%i in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do call set testRVCPath=%%testRVCPath:%%i=%%i%%
+@echo %testRVCPath% | findstr "rvc\\" >nul && (
+	@Set RVCResourcePath=%RVCPath%Resources
+)
+@echo RVCResourcePath=%RVCResourcePath%
+@if "%RVCResourcePath%" == "" (
+	@set errmsg=cannot found rvc path[%RVCPath%]
+	@set ret=-10
+	@goto UserError
+)
+@if not exist "%RVCResourcePath%" md "%RVCResourcePath%"
+@set DestAppIconPath=%RVCResourcePath%\VTM.ico
+@set SrcAppIconPath=%ROOT%\VTM.ico
+@if not exist "%DestAppIconPath%" (
+	@if not exist "%SrcAppIconPath%" (
+		@set errmsg=%SrcAppIconPath% does not exist
+		@set ret=-4
+		@goto UserError
+	)
+	@copy "%SrcAppIconPath%" %DestAppIconPath%
+)
+
+@rem 设置桌面壁纸
+:SetWallpaper
+@echo result=-1^&msg=set wallpaper >%resultFile%
+@set RVCWallpaperName=WallPaper1920.png
+@set regKey=HKEY_CURRENT_USER\Control Panel\Desktop
+@set regValue=Wallpaper
+@set regData=
+for /f "tokens=2*" %%a in ('reg query "%regKey%" /v "%regValue%" ^| findstr /i "%regValue%"') do (
+    set regData=%%b
+)
+@echo [DEBUG] The value of %regValue% is: %regData%
+@if "%regData%" == "" (
+	set supportBS=0
+	echo [DEBUG] to get Wallpaper twice
+	for /f "tokens=2*" %%a in ('reg query "\"%regKey%\"" /v "%regValue%" ^| findstr /i "%regValue%"') do (
+		set regData=%%b
+	)
+)
+echo [DEBUG] The value of %regValue% is: %regData%
+@if "%regData%" == "" (
+	@set errmsg=cannot found Wallpaper value
+	@set ret=-5
+	@goto UserError
+)
+@set WallpaperRegVal=%regData%
+@echo %regData% | findstr "%RVCWallpaperName%" >nul && (
+	@if exist %WallpaperRegVal% (
+		@echo [DEBUG] Wallpaper has been set before
+		@set errmsg=Wallpaper has been set before
+		@goto ClearSysDesktopIcon
+	)
+)
+@set WallpaperPath=%ROOT%\%RVCWallpaperName%
+@set backupWallPaperPath=%ROOT%\\%RVCWallpaperName%
+@if not exist "%WallpaperPath%" (
+	@Set errmsg=%WallpaperPath% does not exist
+	@set ret=-6
+	@goto UserError
+)
+@if not exist C:\Windows\Web\Wallpaper\%RVCWallpaperName% (
+	@if exist "C:\Windows\Web\Wallpaper" (
+		@copy "%WallpaperPath%" C:\Windows\Web\Wallpaper
+		@set WallpaperPath=C:\Windows\Web\Wallpaper\%RVCWallpaperName%
+		@set backupWallPaperPath=C:\\Windows\\Web\\Wallpaper\\%RVCWallpaperName%
+	) else (
+		@copy "%WallpaperPath%" %RVCResourcePath%
+		@set WallpaperPath=%RVCResourcePath%\%RVCWallpaperName%
+		@set backupWallPaperPath=%RVCResourcePath%\\%RVCWallpaperName%
+	)
+) else (
+	@set WallpaperPath=C:\Windows\Web\Wallpaper\%RVCWallpaperName%
+	@set backupWallPaperPath=C:\\Windows\\Web\\Wallpaper\\%RVCWallpaperName%
+)
+
+@echo [DEBUG] WallpaperPath=%WallpaperPath%
+reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d "%WallpaperPath%" /f 
+reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v WallpaperStyle /t REG_DWORD /d 2 /f
+@if %errorlevel% neq 0 (
+	echo add for Desktop first failed
+	reg add "\"HKEY_CURRENT_USER\Control Panel\Desktop\"" /v Wallpaper /t REG_SZ /d "%WallpaperPath%" /f 
+	reg add "\"HKEY_CURRENT_USER\Control Panel\Desktop\"" /v WallpaperStyle /t REG_DWORD /d 2 /f
+	@if !errorlevel! neq 0 (
+		@set errmsg=Set Wallpaper failed
+		@set ret=-11
+		@goto UserError
+	)
+)
+
+@rem 清理桌面系统图标
+:ClearSysDesktopIcon
+@set errmsg=to clear desktop system icon
+reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /v {20D04FE0-3AEA-1069-A2D8-08002B30309D} /t REG_DWORD /d 1 /f
+reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" /v {20D04FE0-3AEA-1069-A2D8-08002B30309D} /t REG_DWORD /d 1 /f
+reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /v {645FF040-5081-101B-9F08-00AA002F954E} /t REG_DWORD /d 1 /f
+reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" /v {645FF040-5081-101B-9F08-00AA002F954E} /t REG_DWORD /d 1 /f
+reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /v {F02C1A0D-BE21-4350-88B0-7367FC96EF3C} /t REG_DWORD /d 1 /f
+reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" /v {F02C1A0D-BE21-4350-88B0-7367FC96EF3C} /t REG_DWORD /d 1 /f
+reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /v {5399E694-6CE5-4D6C-8FCE-1D8870FDCBA0} /t REG_DWORD /d 1 /f
+reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" /v {5399E694-6CE5-4D6C-8FCE-1D8870FDCBA0} /t REG_DWORD /d 1 /f
+reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /v {59031a47-3f72-44a7-89c5-5595fe6b30ee} /t REG_DWORD /d 1 /f
+reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" /v {59031a47-3f72-44a7-89c5-5595fe6b30ee} /t REG_DWORD /d 1 /f
+
+
+:getCurStartType
+@set errmsg=to get current start type
+@set AutoStartDir=C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
+@set AutoStartDirPublic=C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp
+@set regKey=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
+@set regValue=Shell
+@set regData=
+for /f "tokens=2*" %%a in ('reg query "%regKey%" /v "%regValue%" ^| findstr /i "%regValue%"') do (
+    set regData=%%b
+)
+echo [DEBUG] The value of %regValue% is: %regData%
+@if "%regData%" == "" (
+	echo [DEBUG] to get Shell twice
+	for /f "tokens=2*" %%a in ('reg query "\"%regKey%\"" /v "%regValue%" ^| findstr /i "%regValue%"') do (
+		set regData=%%b
+	)
+)
+echo [DEBUG] The value of %regValue% is: %regData%
+@set explorerKey=%regData%
+@if "%explorerKey%" == "" (
+	@echo Get Shell value is Empty
+	@goto EmptyShellVal
+)
+
+@for %%i in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do call set explorerKey=%%explorerKey:%%i=%%i%%
+@echo [DEBUG] explorer key:%explorerKey%
+@if "%explorerKey%" == "explorer.exe" (
+	@Set CurAutoStartType=0	
+) else if "%explorerKey%" == "d:\run\version\vtm.exe" (
+	@rem TODO 要考虑生产上的这些值的具体内容
+	@echo [INFO] 检测到已设置为VTM.exe开机自启动模式
+	@Set CurAutoStartType=2
+	@rem 直接获取到VTM.exe的路径
+	@set RunVersionPath=d:\run\version\
+) else if "%explorerKey%" == "wscript d:\run\version\spexplorerfast.vbs" (
+	@rem TODO 要考虑生产上的这些值的具体内容
+	@echo [INFO] 检测到已设置为VBS脚本开机自启动模式
+	@Set CurAutoStartType=1
+	@rem 直接获取到VTM.exe的路径
+	@set RunVersionPath=d:\run\version\
+)
+
+@if %CurAutoStartType% equ 0 (
+	@if exist "%AutoStartDirPublic%\招商银行可视柜台.lnk" (
+		@Set CurAutoStartType=3
+		@echo [INFO] 检测到设置为开始菜单自启动模式
+	)
+	@rem 最新安装方式,这种情况不用处理
+	@if exist "%AutoStartDir%\%NewAutoStartLnkName%" (
+		@Set CurAutoStartType=4
+		@echo [INFO] 检测到设置为安装脚本设置的开始菜单自启动模式
+	)
+)
+
+@rem d:\vtm\run-4.9.4.0\run\version\vtm.exe
+@rem e:\run\version\vtm.exe
+@rem c:\run\version\vtm.exe
+@rem d:run\version\vtm.exe
+@if %CurAutoStartType% equ 404 (
+	@echo %explorerKey% | findstr "vtm.exe" >nul && (
+		@echo [INFO] 检测到已设置为VTM.exe开机自启动模式
+		@Set CurAutoStartType=2
+	)
+	@echo %explorerKey% | findstr ".vbs" >nul && (
+		@echo %explorerKey% | findstr "wscript" >nul && (
+			@echo [INFO] 检测到已设置为VBS脚本开机自启动模式
+			@Set CurAutoStartType=1
+		)
+	)
+)
+
+:EmptyShellVal
+
+@rem 检测不到的情况下,这里也做下兼容
+@if %CurAutoStartType% equ 404 (
+	@if exist "%AutoStartDirPublic%\招商银行可视柜台.lnk" (
+		@Set CurAutoStartType=3
+		@echo [DEBUG] 检测到设置为开始菜单自启动模式
+	)
+	@rem 最新安装方式,这种情况不用处理
+	@if exist "%AutoStartDir%\%NewAutoStartLnkName%" (
+		@Set CurAutoStartType=4
+		@echo [DEBUG] 检测到设置为安装脚本设置的开始菜单自启动模式
+	)
+)
+
+@if %CurAutoStartType% equ 0 (
+	@echo [DEBUG] 检测到未设置为开机自启动模式
+)
+@echo CurAutoStartType=%CurAutoStartType%
+
+@rem 设置桌面图标
+: setDesktopIcon
+
+@echo result=-1^&msg=set app desktop icon >%resultFile%
+@set errmsg=set app desktop icon
+@if not "%RunVersionPath%" == "" (
+	@if exist "%RunVersionPath%" (
+		if exist "%RunVersionPath%vtm.exe" (
+			@echo version path got previously
+			@goto SkipGetRunVersionPath
+		)
+	)
+)
+@echo [DEBUG] to get version path from syspath
+@set SYSPATH=%Path%
+@set VendorPath=%RVC_VENDOR_HOME%
+@rem 拆分环境变量获取Run/version目录
+@set manuSysPath=%SYSPATH%
+@for %%i in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do call set manuSysPath=%%manuSysPath:%%i=%%i%%
+@echo path=%manuSysPath%
+@rem Mark1
+@set prefixPath=
+@set tofind=run\version
+@set aimStr=version
+@set aimLen=7
+@set foundstr=
+
+:loop
+::从环境变量中得到版本的路径
+@for /f "tokens=1* delims=;" %%a in ("%manuSysPath%") do (
+	@set str=%%a
+	@echo !str! | findstr "%tofind%" >nul && (
+		@set foundstr=!str!
+		@goto foundit
+	)
+	@set manuSysPath=%%b
+)
+if defined manuSysPath goto :loop
+if "%foundstr%" == "" (
+	@set errmsg=cannot fetch Run path from Env::path
+	@set ret=-7
+	@goto UserError
+)
+:foundit
+@rem 从全路径里头获取version结尾
+@echo foundstr=%foundstr%
+@set fulStr=%foundstr%
+
+:next
+if not "%fulStr%" == "" (
+	@set /a num+=1
+	if "!fulStr:~0,%aimLen%!" == "%aimStr%" goto subfoundit
+	@set fulStr=%fulStr:~1%
+	goto next
+)
+@set /a num=0
+
+:subfoundit
+@echo num=%num%
+@set /a realnum=%aimLen%+%num%
+@if %num% neq 0 (
+	@set prefixPath=!foundstr:~0,%realnum%!
+)
+@echo prefixPath=%prefixPath%
+@if "prefixPath" == "" (
+	@set errmsg=cannot get run version path
+	@set ret=-8
+	@goto UserError
+)
+@set RunVersionPath=%prefixPath%
+@echo RunVersionPath=%RunVersionPath%
+:SkipGetRunVersionPath
+@rem 得到vtm.exe全路径
+@set vtmfulPath=%RunVersionPath%vtm.exe
+@echo vtm exe full path is %vtmfulPath%
+@if not exist "%vtmfulPath%" (
+	@echo [ERROR] %vtmfulPath% does not exist
+	@set errmsg=%vtmfulPath% does not exist
+	@set ret=-9
+	@goto UserError
+)
+
+@set desk_path=%USERPROFILE%\Desktop
+@set desk_path_pub=C:\Users\Public\Desktop
+@for %%a in (%desk_path%\*) do echo [DEBUG] desktop file: "%%a"
+@for %%a in (%desk_path_pub%\*) do echo [DEBUG] public desktop file: "%%a"
+@echo to clear desktop file
+@for /d %%a in (%desk_path%\*) do rd /S /Q "%%a"
+@for /d %%a in (%desk_path_pub%\*) do rd /S /Q "%%a"
+@for %%a in (%desk_path%\*) do del "%%a"
+@for %%a in (%desk_path_pub%\*) do del "%%a"
+
+mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b1=a.CreateShortcut(a.SpecialFolders(""Desktop"") & ""\可视柜台.lnk""):b1.TargetPath=""%vtmfulPath%"":b1.WorkingDirectory=""%RunVersionPath%"":b1.Description=""招行可视柜台终端应用"":b1.Save:close")
+@if exist "%desk_path%\可视柜台.lnk" (
+	@echo [DEBUG] deskop icon is exist
+)
+
+@echo [DEBUG] set deskop app icon done
+@set errmsg=set deskop app icon done
+
+@rem 设置自启动
+@if %CurAutoStartType% equ 404 (
+	@echo [WARN] unknown set auto start and skip
+	@set ret=-2
+	@Set errmsg=unknown set auto start and skip
+	@goto UserError
+)
+@if %CurAutoStartType% equ 0 (
+	@echo [WARN] no set auto start and skip
+	@Set errmsg=no set auto start and skip
+	@goto Done
+)
+@if %CurAutoStartType% equ 4 (
+	@echo [WARN] auto start by new install and skip
+	@Set errmsg=auto start by new install and skip
+	@goto Done
+)
+@if %CurAutoStartType% equ 1 (
+	@goto ResetRegeditExplorer
+)
+@if %CurAutoStartType% equ 2 (
+	@goto ResetRegeditExplorer
+)
+
+@if %CurAutoStartType% equ 3 (
+	@if exist "%AutoStartDirPublic%\招商银行可视柜台.lnk" (
+		@del "%AutoStartDirPublic%\招商银行可视柜台.lnk"
+	)
+	@if not exist "%AutoStartDirPublic%\招商银行可视柜台.lnk" (
+		@goto setAutoStartFromStartMenu
+	)
+)
+
+:ResetRegeditExplorer
+@echo [DEBUG] to reset regedit HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
+@set regFile=%TEMP%\rvc_exploreset.reg
+@del %regFile% > nul 2>&1
+@reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "Shell" /t REG_SZ /d "explorer.exe" /f
+@if %errorlevel% neq 0 (
+	echo [WARN] add for Winlogon twice
+	@reg add "\"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\"" /v "Shell" /t REG_SZ /d "explorer.exe" /f
+	@if !errorlevel! neq 0 (
+		@echo [WARN] add for Winlogon third !errorlevel!
+		@echo Windows Registry Editor Version 5.00 > %regFile%
+		@echo. >> %regFile%
+		@echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon] >> %regFile%
+		@echo "Shell"="explorer.exe" >> %regFile%
+		regedit /s %regFile%
+		@del %regFile% > nul 2>&1
+	)
+)
+@set regKey=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
+@set regValue=Shell
+@set regData=
+for /f "tokens=2*" %%a in ('reg query "%regKey%" /v "%regValue%" ^| findstr /i "%regValue%"') do (
+    set regData=%%b
+)
+echo [DEBUG] The value of %regValue% is: %regData%
+@if "%regData%" == "" (
+	echo [DEBUG] to get Shell twice
+	for /f "tokens=2*" %%a in ('reg query "\"%regKey%\"" /v "%regValue%" ^| findstr /i "%regValue%"') do (
+		set regData=%%b
+	)
+)
+echo [DEBUG] The value of %regValue% is: %regData%
+@set explorerKey=%regData%
+@for %%i in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do call set explorerKey=%%explorerKey:%%i=%%i%%
+@echo [DEBUG] explorer key:%explorerKey%
+@if "%explorerKey%" == "explorer.exe" (
+	@echo [DEBUG] reset explorer.exe done
+) else (
+	@echo [WARN] reset explorer.exe failed
+	@set ret=-3
+	@Set errmsg=reset explorer.exe failed
+	@goto UserError
+)
+
+:setAutoStartFromStartMenu
+@echo [DEBUG] to create startup
+mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(a.SpecialFolders(""startup"") & ""\%NewAutoStartLnkName%""):b.TargetPath=""%vtmfulPath%"":b.WorkingDirectory=""%RunVersionPath%"":b.Description=""招行可视柜台终端应用"":b.Save:close")
+@if exist "%AutoStartDir%\%NewAutoStartLnkName%" (
+	@echo [DEBUG] auto startup app icon is exist
+)
+@echo to create startup done
+
+@set errmsg=all process has been executed succ
+
+:Done
+@set ret=0
+@echo all process has been executed done
+@goto End
+
+:Error
+@set ret=-1
+
+:UserError
+@echo [Error] %errmsg%
+
+:End
+@echo result=%ret%^&msg=%errmsg% >%resultFile%
+@echo result=%ret%^&msg=%errmsg%
+@echo %date:~0,4%-%date:~5,2%-%date:~8,2% %time:~0,2%:%time:~3,2%:%time:~6,2%
+@exit 0

BIN
addin/din/win/MetroWatcher64.exe


BIN
addin/packaging/DEBIAN/logo.png


+ 3 - 3
addin/packaging/UOS/install.sh

@@ -27,7 +27,7 @@ echo "[RVCTermianal] === Install Start === "
 installScriptName=installsub.sh
 installScirpts=$MY_PATH/rvc/Resources/${installScriptName}
 if [ ! -f "${installScirpts}" ]; then
-    echo -e "\033[41;37m [ERROR] 安装脚本不存在,请检查当前版本已更新到最新版本,并检查版本的合法性和完整性!! \033[0m"
+    echo -e "\033[41;37m [ERROR] 子安装脚本文件不存在,请检查安装包的合法性和完整性!!! \033[0m"
 	exit 2
 fi
 
@@ -56,7 +56,8 @@ WallpaperPath=${rvc_install_path_rvc_dir}/Resources/WallPaper1920.png
 SyspaperPath=/usr/share/wallpapers/deepin/WallPaper1920.png
 if [ ! -f ${SyspaperPath} ]; then
 	if [ ! -f ${WallpaperPath} ]; then
-		exit 0
+		echo -e "\033[41;37m [ERROR] 壁纸资源文件不存在,设置系统桌面壁纸失败!! \033[0m"
+		exit 1
 	fi
 	SyspaperPath=${WallpaperPath}
 fi
@@ -74,7 +75,6 @@ echo 【6/6】设置系统桌面壁纸OK!
 
 # fetch the version full path at pkg
 version_dir=$(find "${MY_PATH}/Run/version/" -maxdepth 1 -regex ".*[0-9\.]$" -type d)
-echo [DEBUG] version dir: $version_dir
 slen=${#MY_PATH}
 rel_version_dir=${version_dir:$slen+1}
 echo [DEBUG] ${rel_version_dir}

+ 50 - 89
addin/packaging/UOS/installsub.in

@@ -122,12 +122,10 @@ if [ $(id -u) != 0 ]; then
     exit 1
 fi
 
-#生产环境要求先安装浏览器再执行安装
-if [ $installType -eq 1 ]; then
-    if [ "`dpkg -l | grep org.deepin.browser | awk '{print $3}'`" == "" ]; then
-        echo -e "\033[41;37m [ERROR] 未安装指定的浏览器,请至下载站点下载并安装UOS浏览器后再执行此安装脚本! \033[0m"
-        exit 1
-    fi 
+#避免遗漏,要求先安装浏览器再执行安装
+if [ "`dpkg -l | grep org.deepin.browser | awk '{print $3}'`" == "" ]; then
+    echo -e "\033[41;37m [ERROR] 未安装指定的浏览器,请至下载站点下载并安装UOS浏览器后再执行此安装脚本! \033[0m"
+    exit 1
 fi
 
 echo "[INFO] 清理可视柜台相关进程……"
@@ -158,11 +156,6 @@ echo "[INFO] 清理可视柜台相关进程OK!"
 #获取当前登录的用户名称,这里可以考虑用另外一种优化的方法
 
 echo [INFO] 获取当前登录的用户名
-user1=$(ps -o user= -p $$ | awk '{print $1}')
-echo "[DEBUG] user1: $user1"
-user2=$(whoami)
-echo "[DEBUG] user2: $user2"
-
 rvc_user=$USER
 if [ -z "$rvc_user" -o "$rvc_user" = "root" ]; then
 	users=$(cat /etc/passwd | awk -F: '$3>=500' | cut -f 1 -d :)
@@ -200,45 +193,52 @@ elif [ "$rvc_user" = "root" ]; then
     echo -e "\033[41;37m [ERROR] 无法获取当前用户名称(用户名无效),退出程序 \033[0m"
     exit 2
 fi
-
 echo [INFO] 获取当前登录的用户名OK! 用户名:$rvc_user
 
-# 如果版本中有root.ini,移除测试的root.ini文件
-if [ -f "${MY_PATH}/Run/hardwarecfg/root.ini" ]; then
-	sudo rm "${MY_PATH}/Run/hardwarecfg/root.ini"
-fi
-if [ -d "${MY_PATH}/Run/runinfo" ]; then
-	sudo rm -rf "${MY_PATH}/Run/runinfo"
+echo 【0/1】拷贝RVC目录...
+if [ ! -d "${rvc_pkg_rvc}/Resources" ]; then
+    echo -e "\033[41;37m [ERROR] Resources文件夹不存在,请检查安装包的合法性和完整性!!\033[0m"
+	exit 1
 fi
 
-echo 【0/1】拷贝RVC目录...
 if [ ! -d $rvc_install_path_rvc_dir ]; then
     sudo mkdir -p ${rvc_install_path_rvc_dir}
 fi
-if [ ! -d $rvc_install_path_rvc_dir/adData ]; then
-    sudo mkdir -p ${rvc_install_path_rvc_dir}/adData
-fi
 if [ ! -d $rvc_install_path_rvc_dir/Resources ]; then
     sudo mkdir -p ${rvc_install_path_rvc_dir}/Resources
 fi
-sudo cp -rf "${rvc_pkg_rvc}/adData/Audio ${rvc_install_path_rvc_dir}/adData" > /dev/null 2>&1
 sudo cp -rf "${rvc_pkg_rvc}/Resources" ${rvc_install_path_rvc_dir}
 
 echo 【1/1】拷贝RVC目录OK!
 
-echo 【1/2】拷贝终端版本,文件数量较多,部分终端拷贝时间比较长,请稍加等候......
+if [ ! -d "$MY_PATH/Run" ]; then
+    echo -e "\033[41;37m [ERROR] Run版本文件夹不存在,请检查安装包的合法性和完整性!!\033[0m"
+	exit 1
+fi
+if [ ! -d "$MY_PATH/Run/version" ]; then
+    echo -e "\033[41;37m [ERROR] version文件夹不存在,请检查安装包的合法性和完整性!!\033[0m"
+	exit 1
+fi
 if [ ! -d $rvc_install_path_Run_dir ]; then
     sudo mkdir -p ${rvc_install_path_Run_dir}
 fi
-sudo cp -rf "$MY_PATH/Run" ${rvc_install_path_root}
+echo 【1/2】拷贝终端版本,文件数量较多,部分终端拷贝时间比较长,请稍加等候......
+if [ -d "${MY_PATH}/Run/hardwarecfg" ]; then
+	if [ ! -d $rvc_install_path_hardware_dir ]; then
+		sudo mkdir -p ${rvc_install_path_hardware_dir}
+	fi
+	sudo cp -rf "$MY_PATH/Run/hardwarecfg" ${rvc_install_path_Run_dir}
+fi
+if [ ! -d $rvc_install_path_versions_dir ]; then
+    sudo mkdir -p ${rvc_install_path_versions_dir}
+fi
+sudo cp -rf "$MY_PATH/Run/version" ${rvc_install_path_Run_dir}
 echo 【2/2】拷贝终端版本OK!
 
 echo [INFO] 赋予应用相关文件执行权限
-echo [DEBUG] rvc_install_path_rvc_dir=${rvc_install_path_rvc_dir}
-echo [DEBUG] ${rvc_install_path_root}/${rel_version_dir}
 sudo chmod 777 ${rvc_install_path_root}
 sudo chmod a+rw -R ${rvc_install_path_rvc_dir}
-sudo chmod a+rw -R ${rvc_install_path_hardware_dir}
+sudo chmod a+rw -R ${rvc_install_path_hardware_dir} > /dev/null 2>&1
 
 sudo chmod 777 -R ${rvc_install_path_root}/${rel_version_dir}
 sudo chmod 777 ${rvc_install_path_versions_dir}/spexplorer.sh > /dev/null 2>&1
@@ -251,18 +251,22 @@ echo 【2/3】拷贝系统桌面壁纸,用于后续安装
 
 papers_dir=/usr/share/wallpapers/deepin
 papers_bak_dir=/usr/share/wallpapers/deepin_bak
-WallpaperPath=${rvc_pkg_rvc}/Resources/WallPaper1920.png
+WallpaperPath=${rvc_install_path_rvc_dir}/Resources/WallPaper1920.png
 if [ -f "${papers_dir}/WallPaper1920.png" ]; then
 	echo [DEBUG] 指定壁纸已存在系统目录
 	WallpaperPath=${papers_dir}/WallPaper1920.png
 	rm ${papers_dir}/WallPaper1280.png > /dev/null 2>&1
 else
+	if [ ! -f "${rvc_install_path_rvc_dir}/Resources/WallPaper1920.png" ]; then
+		echo -e "\033[41;37m [ERROR] 壁纸资源文件不存在,请检查安装包的合法性和完整性!! \033[0m"
+		exit 1
+	fi
 	if [ ! -d $papers_bak_dir ]; then
 		mkdir -p ${papers_bak_dir}
 		cp $papers_dir/* $papers_bak_dir
 	fi
 	rm -rf $papers_dir/* > /dev/null 2>&1
-	cp "${rvc_pkg_rvc}/Resources/WallPaper1920.png" ${papers_dir}
+	cp "${rvc_install_path_rvc_dir}/Resources/WallPaper1920.png" ${papers_dir}
 	WallpaperPath=${papers_dir}/WallPaper1920.png
 fi
 echo [DEBUG] WallpaperPath=$WallpaperPath
@@ -300,12 +304,20 @@ else
     exit 1
 fi
 echo [INFO] 设置应用自启动和桌面图标
-echo "[INFO] Copy application shortkeys to menu tools..."
-cp "${rvc_pkg_rvc}/Resources/spexplorerauto.desktop" /usr/share/applications
-echo "[INFO] Active application icon autorun after boot..."
-cp "${rvc_pkg_rvc}/Resources/spexplorerauto.desktop" /etc/xdg/autostart/
-echo "[INFO] Copy application icon to desktop..."
-cp "${rvc_pkg_rvc}/Resources/spexplorerauto.desktop" /home/$rvc_user/Desktop
+if [ ! -f "${rvc_install_path_rvc_dir}/Resources/spexplorerauto.desktop" ]; then
+	echo -e "\033[41;37m [ERROR] 自启动快捷键资源文件不存在,请检查安装包的合法性和完整性!! \033[0m"
+	exit 1
+fi
+if [ ! -f "/opt/Run/version/spexplorer.sh" ]; then
+	echo -e "\033[41;37m [ERROR] 应用启动脚本文件不存在,请检查安装包的合法性和完整性!! \033[0m"
+	exit 1
+fi
+echo [DEBUG] Copy application shortkeys to menu tools...
+cp "${rvc_install_path_rvc_dir}/Resources/spexplorerauto.desktop" /usr/share/applications
+echo [DEBUG] Active application icon autorun after boot...
+cp "${rvc_install_path_rvc_dir}/Resources/spexplorerauto.desktop" /etc/xdg/autostart/
+echo [DEBUG] Copy application icon to desktop...
+cp "${rvc_install_path_rvc_dir}/Resources/spexplorerauto.desktop" /home/$rvc_user/Desktop
 
 echo 【4/4】设置可视柜台应用程序开机自启动OK!
 
@@ -322,71 +334,20 @@ launcherURLDEV="http://99.12.23.78/uos/dde-launcher_5.3.0.45_arm64.zip"
 browserDownURL=${browserDownURLDEV}
 #测试环境才生效,生产环境无法确认下载链接地址
 if [ $installType -eq 0 ]; then
-	echo -e "\033[43;37m [WARN] 开发测试环境检测和安装UOS浏览器和输入法补丁 \033[0m"
-	if [ "`dpkg -l | grep org.deepin.browser | awk '{print $3}'`" == "" ]; then
-		echo "[WARN] 未安装最新的UOS浏览器,将自动下载安装UOS浏览器"
-		echo 下载最新的UOS浏览器...
-		rm -rf "${MY_PATH}/Tmp" > /dev/null 2>&1
-		mkdir -p "${MY_PATH}/Tmp" > /dev/null 2>&1
-		mkdir -p "${MY_PATH}/Tmp/Extra" > /dev/null 2>&1
-		wget -nv ${browserDownURL} -O "${MY_PATH}/Tmp/UOSBrowser.zip"
-		if [ $? -ne 0 ]; then
-			echo "[WARN]下载最新的UOS浏览器失败"
-		else
-			echo "[DEBUG] 下载最新的UOS浏览器 完成!"
-			unzip -q "${MY_PATH}/Tmp/UOSBrowser.zip" -d "${MY_PATH}/Tmp/Extra"
-			chmod 777 -R "${MY_PATH}/Tmp/Extra"
-			sudo dpkg -i ./Tmp/Extra/**/*.deb
-		fi
-		rm -rf "${MY_PATH}/Tmp" > /dev/null 2>&1
-	else
-		echo "[INFO] 已安装最新的UOS浏览器"	
-	fi
-	
 	if [ "`dpkg -l | grep libdde-file-manager`" != "" ]; then
 		currentInstallVersion=$(dpkg -l | grep libdde-file-manager | awk '{print $3}')
-		echo "[INFO] Current libdde-file-manager version: $currentInstallVersion"
 		if [ "$currentInstallVersion" = "5.2.11.2-1" ]; then
 			echo "[INFO] 已安装最新输入法补丁"
 		else
-			echo "[WARN] 未安装最新输入法补丁,将自动下载安装"
-			echo "[DEBUG] 下载最新输入法补丁..."
-		rm -rf "${MY_PATH}/Tmp" > /dev/null 2>&1
-		mkdir -p "${MY_PATH}/Tmp" > /dev/null 2>&1
-		mkdir -p "${MY_PATH}/Tmp/Extra" > /dev/null 2>&1
-		wget -nv ${fileManagerURLDEV} -O "${MY_PATH}/Tmp/SogouFileManager.zip"
-		if [ $? -ne 0 ]; then
-			echo "[WARN]下载最新输入法补丁失败"
-		else
-			echo "[DEBUG] 下载最新输入法补丁 完成!"
-			unzip -q "${MY_PATH}/Tmp/SogouFileManager.zip" -d "${MY_PATH}/Tmp/Extra"
-			chmod 777 -R "${MY_PATH}/Tmp/Extra"
-			sudo dpkg -i ./Tmp/Extra/**/*.deb
-		fi
-		rm -rf "${MY_PATH}/Tmp" > /dev/null 2>&1
+			echo -e "\033[43;37m [WARN] 未安装最新输入法补丁,请自行下载安装 \033[0m"
 		fi
 	fi
 	if [ "`dpkg -l | grep dde-launcher`" != "" ]; then
 		currentInstallVersion=$(dpkg -l | grep dde-launcher | awk '{print $3}')
-		echo "[INFO] Current dde-launcher version: $currentInstallVersion"
 		if [ "$currentInstallVersion" = "5.3.0.45+203445.2-1" ]; then
 			echo "[INFO] 已安装最新输入法补丁(文件启动器)"
 		else
-			echo "[WARN] 未安装最新输入法补丁(文件启动器),将自动下载安装"
-			echo "[DEBUG] 下载最新输入法补丁(文件启动器)..."
-		rm -rf "${MY_PATH}/Tmp" > /dev/null 2>&1
-		mkdir -p "${MY_PATH}/Tmp" > /dev/null 2>&1
-		mkdir -p "${MY_PATH}/Tmp/Extra" > /dev/null 2>&1
-		wget -nv ${launcherURLDEV} -O "${MY_PATH}/Tmp/SogouLauncherMng.zip"
-		if [ $? -ne 0 ]; then
-			echo "[WARN]下载最新输入法补丁(文件启动器)失败"
-		else
-			echo "[DEBUG] 下载最新输入法补丁(文件启动器) 完成!"
-			unzip -q "${MY_PATH}/Tmp/SogouLauncherMng.zip" -d "${MY_PATH}/Tmp/Extra"
-			chmod 777 -R "${MY_PATH}/Tmp/Extra"
-			sudo dpkg -i ./Tmp/Extra/**/*.deb
-		fi
-		rm -rf "${MY_PATH}/Tmp" > /dev/null 2>&1
+			echo -e "\033[43;37m [WARN] 未安装最新输入法补丁(文件启动器),请自行下载安装 \033[0m"
 		fi
 	fi
 fi

+ 67 - 89
addin/packaging/UOS/original.sh

@@ -134,15 +134,30 @@ if [ $(id -u) != 0 ]; then
     exit 1
 fi
 
-#生产环境要求先安装浏览器再执行安装
-if [ $installType -eq 1 ]; then
-    if [ "`dpkg -l | grep org.deepin.browser | awk '{print $3}'`" == "" ]; then
-        echo -e "\033[41;37m [ERROR] 未安装指定的浏览器,请至下载站点下载并安装UOS浏览器后再执行此安装脚本! \033[0m"
-        exit 1
-    fi 
+#避免遗漏,要求先安装浏览器再执行安装
+if [ "`dpkg -l | grep org.deepin.browser | awk '{print $3}'`" == "" ]; then
+    echo -e "\033[41;37m [ERROR] 未安装指定的浏览器,请至下载站点下载并安装UOS浏览器后再执行此安装脚本! \033[0m"
+    exit 1
 fi
 
 echo "[INFO] 清理可视柜台相关进程……"
+chromium_pid=$(ps -aux | grep mod_chromium | grep sphost | awk 'NR==1{print $2}')
+echo "[DEBUG] chromium_pid=$chromium_pid"
+timoutsecs4chromium=5
+if [  "${chromium_pid}" != "" ]; then
+	echo "[INFO] has mod_chromium pid to SIGTERM it and wait"
+	sudo kill -s 15 ${chromium_pid}
+	for i in $(seq ${timoutsecs4chromium} -1 1)
+	do
+		echo "[DEBUG] wait chrmoium process exit"
+		sleep 1
+		chromium_pid=$(ps -aux | grep mod_chromium | grep sphost | awk 'NR==1{print $2}')
+		if [  "${chromium_pid}" == "" ]; then
+			echo "[INFO] chrmoium process has been exit"
+			break
+		fi
+	done
+fi
 killall -9 spshell > /dev/null 2>&1
 killall -9 sphost > /dev/null 2>&1
 killall -9 guardian > /dev/null 2>&1
@@ -153,11 +168,6 @@ echo "[INFO] 清理可视柜台相关进程OK!"
 #获取当前登录的用户名称,这里可以考虑用另外一种优化的方法
 
 echo [INFO] 获取当前登录的用户名
-user1=$(ps -o user= -p $$ | awk '{print $1}')
-echo "[DEBUG] user1: $user1"
-user2=$(whoami)
-echo "[DEBUG] user2: $user2"
-
 rvc_user=$USER
 if [ -z "$rvc_user" -o "$rvc_user" = "root" ]; then
 	users=$(cat /etc/passwd | awk -F: '$3>=500' | cut -f 1 -d :)
@@ -195,45 +205,52 @@ elif [ "$rvc_user" = "root" ]; then
     echo -e "\033[41;37m [ERROR] 无法获取当前用户名称(用户名无效),退出程序 \033[0m"
     exit 2
 fi
-
 echo [INFO] 获取当前登录的用户名OK! 用户名:$rvc_user
 
-# 如果版本中有root.ini,移除测试的root.ini文件
-if [ -f "${MY_PATH}/Run/hardwarecfg/root.ini" ]; then
-	sudo rm "${MY_PATH}/Run/hardwarecfg/root.ini"
-fi
-if [ -d "${MY_PATH}/Run/runinfo" ]; then
-	sudo rm -rf "${MY_PATH}/Run/runinfo"
+echo 【0/1】拷贝RVC目录...
+if [ ! -d "${rvc_pkg_rvc}/Resources" ]; then
+    echo -e "\033[41;37m [ERROR] Resources文件夹不存在,请检查安装包的合法性和完整性!!\033[0m"
+	exit 1
 fi
 
-echo 【0/1】拷贝RVC目录...
 if [ ! -d $rvc_install_path_rvc_dir ]; then
     sudo mkdir -p ${rvc_install_path_rvc_dir}
 fi
-if [ ! -d $rvc_install_path_rvc_dir/adData ]; then
-    sudo mkdir -p ${rvc_install_path_rvc_dir}/adData
-fi
 if [ ! -d $rvc_install_path_rvc_dir/Resources ]; then
     sudo mkdir -p ${rvc_install_path_rvc_dir}/Resources
 fi
-sudo cp -rf "${rvc_pkg_rvc}/adData/Audio ${rvc_install_path_rvc_dir}/adData" > /dev/null 2>&1
 sudo cp -rf "${rvc_pkg_rvc}/Resources" ${rvc_install_path_rvc_dir}
 
 echo 【1/1】拷贝RVC目录OK!
 
-echo 【1/2】拷贝终端版本,文件数量较多,部分终端拷贝时间比较长,请稍加等候......
+if [ ! -d "$MY_PATH/Run" ]; then
+    echo -e "\033[41;37m [ERROR] Run版本文件夹不存在,请检查安装包的合法性和完整性!!\033[0m"
+	exit 1
+fi
+if [ ! -d "$MY_PATH/Run/version" ]; then
+    echo -e "\033[41;37m [ERROR] version文件夹不存在,请检查安装包的合法性和完整性!!\033[0m"
+	exit 1
+fi
 if [ ! -d $rvc_install_path_Run_dir ]; then
     sudo mkdir -p ${rvc_install_path_Run_dir}
 fi
-sudo cp -rf "$MY_PATH/Run" ${rvc_install_path_root}
+echo 【1/2】拷贝终端版本,文件数量较多,部分终端拷贝时间比较长,请稍加等候......
+if [ -d "${MY_PATH}/Run/hardwarecfg" ]; then
+	if [ ! -d $rvc_install_path_hardware_dir ]; then
+		sudo mkdir -p ${rvc_install_path_hardware_dir}
+	fi
+	sudo cp -rf "$MY_PATH/Run/hardwarecfg" ${rvc_install_path_Run_dir}
+fi
+if [ ! -d $rvc_install_path_versions_dir ]; then
+    sudo mkdir -p ${rvc_install_path_versions_dir}
+fi
+sudo cp -rf "$MY_PATH/Run/version" ${rvc_install_path_Run_dir}
 echo 【2/2】拷贝终端版本OK!
 
 echo [INFO] 赋予应用相关文件执行权限
-echo [DEBUG] rvc_install_path_rvc_dir=${rvc_install_path_rvc_dir}
-echo [DEBUG] ${rvc_install_path_root}/${rel_version_dir}
 sudo chmod 777 ${rvc_install_path_root}
 sudo chmod a+rw -R ${rvc_install_path_rvc_dir}
-sudo chmod a+rw -R ${rvc_install_path_hardware_dir}
+sudo chmod a+rw -R ${rvc_install_path_hardware_dir} > /dev/null 2>&1
 
 sudo chmod 777 -R ${rvc_install_path_root}/${rel_version_dir}
 sudo chmod 777 ${rvc_install_path_versions_dir}/spexplorer.sh > /dev/null 2>&1
@@ -246,18 +263,22 @@ echo 【2/3】拷贝系统桌面壁纸,用于后续安装
 
 papers_dir=/usr/share/wallpapers/deepin
 papers_bak_dir=/usr/share/wallpapers/deepin_bak
-WallpaperPath=${rvc_pkg_rvc}/Resources/WallPaper1920.png
+WallpaperPath=${rvc_install_path_rvc_dir}/Resources/WallPaper1920.png
 if [ -f "${papers_dir}/WallPaper1920.png" ]; then
 	echo [DEBUG] 指定壁纸已存在系统目录
 	WallpaperPath=${papers_dir}/WallPaper1920.png
 	rm ${papers_dir}/WallPaper1280.png > /dev/null 2>&1
 else
+	if [ ! -f "${rvc_install_path_rvc_dir}/Resources/WallPaper1920.png" ]; then
+		echo -e "\033[41;37m [ERROR] 壁纸资源文件不存在,请检查安装包的合法性和完整性!! \033[0m"
+		exit 1
+	fi
 	if [ ! -d $papers_bak_dir ]; then
 		mkdir -p ${papers_bak_dir}
 		cp $papers_dir/* $papers_bak_dir
 	fi
 	rm -rf $papers_dir/* > /dev/null 2>&1
-	cp "${rvc_pkg_rvc}/Resources/WallPaper1920.png" ${papers_dir}
+	cp "${rvc_install_path_rvc_dir}/Resources/WallPaper1920.png" ${papers_dir}
 	WallpaperPath=${papers_dir}/WallPaper1920.png
 fi
 echo [DEBUG] WallpaperPath=$WallpaperPath
@@ -295,12 +316,20 @@ else
     exit 1
 fi
 echo [INFO] 设置应用自启动和桌面图标
-echo "[INFO] Copy application shortkeys to menu tools..."
-cp "${rvc_pkg_rvc}/Resources/spexplorerauto.desktop" /usr/share/applications
-echo "[INFO] Active application icon autorun after boot..."
-cp "${rvc_pkg_rvc}/Resources/spexplorerauto.desktop" /etc/xdg/autostart/
-echo "[INFO] Copy application icon to desktop..."
-cp "${rvc_pkg_rvc}/Resources/spexplorerauto.desktop" /home/$rvc_user/Desktop
+if [ ! -f "${rvc_install_path_rvc_dir}/Resources/spexplorerauto.desktop" ]; then
+	echo -e "\033[41;37m [ERROR] 自启动快捷键资源文件不存在,请检查安装包的合法性和完整性!! \033[0m"
+	exit 1
+fi
+if [ ! -f "/opt/Run/version/spexplorer.sh" ]; then
+	echo -e "\033[41;37m [ERROR] 应用启动脚本文件不存在,请检查安装包的合法性和完整性!! \033[0m"
+	exit 1
+fi
+echo [DEBUG] Copy application shortkeys to menu tools...
+cp "${rvc_install_path_rvc_dir}/Resources/spexplorerauto.desktop" /usr/share/applications
+echo [DEBUG] Active application icon autorun after boot...
+cp "${rvc_install_path_rvc_dir}/Resources/spexplorerauto.desktop" /etc/xdg/autostart/
+echo [DEBUG] Copy application icon to desktop...
+cp "${rvc_install_path_rvc_dir}/Resources/spexplorerauto.desktop" /home/$rvc_user/Desktop
 
 echo 【4/4】设置可视柜台应用程序开机自启动OK!
 
@@ -317,71 +346,20 @@ launcherURLDEV="http://99.12.23.78/uos/dde-launcher_5.3.0.45_arm64.zip"
 browserDownURL=${browserDownURLDEV}
 #测试环境才生效,生产环境无法确认下载链接地址
 if [ $installType -eq 0 ]; then
-	echo -e "\033[43;37m [WARN] 开发测试环境检测和安装UOS浏览器和输入法补丁 \033[0m"
-	if [ "`dpkg -l | grep org.deepin.browser | awk '{print $3}'`" == "" ]; then
-		echo "[WARN] 未安装最新的UOS浏览器,将自动下载安装UOS浏览器"
-		echo 下载最新的UOS浏览器...
-		rm -rf "${MY_PATH}/Tmp" > /dev/null 2>&1
-		mkdir -p "${MY_PATH}/Tmp" > /dev/null 2>&1
-		mkdir -p "${MY_PATH}/Tmp/Extra" > /dev/null 2>&1
-		wget -nv ${browserDownURL} -O "${MY_PATH}/Tmp/UOSBrowser.zip"
-		if [ $? -ne 0 ]; then
-			echo "[WARN]下载最新的UOS浏览器失败"
-		else
-			echo "[DEBUG] 下载最新的UOS浏览器 完成!"
-			unzip -q "${MY_PATH}/Tmp/UOSBrowser.zip" -d "${MY_PATH}/Tmp/Extra"
-			chmod 777 -R "${MY_PATH}/Tmp/Extra"
-			sudo dpkg -i ./Tmp/Extra/**/*.deb
-		fi
-		rm -rf "${MY_PATH}/Tmp" > /dev/null 2>&1
-	else
-		echo "[INFO] 已安装最新的UOS浏览器"	
-	fi
-	
 	if [ "`dpkg -l | grep libdde-file-manager`" != "" ]; then
 		currentInstallVersion=$(dpkg -l | grep libdde-file-manager | awk '{print $3}')
-		echo "[INFO] Current libdde-file-manager version: $currentInstallVersion"
 		if [ "$currentInstallVersion" = "5.2.11.2-1" ]; then
 			echo "[INFO] 已安装最新输入法补丁"
 		else
-			echo "[WARN] 未安装最新输入法补丁,将自动下载安装"
-			echo "[DEBUG] 下载最新输入法补丁..."
-		rm -rf "${MY_PATH}/Tmp" > /dev/null 2>&1
-		mkdir -p "${MY_PATH}/Tmp" > /dev/null 2>&1
-		mkdir -p "${MY_PATH}/Tmp/Extra" > /dev/null 2>&1
-		wget -nv ${fileManagerURLDEV} -O "${MY_PATH}/Tmp/SogouFileManager.zip"
-		if [ $? -ne 0 ]; then
-			echo "[WARN]下载最新输入法补丁失败"
-		else
-			echo "[DEBUG] 下载最新输入法补丁 完成!"
-			unzip -q "${MY_PATH}/Tmp/SogouFileManager.zip" -d "${MY_PATH}/Tmp/Extra"
-			chmod 777 -R "${MY_PATH}/Tmp/Extra"
-			sudo dpkg -i ./Tmp/Extra/**/*.deb
-		fi
-		rm -rf "${MY_PATH}/Tmp" > /dev/null 2>&1
+			echo -e "\033[43;37m [WARN] 未安装最新输入法补丁,请自行下载安装 \033[0m"
 		fi
 	fi
 	if [ "`dpkg -l | grep dde-launcher`" != "" ]; then
 		currentInstallVersion=$(dpkg -l | grep dde-launcher | awk '{print $3}')
-		echo "[INFO] Current dde-launcher version: $currentInstallVersion"
 		if [ "$currentInstallVersion" = "5.3.0.45+203445.2-1" ]; then
 			echo "[INFO] 已安装最新输入法补丁(文件启动器)"
 		else
-			echo "[WARN] 未安装最新输入法补丁(文件启动器),将自动下载安装"
-			echo "[DEBUG] 下载最新输入法补丁(文件启动器)..."
-		rm -rf "${MY_PATH}/Tmp" > /dev/null 2>&1
-		mkdir -p "${MY_PATH}/Tmp" > /dev/null 2>&1
-		mkdir -p "${MY_PATH}/Tmp/Extra" > /dev/null 2>&1
-		wget -nv ${launcherURLDEV} -O "${MY_PATH}/Tmp/SogouLauncherMng.zip"
-		if [ $? -ne 0 ]; then
-			echo "[WARN]下载最新输入法补丁(文件启动器)失败"
-		else
-			echo "[DEBUG] 下载最新输入法补丁(文件启动器) 完成!"
-			unzip -q "${MY_PATH}/Tmp/SogouLauncherMng.zip" -d "${MY_PATH}/Tmp/Extra"
-			chmod 777 -R "${MY_PATH}/Tmp/Extra"
-			sudo dpkg -i ./Tmp/Extra/**/*.deb
-		fi
-		rm -rf "${MY_PATH}/Tmp" > /dev/null 2>&1
+			echo -e "\033[43;37m [WARN] 未安装最新输入法补丁(文件启动器),请自行下载安装 \033[0m"
 		fi
 	fi
 fi

+ 52 - 60
addin/packaging/WIN/installbat.in

@@ -34,19 +34,6 @@ cd /d "%~dp0"
 @echo [RVCTermianal] ========== Install Start ==========
 @echo 安装脚本模式: %installType%
 
-@set sysProductKey=
-for /f "skip=1 delims==" %%i in ('wmic path softwarelicensingservice get OA3xOriginalProductKey') do (
-    @set sysProductKey=%%i
-	@goto DoneGetProductKey
-)
-:DoneGetProductKey
-@echo sysProductKey=%sysProductKey%
-if "%sysProductKey%" == "" (
-    @echo [DEBUG] 操作系统未激活!
-) else (
-    @echo [DEBUG] 操作系统已激活。
-)
-
 @set ROOT=%cd%
 @set rvc_src_path_rvc_dir=%ROOT%\rvc
 @set rvc_src_path_Run_dir=%ROOT%\Run
@@ -58,6 +45,10 @@ if "%sysProductKey%" == "" (
 @set AutoStartDir2=C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp
 @set VS2019MarkFile=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\devenv.exe
 
+@set RVCTerminalDirName=
+@set RVCTerminalDirFullPath=
+@set RVCCurInstallVersion=
+
 tasklist /nh | find /i "spshell.exe"
 @if errorlevel 1 (
 	@echo [INFO] 可视柜台进程不存在,跳过进程清理
@@ -105,30 +96,33 @@ tasklist /nh | find /i "spshell.exe"
 @echo [DEBUG] rvc_install_path_hardware_dir=%rvc_install_path_hardware_dir%
 @echo [DEBUG] rvc_install_path_versions_dir=%rvc_install_path_versions_dir%
 
-@set RVCTerminalDirName=
-@set RVCTerminalDirFullPath=
-@set RVCCurInstallVersion=
-@for /d %%a in ("%rvc_src_path_Run_dir%\version\*") do (
-	@set RVCTerminalDirFullPath=%%a
-	@set RVCTerminalDirName=%%~nxa
-	@goto GetRVCTerminalDirNameDone
-)
-:GetRVCTerminalDirNameDone
-@set RVCCurInstallVersion=%RVCTerminalDirName%
-@echo [DEBUG] RVCCurInstallVersion=%RVCCurInstallVersion%
 
+@echo 【0/1】拷贝RVC目录...
+
+@if not exist "%rvc_src_path_rvc_res_dir%" (
+	@call :ColorText 4F "[ERROR] Resources文件夹不存在,请检查安装包的合法性和完整性!!"
+	@goto InstallError
+)
 @if not exist "%rvc_install_path_rvc_dir%" md "%rvc_install_path_rvc_dir%"
 @if not exist "%rvc_install_path_rvc_res_dir%" md "%rvc_install_path_rvc_res_dir%"
-@if not exist "%rvc_install_path_Run_dir%" md "%rvc_install_path_Run_dir%"
-@if not exist "%rvc_install_path_hardware_dir%" md "%rvc_install_path_hardware_dir%"
-@if not exist "%rvc_install_path_versions_dir%" md "%rvc_install_path_versions_dir%"
-
-@echo 【0/1】拷贝RVC目录...
-@xcopy "%rvc_src_path_rvc_dir%" %rvc_install_path_rvc_dir%  /E/Y/Q
+@xcopy "%rvc_src_path_rvc_res_dir%" %rvc_install_path_rvc_res_dir%  /E/Y/Q
 @echo 【1/1】拷贝RVC目录OK!
 
+@if not exist "%rvc_src_path_Run_dir%" (
+	@call :ColorText 4F "[ERROR] Run版本文件夹不存在,请检查安装包的合法性和完整性!!"
+	@goto InstallError
+)
+@if not exist "%rvc_src_path_Run_dir%\version" (
+	@call :ColorText 4F "[ERROR] version文件夹不存在,请检查安装包的合法性和完整性!!"
+	@goto InstallError
+)
+@if not exist "%rvc_install_path_Run_dir%" md "%rvc_install_path_Run_dir%"
 @echo 【1/2】拷贝终端版本,文件数量较多,部分终端拷贝时间比较长,请稍加等候......
-@if exist "%rvc_src_path_Run_dir%\hardwarecfg" ( xcopy "%rvc_src_path_Run_dir%\hardwarecfg" "%rvc_install_path_hardware_dir%"  /E/Y/Q )
+@if exist "%rvc_src_path_Run_dir%\hardwarecfg" (
+	@if not exist "%rvc_install_path_hardware_dir%" md "%rvc_install_path_hardware_dir%"
+	@xcopy "%rvc_src_path_Run_dir%\hardwarecfg" "%rvc_install_path_hardware_dir%"  /E/Y/Q 
+)
+@if not exist "%rvc_install_path_versions_dir%" md "%rvc_install_path_versions_dir%"
 @xcopy "%rvc_src_path_Run_dir%\version" "%rvc_install_path_versions_dir%"  /E/Y/Q
 @echo 【2/2】拷贝终端版本OK!
 
@@ -136,7 +130,6 @@ tasklist /nh | find /i "spshell.exe"
 @set FileCount=0
 @set desk_path=%USERPROFILE%\Desktop
 @set desk_path_pub=C:\Users\Public\Desktop
-@echo [DEBUG] desk_path=%desk_path%
 @if %installPure% equ 0 (
 	@call :ColorText E0 "[WARN] 开发设备不清理桌面和设置壁纸,直接跳过"
 	@goto doNotRunUpdatePerEtc
@@ -144,19 +137,19 @@ tasklist /nh | find /i "spshell.exe"
 
 @echo [INFO] 清理桌面文件内容
 @for /d %%a in (%desk_path%\*) do (
-	@echo [DEBUG] %%a
+	@echo [DEBUG] 桌面文件夹:%%a
 	@rd /S /Q "%%a"
 )
 @for %%a in (%desk_path%\*) do (
-	@echo [DEBUG] %%a
+	@echo [DEBUG] 桌面文件:%%a
 	@del "%%a"
 )
 @for /d %%a in (%desk_path_pub%\*) do (
-	@echo [DEBUG] %%a
+	@echo [DEBUG] 公共桌面文件夹:%%a
 	@rd /S /Q "%%a"
 )
 @for %%a in (%desk_path_pub%\*) do (
-	@echo [DEBUG] %%a
+	@echo [DEBUG] 公共桌面文件:%%a
 	@del "%%a"
 )
 
@@ -182,6 +175,10 @@ reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Hi
 @set WallpaperPath=%rvc_install_path_rvc_res_dir%\WallPaper1920.png
 @if not exist C:\Windows\Web\Wallpaper\WallPaper1920.png (
 	@if exist "C:\Windows\Web\Wallpaper" (
+		@if not exist "%WallpaperPath%" (
+			@call :ColorText 4F "[ERROR] 壁纸资源文件不存在,请检查安装包的合法性和完整性!!"
+			@goto InstallError
+		)
 		@copy "%WallpaperPath%" C:\Windows\Web\Wallpaper
 		@set WallpaperPath=C:\Windows\Web\Wallpaper\WallPaper1920.png
 		@set backupWallPaperPath=C:\\Windows\\Web\\Wallpaper\\WallPaper1920.png
@@ -206,7 +203,6 @@ reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v WallpaperStyle /t REG_DWORD
 	regedit /s %regWallpaperFile%
 	@del %regWallpaperFile%
 )
-@call :ColorText E0 "[WARN] 通过注册表设置桌面壁纸OK!(部分机器需要重启后才生效,请注意观察)"
 @echo 【3/3】设置系统桌面壁纸OK!
 
 
@@ -216,7 +212,9 @@ reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v WallpaperStyle /t REG_DWORD
 
 @echo [DEBUG] 读取注册表信息
 @set regFile=%TEMP%\rvc_spshellautostart.reg
-@set regTmpFile=%cd%\rvckey.txt
+@set regTmpFile=%TEMP%\rvckey.txt
+@rem @echo [DEBUG] %regFile%
+@rem @echo [DEBUG] %regTmpFile%
 @set explorerKey=
 @set needSetAutoStartFlag=1
 @set explorerNormal=0
@@ -225,48 +223,33 @@ regedit /e %regFile% "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVe
 @for /f "usebackq delims== tokens=2" %%a in ("%regTmpFile%") do (
 	@set explorerKey=%%~a
 )
-@del %regFile%
+@del "%regFile%"
 @del "%regTmpFile%"
-@echo [DEBUG] original explorer key:%explorerKey%
 @for %%i in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do call set explorerKey=%%explorerKey:%%i=%%i%%
 @echo [DEBUG] explorer key:%explorerKey%
 
 @if "%explorerKey%" == "explorer.exe" (
-	@echo [DEBUG] 检测到未设置为开机自启动模式
+	@echo [INFO] 检测到未设置为开机自启动模式
 	@set explorerNormal=1
 ) else if "%explorerKey%" == "d:\\run\\version\\vtm.exe" (
 	@call :ColorText 2F "检测到已设置为VTM.exe开机自启动模式"
 	@set needSetAutoStartFlag=0
 ) else if "%explorerKey%" == "wscript d:\\run\\version\\spexplorerfast.vbs" (
-	@echo [DEBUG] 检测到已设置为VBS脚本开机自启动模式
+	@echo [INFO] 检测到已设置为VBS脚本开机自启动模式
 )
 
-@if %explorerNormal% neq 1 (
-	@echo [DEBUG] 取消可视柜台应用程序开机自启动(同时恢复桌面)
-	@echo [DEBUG] 临时存储取消开机自启动的注册表脚本
-	@echo Windows Registry Editor Version 5.00 > %regFile%
-	@echo. >> %regFile%
-	@echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon] >> %regFile%
-	@echo "Shell1"="d:\\run\\version\\vtm.exe" >> %regFile%
-	@echo "Shell"="explorer.exe" >> %regFile%
-	@echo [DEBUG] 更新注册表!
-	regedit /s %regFile%
-	@del %regFile%
-)
-@echo [DEBUG] 移除旧有的可视柜台自启动文件
-@echo [DEBUG] AutoStartDir=%AutoStartDir%
-@echo [DEBUG] AutoStartDir2=%AutoStartDir2%
+@echo [DEBUG] 移除旧有的可视柜台自启动文件(如有)
 @if exist "%AutoStartDir%\%lnkPath%" (
-	@echo [DEBUG] 移除自启动文件1
+	@echo [DEBUG] 移除历史自启动文件 %AutoStartDir%\%lnkPath%
 	@del "%AutoStartDir%\%lnkPath%"
 )
 @if exist "%AutoStartDir2%\%lnkPath%" (
-	@echo [DEBUG] 移除自启动文件2
+	@echo [DEBUG] 移除历史自启动文件 %AutoStartDir2%\%lnkPath%
 	@del "%AutoStartDir2%\%lnkPath%"
 )
 @rem 移除旧有的可视柜台自启动快捷键(通过安装程序自动生成的)
 @for %%i in ("%AutoStartDir2%\招商银行可视柜台*.lnk") do (
-	@echo [DEBUG] %%i
+	@echo [DEBUG] 移除历史自启动文件 %%i
 	@del "%%i"
 )
 
@@ -297,6 +280,15 @@ mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShor
 	@goto Done
 )
 
+@for /d %%a in ("%rvc_src_path_Run_dir%\version\*") do (
+	@set RVCTerminalDirFullPath=%%a
+	@set RVCTerminalDirName=%%~nxa
+	@goto GetRVCTerminalDirNameDone
+)
+:GetRVCTerminalDirNameDone
+@set RVCCurInstallVersion=%RVCTerminalDirName%
+@echo [DEBUG] RVCCurInstallVersion=%RVCCurInstallVersion%
+
 @call :ColorText 2F "[INFO] ===所有安装步骤执行成功,正常退出,请双击桌面图标启动可视柜台应用进入安装配置,可视柜台应用版本号:%RVCCurInstallVersion%==="
 @set /a timoutsecs=5
 @echo [INFO] %timoutsecs%s 后自动退出该执行脚本并最小化到桌面

+ 52 - 60
addin/packaging/WIN/original.bat

@@ -41,19 +41,6 @@ cd /d "%~dp0"
 @echo [RVCTermianal] ========== Install Start ==========
 @echo 安装脚本模式: %installType%
 
-@set sysProductKey=
-for /f "skip=1 delims==" %%i in ('wmic path softwarelicensingservice get OA3xOriginalProductKey') do (
-    @set sysProductKey=%%i
-	@goto DoneGetProductKey
-)
-:DoneGetProductKey
-@echo sysProductKey=%sysProductKey%
-if "%sysProductKey%" == "" (
-    @echo [DEBUG] 操作系统未激活!
-) else (
-    @echo [DEBUG] 操作系统已激活。
-)
-
 @set ROOT=%cd%
 @set rvc_src_path_rvc_dir=%ROOT%\rvc
 @set rvc_src_path_Run_dir=%ROOT%\Run
@@ -65,6 +52,10 @@ if "%sysProductKey%" == "" (
 @set AutoStartDir2=C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp
 @set VS2019MarkFile=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\devenv.exe
 
+@set RVCTerminalDirName=
+@set RVCTerminalDirFullPath=
+@set RVCCurInstallVersion=
+
 tasklist /nh | find /i "spshell.exe"
 @if errorlevel 1 (
 	@echo [INFO] 可视柜台进程不存在,跳过进程清理
@@ -112,30 +103,33 @@ tasklist /nh | find /i "spshell.exe"
 @echo [DEBUG] rvc_install_path_hardware_dir=%rvc_install_path_hardware_dir%
 @echo [DEBUG] rvc_install_path_versions_dir=%rvc_install_path_versions_dir%
 
-@set RVCTerminalDirName=
-@set RVCTerminalDirFullPath=
-@set RVCCurInstallVersion=
-@for /d %%a in ("%rvc_src_path_Run_dir%\version\*") do (
-	@set RVCTerminalDirFullPath=%%a
-	@set RVCTerminalDirName=%%~nxa
-	@goto GetRVCTerminalDirNameDone
-)
-:GetRVCTerminalDirNameDone
-@set RVCCurInstallVersion=%RVCTerminalDirName%
-@echo [DEBUG] RVCCurInstallVersion=%RVCCurInstallVersion%
 
+@echo 【0/1】拷贝RVC目录...
+
+@if not exist "%rvc_src_path_rvc_res_dir%" (
+	@call :ColorText 4F "[ERROR] Resources文件夹不存在,请检查安装包的合法性和完整性!!"
+	@goto InstallError
+)
 @if not exist "%rvc_install_path_rvc_dir%" md "%rvc_install_path_rvc_dir%"
 @if not exist "%rvc_install_path_rvc_res_dir%" md "%rvc_install_path_rvc_res_dir%"
-@if not exist "%rvc_install_path_Run_dir%" md "%rvc_install_path_Run_dir%"
-@if not exist "%rvc_install_path_hardware_dir%" md "%rvc_install_path_hardware_dir%"
-@if not exist "%rvc_install_path_versions_dir%" md "%rvc_install_path_versions_dir%"
-
-@echo 【0/1】拷贝RVC目录...
-@xcopy "%rvc_src_path_rvc_dir%" %rvc_install_path_rvc_dir%  /E/Y/Q
+@xcopy "%rvc_src_path_rvc_res_dir%" %rvc_install_path_rvc_res_dir%  /E/Y/Q
 @echo 【1/1】拷贝RVC目录OK!
 
+@if not exist "%rvc_src_path_Run_dir%" (
+	@call :ColorText 4F "[ERROR] Run版本文件夹不存在,请检查安装包的合法性和完整性!!"
+	@goto InstallError
+)
+@if not exist "%rvc_src_path_Run_dir%\version" (
+	@call :ColorText 4F "[ERROR] version文件夹不存在,请检查安装包的合法性和完整性!!"
+	@goto InstallError
+)
+@if not exist "%rvc_install_path_Run_dir%" md "%rvc_install_path_Run_dir%"
 @echo 【1/2】拷贝终端版本,文件数量较多,部分终端拷贝时间比较长,请稍加等候......
-@if exist "%rvc_src_path_Run_dir%\hardwarecfg" ( xcopy "%rvc_src_path_Run_dir%\hardwarecfg" "%rvc_install_path_hardware_dir%"  /E/Y/Q )
+@if exist "%rvc_src_path_Run_dir%\hardwarecfg" (
+	@if not exist "%rvc_install_path_hardware_dir%" md "%rvc_install_path_hardware_dir%"
+	@xcopy "%rvc_src_path_Run_dir%\hardwarecfg" "%rvc_install_path_hardware_dir%"  /E/Y/Q 
+)
+@if not exist "%rvc_install_path_versions_dir%" md "%rvc_install_path_versions_dir%"
 @xcopy "%rvc_src_path_Run_dir%\version" "%rvc_install_path_versions_dir%"  /E/Y/Q
 @echo 【2/2】拷贝终端版本OK!
 
@@ -143,7 +137,6 @@ tasklist /nh | find /i "spshell.exe"
 @set FileCount=0
 @set desk_path=%USERPROFILE%\Desktop
 @set desk_path_pub=C:\Users\Public\Desktop
-@echo [DEBUG] desk_path=%desk_path%
 @if %installPure% equ 0 (
 	@call :ColorText E0 "[WARN] 开发设备不清理桌面和设置壁纸,直接跳过"
 	@goto doNotRunUpdatePerEtc
@@ -151,19 +144,19 @@ tasklist /nh | find /i "spshell.exe"
 
 @echo [INFO] 清理桌面文件内容
 @for /d %%a in (%desk_path%\*) do (
-	@echo [DEBUG] %%a
+	@echo [DEBUG] 桌面文件夹:%%a
 	@rd /S /Q "%%a"
 )
 @for %%a in (%desk_path%\*) do (
-	@echo [DEBUG] %%a
+	@echo [DEBUG] 桌面文件:%%a
 	@del "%%a"
 )
 @for /d %%a in (%desk_path_pub%\*) do (
-	@echo [DEBUG] %%a
+	@echo [DEBUG] 公共桌面文件夹:%%a
 	@rd /S /Q "%%a"
 )
 @for %%a in (%desk_path_pub%\*) do (
-	@echo [DEBUG] %%a
+	@echo [DEBUG] 公共桌面文件:%%a
 	@del "%%a"
 )
 
@@ -189,6 +182,10 @@ reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Hi
 @set WallpaperPath=%rvc_install_path_rvc_res_dir%\WallPaper1920.png
 @if not exist C:\Windows\Web\Wallpaper\WallPaper1920.png (
 	@if exist "C:\Windows\Web\Wallpaper" (
+		@if not exist "%WallpaperPath%" (
+			@call :ColorText 4F "[ERROR] 壁纸资源文件不存在,请检查安装包的合法性和完整性!!"
+			@goto InstallError
+		)
 		@copy "%WallpaperPath%" C:\Windows\Web\Wallpaper
 		@set WallpaperPath=C:\Windows\Web\Wallpaper\WallPaper1920.png
 		@set backupWallPaperPath=C:\\Windows\\Web\\Wallpaper\\WallPaper1920.png
@@ -213,7 +210,6 @@ reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v WallpaperStyle /t REG_DWORD
 	regedit /s %regWallpaperFile%
 	@del %regWallpaperFile%
 )
-@call :ColorText E0 "[WARN] 通过注册表设置桌面壁纸OK!(部分机器需要重启后才生效,请注意观察)"
 @echo 【3/3】设置系统桌面壁纸OK!
 
 
@@ -223,7 +219,9 @@ reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v WallpaperStyle /t REG_DWORD
 
 @echo [DEBUG] 读取注册表信息
 @set regFile=%TEMP%\rvc_spshellautostart.reg
-@set regTmpFile=%cd%\rvckey.txt
+@set regTmpFile=%TEMP%\rvckey.txt
+@rem @echo [DEBUG] %regFile%
+@rem @echo [DEBUG] %regTmpFile%
 @set explorerKey=
 @set needSetAutoStartFlag=1
 @set explorerNormal=0
@@ -232,48 +230,33 @@ regedit /e %regFile% "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVe
 @for /f "usebackq delims== tokens=2" %%a in ("%regTmpFile%") do (
 	@set explorerKey=%%~a
 )
-@del %regFile%
+@del "%regFile%"
 @del "%regTmpFile%"
-@echo [DEBUG] original explorer key:%explorerKey%
 @for %%i in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do call set explorerKey=%%explorerKey:%%i=%%i%%
 @echo [DEBUG] explorer key:%explorerKey%
 
 @if "%explorerKey%" == "explorer.exe" (
-	@echo [DEBUG] 检测到未设置为开机自启动模式
+	@echo [INFO] 检测到未设置为开机自启动模式
 	@set explorerNormal=1
 ) else if "%explorerKey%" == "d:\\run\\version\\vtm.exe" (
 	@call :ColorText 2F "检测到已设置为VTM.exe开机自启动模式"
 	@set needSetAutoStartFlag=0
 ) else if "%explorerKey%" == "wscript d:\\run\\version\\spexplorerfast.vbs" (
-	@echo [DEBUG] 检测到已设置为VBS脚本开机自启动模式
+	@echo [INFO] 检测到已设置为VBS脚本开机自启动模式
 )
 
-@if %explorerNormal% neq 1 (
-	@echo [DEBUG] 取消可视柜台应用程序开机自启动(同时恢复桌面)
-	@echo [DEBUG] 临时存储取消开机自启动的注册表脚本
-	@echo Windows Registry Editor Version 5.00 > %regFile%
-	@echo. >> %regFile%
-	@echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon] >> %regFile%
-	@echo "Shell1"="d:\\run\\version\\vtm.exe" >> %regFile%
-	@echo "Shell"="explorer.exe" >> %regFile%
-	@echo [DEBUG] 更新注册表!
-	regedit /s %regFile%
-	@del %regFile%
-)
-@echo [DEBUG] 移除旧有的可视柜台自启动文件
-@echo [DEBUG] AutoStartDir=%AutoStartDir%
-@echo [DEBUG] AutoStartDir2=%AutoStartDir2%
+@echo [DEBUG] 移除旧有的可视柜台自启动文件(如有)
 @if exist "%AutoStartDir%\%lnkPath%" (
-	@echo [DEBUG] 移除自启动文件1
+	@echo [DEBUG] 移除历史自启动文件 %AutoStartDir%\%lnkPath%
 	@del "%AutoStartDir%\%lnkPath%"
 )
 @if exist "%AutoStartDir2%\%lnkPath%" (
-	@echo [DEBUG] 移除自启动文件2
+	@echo [DEBUG] 移除历史自启动文件 %AutoStartDir2%\%lnkPath%
 	@del "%AutoStartDir2%\%lnkPath%"
 )
 @rem 移除旧有的可视柜台自启动快捷键(通过安装程序自动生成的)
 @for %%i in ("%AutoStartDir2%\招商银行可视柜台*.lnk") do (
-	@echo [DEBUG] %%i
+	@echo [DEBUG] 移除历史自启动文件 %%i
 	@del "%%i"
 )
 
@@ -304,6 +287,15 @@ mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShor
 	@goto Done
 )
 
+@for /d %%a in ("%rvc_src_path_Run_dir%\version\*") do (
+	@set RVCTerminalDirFullPath=%%a
+	@set RVCTerminalDirName=%%~nxa
+	@goto GetRVCTerminalDirNameDone
+)
+:GetRVCTerminalDirNameDone
+@set RVCCurInstallVersion=%RVCTerminalDirName%
+@echo [DEBUG] RVCCurInstallVersion=%RVCCurInstallVersion%
+
 @call :ColorText 2F "[INFO] ===所有安装步骤执行成功,正常退出,请双击桌面图标启动可视柜台应用进入安装配置,可视柜台应用版本号:%RVCCurInstallVersion%==="
 @set /a timoutsecs=5
 @echo [INFO] %timoutsecs%s 后自动退出该执行脚本并最小化到桌面

+ 0 - 37
addin/packaging/apt_get_offline.sh

@@ -1,37 +0,0 @@
-#! /bin/bash
-basepath=$(cd `dirname $0`; pwd)
-pkg="$*"
-#rm -rf /var/cache/apt/archives/*
-function getDepends()
-{
-  ret=`sudo apt-cache depends $1 |grep -i 依赖 |cut -d: -f2 |tr -d "<>"`
-  if [[ -z $ret ]]; then
-#    echo '$1 No depends'
-    echo -n
-  else
-    for i in $ret
-    do
-       if [[ `echo $pkg |grep -e "$i "` ]]; then
-         echo "$i already in set"
-         echo -n
-       #dpkg-query --list | grep  libgtkglext1
-       #elif [ "`sudo apt-cache search $i | grep $i`" != "" ]; then
-       elif [ "`dpkg -l | grep $i`" != "" ]; then
-         echo "$i already installed"
-       else
-         pkg="$pkg $i"
-         echo "Download $i ing"
-         getDepends $i
-       fi
-    done
-  fi
-}
-
-for j in $@
-do
-  getDepends $j
-done
-
-echo $pkg
-#apt install $pkg --reinstall -d -y
-sudo apt-get download $pkg -d -y

+ 0 - 34
addin/packaging/debs_offline_install.sh

@@ -1,34 +0,0 @@
-#!/bin/bash
-MY_PATH="`dirname \"$0\"`"              # relative
-# echo "1"$MY_PATH
-MY_PATH="`( cd \"$MY_PATH\" && pwd )`"  # absolutized and normalized
-
-function installdeb()
-{
-    if [ "`dpkg -l | grep $1`" != "" ]; then
-        echo "$1 is already installed"
-    else
-        file="/var/cache/apt/archives/$2"
-        if [ ! -f "$file" ]; then
-            if [-f "${MY_PATH}/$2" ]; then 
-                cp ${MY_PATH}/$2 /var/cache/apt/archives
-            else
-                echo "${MY_PATH}/$2 not exists!"
-            fi
-        fi
-        echo "to install $1...."
-        apt-get install $2
-        echo "install $1 done!"
-    fi
-}
-
-installdeb "libxv1" "libxv1_2%3a1.0.11-1_arm64.deb";
-installdeb "libpangox" "libpangox-1.0-0_0.0.2-5+b2_arm64.deb";
-installdeb "libgtkglext1" "libgtkglext1_1.2.0-9_arm64.deb";
-
-#cp ${MY_PATH}/*.deb /var/cache/apt/archives
-#apt-get install libxv1_2%3a1.0.11-1_arm64.deb
-#apt-get install libpangox-1.0-0_0.0.2-5+b2_arm64.deb
-#apt-get install libgtkglext1_1.2.0-9_arm64.deb
-
-exit 0