其实封装是简单的事情,问题出现在封装的系统小问题很多.
到时想起来再慢慢发布.
1.封装好的系统无桌面壁纸(黑色)
问题:default默认没有HKEY_CURRENT_USER\Control Panel\Desktop下的Wallpaper.但是封装时却有了(指向封装系统的当前用户).造成封装后的系统壁纸指向错误(+权限错误).
解决:封装前删除HKEY_CURRENT_USER\Control Panel\Desktop下的Wallpaper
2.IE8首次运行会出现向导,即时封装前已经关闭向导.
解决:封装好的系统在第一次进入桌面时运行.Func _IE8NoFirst()
RegWrite('HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main','IE8RunOnceLastShown_TIMESTAMP',"REG_BINARY",0x0)
RegWrite('HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main','IE8RunOnceCompletionTime',"REG_BINARY",0x0)
RegWrite('HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main','IE8RunOnceLastShown',"REG_DWORD",0x1)
RegWrite('HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main','IE8RunOncePerInstallCompleted',"REG_DWORD",0x0)
RegWrite('HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main','IE8TourShown',"REG_DWORD",0x1)
RegWrite('HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main','IE8TourShownTime',"REG_BINARY",0x0)
EndFunc
3.输入法信息丢失问题.
解决:
封装时:Func _BackupInputMethod()
RunWait('reg.exe export "HKLM\SYSTEM\CurrentControlSet\Control\Keyboard Layouts" HKLMKBD.KEY /Y',@SystemDir,@SW_HIDE)
RunWait('reg.exe export "HKCU\Keyboard Layout" HKCUKBDLAY.KEY /Y',@SystemDir,@SW_HIDE)
RunWait('reg.exe export "HKCU\Software\Microsoft\CTF" HKCUKBDCTF.KEY /Y',@SystemDir,@SW_HIDE)
EndFunc
进入系统时: If FileExists(@SystemDir & '\HKLMKBD.KEY') Then
RunWait('reg.exe import HKLMKBD.KEY',@SystemDir,@SW_HIDE)
RunWait('reg.exe import HKCUKBDLAY.KEY',@SystemDir,@SW_HIDE)
RunWait('reg.exe import HKCUKBDCTF.KEY',@SystemDir,@SW_HIDE)
EndIf
4.添加项目到任务栏和开始菜单锁定项目的问题.
解决:
目前网上没有好的解决方案...
我目前使用的:Func _FileVerb($sz_Dir,$sz_File,$Verb)
Local $objShell = ObjCreate("Shell.Application")
Local $objFolder = $objShell.NameSpace($sz_Dir & "")
If Not IsObj($objFolder) Then Return -1
Local $objFolderItem = $objFolder.ParseName($sz_File)
If Not IsObj($objFolderItem) Then Return -2
Local $colVerbs = $objFolderItem.Verbs
If Not IsObj($colVerbs) Then Return -3
For $objVerb in $colVerbs
;If StringReplace($objVerb.name, "&", "") = "锁定到任务栏(K)" Then
;If StringReplace($objVerb.name, "&", "") = "附到「开始」菜单(U)" Then
;'从任务栏脱离(&K)'
If StringInStr($objVerb.name,$Verb) Then
$objVerb.DoIt
EndIf
Next
Return 1
EndFunc
5.封装前简单的垃圾清理
解决:Func _CleanJunk()
RunWait('cmd.exe /c del /f /a /s /q "'& @UserProfileDir & '\AppData\Local\Microsoft\Windows\History\*.*"',@UserProfileDir,@SW_HIDE)
RunWait('cmd.exe /c del /f /a /s /q "'& @UserProfileDir & '\AppData\Local\Microsoft\Windows\Temporary Internet Files\*.*"',@UserProfileDir,@SW_HIDE)
RunWait('cmd.exe /c del /f /a /s /q "'& @UserProfileDir & '\AppData\Local\Temp\*.*"',@UserProfileDir,@SW_HIDE)
; RunWait('cmd.exe /c del /f /a /s /q "'& @UserProfileDir & '\AppData\LocalLow\Microsoft\CryptnetUrlCache\*.*"',@UserProfileDir,@SW_HIDE)
RunWait('cmd.exe /c del /f /a /s /q "'& @UserProfileDir & '\AppData\Roaming\Microsoft\Windows\Cookies\*.*"',@UserProfileDir,@SW_HIDE)
RunWait('cmd.exe /c del /f /a /s /q "'& @UserProfileDir & '\AppData\Roaming\Microsoft\Windows\Recent\*.*"',@UserProfileDir,@SW_HIDE)
; RunWait('cmd.exe /c del /f /a /s /q "'& @WindowsDir & '\*.log"',@WindowsDir,@SW_HIDE)
RegDelete("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit")
RegDelete("HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client")
RegDelete("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32")
RegDelete("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs")
RegDelete("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU")
;FTP账号密码...
RegDelete("HKEY_CURRENT_USER\Software\Microsoft\FTP")
;输入的路径与URL
RegDelete("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\TypedPaths")
;兼容设置
RegDelete("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Compatibility Assistant\Persisted")
; RegDelete("HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell")
EndFunc
6.免疫MRT(KB890830)问题
解决:Func _FakeMRT()
;免疫MRT补丁KB890830
FileCopy(@SystemDir & "\notepad.exe",@SystemDir & "\mrt.exe",1)
EndFunc
|