⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 setup_cd.au3

📁 制作winpe的自启动的源码。公开代码
💻 AU3
字号:
;首先判断卡巴是不是已经安装在系统
If RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run","avp") <> "" Then
	MsgBox(64,"Note","系统已经安装卡巴,无须再安装!")
	Exit
EndIf

If FileExists(@systemdir & "\pecmd.exe") Then
	MsgBox(64,"hint","不要在PE下进行安装!")
	Exit
EndIf

If DriveGetType(StringLeft(@ScriptDir,2)) = "CDROM" Then
	If FileExists(@ProgramFilesDir & "\avp") then
		DirRemove(@ProgramFilesDir & "\avp", 1)
	EndIf
	DirCreate(@ProgramFilesDir & "\avp")
	MsgBox(64,"hint","本程序将向系统程序文件夹拷贝卡巴病毒库,请耐心等待!")
	_filecopy (@ScriptDir & "\bases", @ProgramFilesDir  & "\avp")
	WinWaitClose("正在复制...")
EndIf

Run("regedit /s set.reg")
Run("regedit /s 主动防御.reg")
Run("regsvr32 /s shellex.dll")

$AVP7="HKLM\SOFTWARE\KasperskyLab\protected\AVP7"

RegWrite($AVP7 & "\environment", "DataRoot", "REG_SZ", @ProgramFilesDir  & "\avp")
RegWrite($AVP7 & "\environment", "ProductRoot", "REG_SZ", @ScriptDir)
RegWrite($AVP7 & "\settings", "LoginImage", "REG_SZ", @ScriptDir & "\Skin\images\lgnkav.png")
RegWrite($AVP7 & "\settings", "Ins_ProductPath", "REG_SZ", @ScriptDir & "\")
RegWrite("HKLM\SOFTWARE\KasperskyLab\SetupFolders", "KAV7", "REG_SZ", @ScriptDir)
RegWrite("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run","avp", "REG_SZ", @ScriptDir & "\avp.exe")
RegWrite("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Notify\klogon", "DllName", "REG_SZ", "klogon.dll") 

FileCreateShortcut(@ScriptDir & "\avp.exe", @DesktopCommonDir & "\卡巴斯基.lnk")
If Not FileExists(@ProgramsCommonDir & "\卡巴斯基") Then DirCreate(@ProgramsCommonDir & "\卡巴斯基")
FileCreateShortcut(@ScriptDir & "\avp.exe", @ProgramsCommonDir  & "\卡巴斯基\卡巴斯基.lnk")
FileCreateShortcut(@ScriptDir & "\uninstall_cd.exe", @ProgramsCommonDir  & "\卡巴斯基\卸载.lnk")

MsgBox(64,"Done","安装成功!")

Func _FileCopy($fromFile,$tofile) 
    Local $FOF_RESPOND_YES = 16
    Local $FOF_SIMPLEPROGRESS = 256
    $winShell = ObjCreate("shell.application")
    $winShell.namespace($tofile).CopyHere($fromFile,$FOF_RESPOND_YES)
EndFunc

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -