|
在这里,感谢garuda,虽然简单的一个动作,对于新手也是一种鼓励,不是说,我不自力更生.当然要自己学习实践了.
错误如下图。高手帮忙一下,先谢谢了啊(我装的是最新版的au3 V3.3的)
源码如下:(注,还有一个配置文件在压缩包config.rar内)
#cs ----------------------------------------------------------------------------
AutoIt 版本: 3.2.5.5(第一版)
脚本作者: lzcmaro
Email: lzcmaro@163.com
QQ/TM: 84255550
脚本版本: 3.2
脚本功能: 驱动程序选择工具(增强型)
#ce ----------------------------------------------------------------------------
#AutoIt3Wrapper_icon=Nordagan.ico
#AutoIt3Wrapper_Res_Comment=lzcmaro原创作品
#AutoIt3Wrapper_Res_Description=驱动选择工具MSCD专用版v3.2
#AutoIt3Wrapper_Res_Fileversion=3.2.0.0
#AutoIt3Wrapper_Res_LegalCopyright=版权所有 (C) 2008 - lzcmaro
#AutoIt3Wrapper_Res_Field=QQ/TM|84255550
#AutoIt3Wrapper_Compression=4
#NoTrayIcon
#include <GUIConstants.au3>
Opt("MustDeclareVars",1)
;---------------------------------定义一些常量及变量-------------------------------
Global Const $TITLE = "驱动选择工具MSCD专用版v3.2"
Global Const $CLUEMSG = "可以使用Tab+空格或数字1~9选择,0为全选或全不选,N/Esc为退出,Y为安装。"
Global Const $AUTHORMSG = "-MSCD龙帝国技术社区-"
Global Const $WELCOMEMSG = "欢迎使用驱动选择工具MSCD专用版v3.2"
Global Const $LINKADDRESS = "http://bbs.mscode.cc"
Global Const $HKEY_CURRENTVERSION = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion"
Global Const $HKEY_RUNONCE = $HKEY_CURRENTVERSION & "\RunOnce"
Global Const $XP_DEFAULT_DEVICEPATH = "%SystemRoot%\inf"
Global Const $XP_MINISETUP_COMM = @SystemDir & "\setup.exe -newsetup -mini"
Global Const $DEFAULT_RELEASEPATH = @HomeDrive & "\driver"
Global Const $FILE_LOGOPATH = @SystemDir & "\logo.jpg"
Global Const $FILE_7ZAPATH = @SystemDir & "\7za.exe"
Global Const $FILE_UNRARPATH = @SystemDir & "\unrar.exe"
Global Const $FILE_DELETEPATH = @SystemDir & "\delete.exe"
Global Const $FILE_DELETECONFIGPATH = @SystemDir & "\delete.ini"
Global Const $FILE_DELETESHORTCUTPATH = @ProgramsCommonDir & "\启动\delete.lnk"
;~ Global Const $FILE_SKINPATH = @SystemDir & "\vista_style.skf"
;~ Global Const $FILE_SKINDLLPATH = @SystemDir & "\SkinCrafterDll.dll"
Global Const $CONFIG_PATH = @ScriptDir & "\config.ini"
Global Const $EVEREST_PATH = @ProgramFilesDir & "\everest"
Global Const $EVEREST_CONFIG_PATH = $EVEREST_PATH & "\Reports\report.ini"
Global Const $ISDOS = ProcessExists("Explorer.exe")
Local $CpuType ,$Chipset_NorthBridge,$VideoType,$AudioType,$LanType
Local $proPercent = 0,$mainForm,$parentForm
Local $backpicPath,$backpicWidth,$backpicHeigh
Local $waitTime,$checkedNumber
Local $fileType,$releasePath,$regPath
Local $isOpenExtend,$extend[4]
Local $isOpenMiniSetup,$miniSetupExtend_register,$miniSetupExtend_deploy
Local $isOpenDelDrv,$drvPath,$delDrvExtend[4]
Local $isKillMe
Local $arrTxt[10]
Local $arrRun[10]
Local $arrDir[10]
Local $isChecked = $GUI_UNCHECKED,$onCheckedTips
Local $isOpenPrepare,$arrVideo,$arrAudio,$arrLan,$videoKey=0,$audioKey=0,$lanKey=0
Local $devicePath
Local $listViewHeigh = 90,$groupHeigh1 = 0,$groupHeigh2 = 0,$groupHeigh3 = 0
Local $isRuning = 0
If Not FileExists($CONFIG_PATH) Then
MsgBox(16, "出错", " 没有找到配置文件config.ini ")
Exit
EndIf
;-------------------------------------加载相关文件---------------------------------
FileInstall("logo.jpg", @SystemDir & "\",1)
FileInstall('delete.exe',@SystemDir & '\',1)
FileInstall("7za.exe", @SystemDir & "\",1)
FileInstall("unrar.exe",@SystemDir & "\",1)
DirCreate($EVEREST_PATH)
FileInstall("everest\everest.dat",$EVEREST_PATH & "\",1)
FileInstall("everest\everest.exe",$EVEREST_PATH & "\",1)
FileInstall("everest\everest.exe.manifest",$EVEREST_PATH & "\",1)
FileInstall("everest\everest.fav",$EVEREST_PATH & "\",1)
FileInstall("everest\everest.mem",$EVEREST_PATH & "\",1)
FileInstall("everest\kerneld.amd64",$EVEREST_PATH & "\",1)
FileInstall("everest\kerneld.ia64",$EVEREST_PATH & "\",1)
FileInstall("everest\kerneld.w9x",$EVEREST_PATH & "\",1)
FileInstall("everest\kerneld.wnt",$EVEREST_PATH & "\",1)
FileInstall("everest\User.rpf",$EVEREST_PATH & "\",1)
;~ FileInstall("SkinCrafterDll.dll", @SystemDir & "\",1)
;~ FileInstall("vista_style.skf", @SystemDir & "\",1)
;---------------初始化一些必要的数据--------------------
init()
;---------------执行扩展功能(外部接口)------------------
runExtend()
;------------------------------------创建自定义背景窗口(没有边框,且为父级窗口)-------------------------
$parentForm = GUICreate("", $backpicWidth, $backpicHeigh,-1,-1,BitOR($WS_POPUP,$WS_CLIPSIBLINGS))
GUICtrlCreatePic($backpicPath, 0, 0, $backpicWidth, $backpicHeigh)
GUISetState(@SW_SHOW , $parentForm)
;----------------启动Everest扫描硬件--------------------
If $isOpenPrepare == "1" Then runEverest()
;----------------------创建主窗体界面(子窗体)---------------------
If $ISDOS == 0 Then
$mainForm = GUICreate($TITLE, 470, 294+$listViewHeigh+$groupHeigh3,-1,-1,BitOR($WS_POPUP,$WS_CLIPSIBLINGS),-1,$parentForm)
Else
$mainForm = GUICreate($TITLE, 470, 294+$listViewHeigh+$groupHeigh3,-1,-1,-1,-1,$parentForm)
EndIf
;~ $skinDll = DllOpen($FILE_SKINDLLPATH)
;~ DllCall($skinDll, "int:cdecl", "InitLicenKeys", "wstr", "1", "wstr", "", "wstr", "1@1.com", "wstr", "1")
;~ DllCall($skinDll, "int:cdecl", "InitDecoration", "int", 1)
;~ DllCall($skinDll, "int:cdecl", "LoadSkinFromFile", "wstr", $FILE_SKINPATH)
;~ DllCall($skinDll, "int:cdecl", "DecorateAs", "int", $mainForm, "int", 25)
;~ DllCall($skinDll, "int:cdecl", "ApplySkin")
GUISetFont (9, 400)
GUICtrlCreatePic($FILE_LOGOPATH, 0, 0, 0, 0)
If $isOpenPrepare == "1" Then
Local $ListView1 = GUICtrlCreateListView(" 设 备 | 硬 件 检 测 信 息", 14, 90, 442, 90)
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSendMsg(-1, 0x101E, 0, 70)
GUICtrlSendMsg(-1, 0x101E, 1, 360)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlCreateListViewItem(" 处理器|" & $CpuType, $ListView1)
GUICtrlCreateListViewItem(" 主 板|" & $Chipset_NorthBridge, $ListView1)
GUICtrlCreateListViewItem(" 显 卡|" & $VideoType, $ListView1)
GUICtrlCreateListViewItem(" 声 卡|" & $AudioType, $ListView1)
GUICtrlCreateListViewItem(" 网 卡|" & $LanType, $ListView1)
EndIf
Local $Group1 = GUICtrlCreateGroup("台式机驱动", 14, 94+$listViewHeigh+$groupHeigh1, 442, 65)
Local $Checkbox1 = GUICtrlCreateCheckbox($arrTxt[1], 60, 110+$listViewHeigh+$groupHeigh1, 89, 17)
Local $Checkbox2 = GUICtrlCreateCheckbox($arrTxt[2], 188, 110+$listViewHeigh+$groupHeigh1, 89, 17)
Local $Checkbox3 = GUICtrlCreateCheckbox($arrTxt[3], 308, 110+$listViewHeigh+$groupHeigh1, 89, 17)
Local $Checkbox4 = GUICtrlCreateCheckbox($arrTxt[4], 60, 134+$listViewHeigh+$groupHeigh1, 89, 17)
Local $Checkbox5 = GUICtrlCreateCheckbox($arrTxt[5], 188, 134+$listViewHeigh+$groupHeigh1, 89, 17)
Local $Checkbox6 = GUICtrlCreateCheckbox($arrTxt[6], 308, 134+$listViewHeigh+$groupHeigh1, 89, 17)
Local $Group2 = GUICtrlCreateGroup("笔记本驱动", 14, 164+$listViewHeigh+$groupHeigh2, 442, 41)
Local $Checkbox7 = GUICtrlCreateCheckbox($arrTxt[7], 60, 180+$listViewHeigh+$groupHeigh2, 89, 17)
Local $Checkbox8 = GUICtrlCreateCheckbox($arrTxt[8], 188, 180+$listViewHeigh+$groupHeigh2, 89, 17)
Local $Checkbox9 = GUICtrlCreateCheckbox($arrTxt[9], 308, 180+$listViewHeigh+$groupHeigh2, 89, 17)
Local $pro = GUICtrlCreateProgress(14, 210+$listViewHeigh+$groupHeigh3, 442, 12)
Local $labClueMsg = GUICtrlCreateLabel($CLUEMSG,34, 228+$listViewHeigh+$groupHeigh3, 430, 20)
Local $btnOK = GUICtrlCreateButton(" 安装驱动(Y) ", 60, 244+$listViewHeigh+$groupHeigh3, 89, 25, 0)
Local $btnExit = GUICtrlCreateButton(" 退出程序(N) ", 320, 244+$listViewHeigh+$groupHeigh3, 89, 25, 0)
Local $Graphic1 = GUICtrlCreateGraphic(0, 270+$listViewHeigh+$groupHeigh3, 472, 2,$SS_ETCHEDHORZ)
Local $Graphic2 = GUICtrlCreateGraphic(290, 275+$listViewHeigh+$groupHeigh3, 2, 16, BitOR($SS_CENTER,$SS_ETCHEDHORZ))
Local $labWelcomeMsg = GUICtrlCreateLabel($WELCOMEMSG, 14, 276+$listViewHeigh+$groupHeigh3, 240, 20)
Local $labAuthorMsg = GUICtrlCreateLabel($AUTHORMSG, 310, 276+$listViewHeigh+$groupHeigh3, 160, 20)
GuiCtrlSetCursor(-1, 0)
If $ISDOS == 0 Then
GUICtrlSetState($labAuthorMsg, $GUI_DISABLE)
GUICtrlSetStyle($pro,0x01)
EndIf
;------------设置预选中的复选框--------------
For $v=1 to 9
If StringInStr($checkedNumber, $v) Then GUICtrlSetState(Eval("Checkbox" & $v), $GUI_CHECKED)
next
;----------------------------------主窗体初始化完成---------------------------------------
;----------------------------------设置热键-------------------------
HotKeySet ("n", "doQuit")
HotKeySet ("N", "doQuit")
HotKeySet ("y","doBegin")
HotKeySet ("Y","doBegin")
HotKeySet ("0","checkAll")
HotKeySet ("1","checked1")
HotKeySet ("2","checked2")
HotKeySet ("3","checked3")
HotKeySet ("4","checked4")
HotKeySet ("5","checked5")
HotKeySet ("6","checked6")
HotKeySet ("7","checked7")
HotKeySet ("8","checked8")
HotKeySet ("9","checked9")
;----------------------显示窗体并开始处理----------------------------
GUISetState(@SW_SHOW , $mainForm)
AdlibEnable("runPro_Auto",10*$waitTime)
While 1
Local $Msg = GUIGetMsg()
Select
Case $Msg == $GUI_EVENT_CLOSE
doQuit()
Case $Msg == $btnExit
doQuit()
Case $Msg == $btnOK
btnOK_Click()
Case $Msg == $Checkbox1 Or $Msg == $Checkbox2 Or $Msg == $Checkbox3 Or _
$Msg == $Checkbox4 Or $Msg == $Checkbox5 Or $Msg == $Checkbox6 Or _
$Msg == $Checkbox7 Or $Msg == $Checkbox8 Or $Msg == $Checkbox9
AdlibDisable()
GUICtrlSetData($labWelcomeMsg, $WELCOMEMSG)
$isChecked = $GUI_UNCHECKED
Case $Msg == $labAuthorMsg
ShellExecute($LINKADDRESS)
EndSelect
WEnd
Func init()
readConfig()
If $isOpenMiniSetup == "1" And $miniSetupExtend_register <> "" And FileExists($miniSetupExtend_register) Then
RegWrite($HKEY_RUNONCE, "Soft", "REG_SZ", $miniSetupExtend_register)
EndIf
If $isOpenDelDrv == "1" Then
FileCreateShortcut($FILE_DELETEPATH,$FILE_DELETESHORTCUTPATH,@SystemDir)
For $v=1 to 3
IniWrite($FILE_DELETECONFIGPATH,'extend',$v,$delDrvExtend[$v])
next
IniWrite($FILE_DELETECONFIGPATH,'delete','drvPath',$drvPath)
EndIf
If $waitTime == "" Or $waitTime < 1 Then $waitTime = 10
If $releasePath == "" Then $releasePath = $DEFAULT_RELEASEPATH
If $isOpenPrepare <> "1" Then
$listViewHeigh = 0
$groupHeigh1 = 10
$groupHeigh2 = 20
$groupHeigh3 = 30
EndIf
$devicePath = $XP_DEFAULT_DEVICEPATH & ";" & $releasePath
EndFunc
Func runExtend()
If $isOpenExtend == "1" Then
For $v=1 to 3
If $extend[$v] <> "" And FileExists($extend[$v]) Then RunWait(@ComSpec & " /c " & $extend[$v],"",@SW_HIDE)
FileDelete($extend[$v])
next
EndIf
EndFunc
Func runEverest()
ToolTip(@CR&" 正在检测硬件信息,请稍候... "&@CR, @DesktopWidth/2-120, @DesktopHeight/2-60)
RunWait($EVEREST_PATH & "\Everest /r /custom user.rpf /INI /NOICONS /SILENT report.ini ", $EVEREST_PATH, @SW_HIDE)
ToolTip("")
$CpuType = IniRead($EVEREST_CONFIG_PATH, "CPU", "CPU Properties|CPU Type", "")
$Chipset_NorthBridge = IniRead($EVEREST_CONFIG_PATH, "Chipset", "Chipset1|North Bridge Properties|North Bridge", "")
$VideoType = IniRead($EVEREST_CONFIG_PATH, "PCI / AGP Video", "PCI / AGP Video1", "")
$AudioType = IniRead($EVEREST_CONFIG_PATH, "PCI / PnP Audio", "PCI / PnP Audio1", "")
$LanType = IniRead($EVEREST_CONFIG_PATH, "PCI / PnP Network", "PCI / PnP Network1", "")
If $isOpenPrepare == "1" And ($fileType=="7z" Or $fileType=="rar") Then
runPrepareUNZIP()
EndIf
EndFunc
Func readConfig()
$backpicPath = IniRead($CONFIG_PATH, "backpic", "picpath","")
$backpicWidth = IniRead($CONFIG_PATH, "backpic", "width", "0")
$backpicHeigh = IniRead($CONFIG_PATH, "backpic", "heigh", "0")
$waitTime = Round(IniRead($CONFIG_PATH, "wait", "time",""))
$checkedNumber = IniRead($CONFIG_PATH, "checked", "number", "")
$fileType = IniRead($CONFIG_PATH, "file", "type", "")
$releasePath = IniRead($CONFIG_PATH, "file", "path", "")
$regPath = IniRead($CONFIG_PATH, "file", "reg", "")
$isOpenExtend = IniRead($CONFIG_PATH, "extend", "open", "")
$isOpenMiniSetup = IniRead($CONFIG_PATH, "minisetup", "open", "")
$miniSetupExtend_register = IniRead($CONFIG_PATH, "minisetup", "extend_register", "")
$miniSetupExtend_deploy = IniRead($CONFIG_PATH, "minisetup", "extend_deploy", "")
$isOpenDelDrv = IniRead($CONFIG_PATH, "deldriver", "open", "")
$drvPath = IniRead($CONFIG_PATH, "deldriver", "path", "")
$isOpenPrepare = IniRead($CONFIG_PATH,"prepare","open","")
$arrVideo = IniReadSection($CONFIG_PATH,"video")
$arrAudio = IniReadSection($CONFIG_PATH,"audio")
$arrLan = IniReadSection($CONFIG_PATH,"lan")
$isKillMe = IniRead($CONFIG_PATH, "exit", "del", "")
For $i = 1 To 3
$extend[$i] = IniRead($CONFIG_PATH,"extend",$i,"")
Next
For $i = 1 To 3
$delDrvExtend[$i] = IniRead($CONFIG_PATH, "deldriver", "extend"&$i, "")
Next
For $v = 1 To 9
$arrTxt[$v] = IniRead($CONFIG_PATH,"txt",$v,"")
Next
For $v = 1 To 9
$arrRun[$v] = StringStripWS (IniRead($CONFIG_PATH,"run",$v,""),8)
If StringInStr($arrRun[$v],";") Then
Local $keyValue = StringSplit($arrRun[$v],";")
If $keyValue[2] == "video" Then
$videoKey = $v
ElseIf $keyValue[2] == "audio" Then
$audioKey = $v
ElseIf $keyValue[2] == "lan" Then
$lanKey = $v
Else
MsgBox(8196,"出错","配置文件[run]字段中有;号的写法有错,只能是video或audio或lan,区分大小写")
Exit
EndIf
$arrRun[$v] = $keyValue[1]
EndIf
Next
For $v = 1 To 9
$arrDir[$v] = IniRead($CONFIG_PATH,"dir",$v,"")
Next
EndFunc
Func runPro_Auto()
GUICtrlSetData ($pro,$proPercent)
For $v = 0 To $waitTime Step 1
If GUICtrlRead($pro) = $v*100/$waitTime Then GUICtrlSetData($labWelcomeMsg,$waitTime-$v & "秒后自动退出并默认安装预选驱动")
Next
if $proPercent > 100 then
btnOK_Click()
Return
EndIf
$proPercent += 1
EndFunc
Func runPro_Demand()
GUICtrlSetData ($pro,$proPercent)
if $proPercent > 100 then $proPercent = 0
$proPercent += 20
EndFunc
Func doQuit()
Local $msgResult = MsgBox(8196,"提示"," 你确定要退出程序吗?")
If $msgResult == 6 Then
quit()
EndIf
EndFunc
Func quit()
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $mainForm, "int", 500, "long", 0x00010010)
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $parentForm, "int", 500, "long", 0x00010010)
If $isOpenMiniSetup == "1" Then
RunWait(@ComSpec & ' /c '& $XP_MINISETUP_COMM,@SystemDir,@SW_HIDE)
If $miniSetupExtend_deploy <> '' And FileExists($miniSetupExtend_deploy) Then RunWait(@ComSpec & " /c " & $miniSetupExtend_deploy,"",@SW_HIDE)
EndIf
cleanData()
Exit
EndFunc
Func doBegin()
If $isRuning == 0 Then btnOK_Click()
EndFunc
Func checkAll()
If $isRuning Then Return
AdlibDisable()
If $isChecked <> $GUI_UNCHECKED Then
$isChecked = $GUI_UNCHECKED
$onCheckedTips = "硬件驱动全部取消选中"
Else
$isChecked = $GUI_CHECKED
$onCheckedTips = "硬件驱动已全部选中"
EndIf
For $v=1 to 9
GUICtrlSetState(Eval("Checkbox" & $v), $isChecked)
next
GUICtrlSetData($labWelcomeMsg,$onCheckedTips)
EndFunc
Func checked1()
refreshData(1)
EndFunc
Func checked2()
refreshData(2)
EndFunc
Func checked3()
refreshData(3)
EndFunc
Func checked4()
refreshData(4)
EndFunc
Func checked5()
refreshData(5)
EndFunc
Func checked6()
refreshData(6)
EndFunc
Func checked7()
refreshData(7)
EndFunc
Func checked8()
refreshData(8)
EndFunc
Func checked9()
refreshData(9)
EndFunc
Func refreshData($number)
If $isRuning Then Return
AdlibDisable()
If GUICtrlRead(Eval("Checkbox"& $number)) == $GUI_CHECKED Then
GUICtrlSetState(Eval("Checkbox"& $number), $GUI_UNCHECKED)
$onCheckedTips = $arrTxt[$number] & " 取消选中"
Else
GUICtrlSetState(Eval("Checkbox"& $number), $GUI_CHECKED)
$onCheckedTips = $arrTxt[$number] & " 已选中"
EndIf
GUICtrlSetData($labWelcomeMsg,$onCheckedTips)
EndFunc
Func setAllControlDisable()
GUICtrlSetState($btnExit, $GUI_DISABLE)
GUICtrlSetState($btnOK, $GUI_DISABLE)
GUICtrlSetState($labAuthorMsg, $GUI_DISABLE)
For $v=1 to 9
GUICtrlSetState(Eval("Checkbox" & $v), $GUI_DISABLE)
next
EndFunc
Func btnOK_Click()
$isRuning = 1
AdlibDisable()
$proPercent = 100
setAllControlDisable()
If $fileType<>"7z" And $fileType<>"rar" And $fileType<>"exe" And $fileType<>"dir" Then
fileTypeWrong()
Else
AdlibEnable("runPro_Demand",40)
If $fileType == "dir" Then
editDirName()
Else
for $i=1 to 9
If $isOpenPrepare == "1" And ($i == $videoKey Or $i == $audioKey Or $i == $lanKey) Then ContinueLoop
If GUICtrlRead(Eval("Checkbox" & $i)) == $GUI_CHECKED And FileExists($arrRun[$i]) Then
GUICtrlSetData($labWelcomeMsg, "正在解压缩 " & $arrTxt[$i] & ',请稍候...')
Local $temp_path = $releasePath
pathFilter($arrRun[$i],$temp_path)
executeUnZip($arrRun[$i],$temp_path)
EndIf
next
EndIf
EndIf
Sleep(300)
GUICtrlSetData($labWelcomeMsg,'正在设置驱动搜索路径...')
If $regPath == "1" And ($fileType == "7z" Or $fileType == "rar") Then
getAllFolderPath($releasePath)
RegWrite($HKEY_CURRENTVERSION,"DevicePath","REG_EXPAND_SZ",$devicePath)
ElseIf FileExists($regPath) Then
RunWait(@ComSpec & ' /c regedit /s '& $regPath &' >nul','', @SW_HIDE)
EndIf
quit()
EndFunc
Func fileTypeWrong()
MsgBox(8196,"错误","驱动类型填写错误!!!")
quit()
EndFunc
Func runPrepareUNZIP()
ToolTip(@CR&" 正在进行预解压,请稍候... "&@CR, @DesktopWidth/2-120, @DesktopHeight/2-60)
searchDate($arrVideo,$VideoType,$videoKey)
searchDate($arrAudio,$AudioType,$audioKey)
searchDate($arrLan,$LanType,$lanKey)
ToolTip("")
EndFunc
Func searchDate($array,$type,$key)
Local $spath,$rpath=$releasePath,$otherKey=0
For $v = 1 To $array[0][0]
If $array[$v][0] == "other" Then
$otherKey = $v
ContinueLoop
EndIf
If StringInStr ($type,$array[$v][0]) <> 0 Then
$spath = $arrRun[$key]&' '&$array[$v][1]
If pathFilter($arrRun[$key],$rpath) Then
$spath = StringStripWS($spath,8)
EndIf
executeUnZip($spath,$rpath)
ExitLoop
EndIf
Next
$spath = $arrRun[$key]&' '&$array[$otherKey][1]
If pathFilter($arrRun[$key],$rpath) Then
$spath = StringStripWS($spath,8)
EndIf
executeUnZip($spath,$rpath)
EndFunc
Func pathFilter(ByRef $spath,ByRef $rpath)
If StringRight ($spath,1)=="\" Then
If $isOpenPrepare <> "1" Then
$spath &= "*.*"
EndIf
Local $strtemp = StringSplit ($spath,"\")
$rpath &= "\"& $strtemp[$strtemp[0]-1]
return 1
EndIf
return 0
EndFunc
Func executeUnZip($S_Path,$R_Path)
If $fileType == "7z" Then
RunWait(@ComSpec & ' /c 7za.exe x -y '& $S_Path &' -o'& $R_Path &'', @SystemDir, @SW_HIDE)
ElseIf $fileType == "rar" Then
RunWait(@ComSpec & ' /c unrar.exe x -y -o+ '& $S_Path &' '& $R_Path &'\', @SystemDir, @SW_HIDE)
Else
RunWait(@ComSpec & ' /c '& $S_Path,'',@SW_HIDE)
EndIf
EndFunc
Func editDirName()
for $i=1 to 9
If GUICtrlRead(Eval("Checkbox" & $i)) = $GUI_UNCHECKED Then
GUICtrlSetData($labWelcomeMsg, "正在移动 " & $arrTxt[$i] & ',请稍候...')
Sleep(300)
DirMove($arrDir[$i],$arrDir[$i] & "_")
EndIf
next
EndFunc
Func getAllFolderPath($path)
Local $search = FileFindFirstFile($path & "\*.*")
While 1
Local $search_FileName = FileFindNextFile($search)
If @error Then ExitLoop
If FileGetAttrib ($path & "\" & $search_FileName) == "D" Then
$devicePath &= ";" & $path & "\" & $search_FileName
getAllFolderPath($path & "\" & $search_FileName)
EndIf
WEnd
FileClose($search)
EndFunc
Func cleanData()
FileDelete($FILE_LOGOPATH)
FileDelete($FILE_7ZAPATH)
FileDelete($FILE_UNRARPATH)
FileDelete($miniSetupExtend_register)
FileDelete($miniSetupExtend_deploy)
DirRemove($EVEREST_PATH,1)
If $isOpenDelDrv <> "1" Then
FileDelete($FILE_DELETEPATH)
FileDelete($FILE_DELETECONFIGPATH)
EndIf
If $isKillMe == "yes" Then
FileDelete($Config_path)
Run(@ComSpec&' /c ping 127.0.0.1 -n 3&del /q "'&@ScriptFullPath&'"',@ScriptDir,@SW_HIDE)
EndIf
EndFunc
[ 本帖最后由 web5151 于 2009-2-20 17:02 编辑 ] |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?加入
×
|