又更新 了一下
#Region ;**** 由 AccAu3Wrapper_GUI 创建指令 ****
#AccAu3Wrapper_Icon=D:\多彩图标\apps\falkon.ico
#AccAu3Wrapper_Outfile=C:\Users\Administrator\Desktop\Twist File_back.exe
#AccAu3Wrapper_UseX64=n
#AccAu3Wrapper_Res_Fileversion=1.0.0.1
#AccAu3Wrapper_Res_Fileversion_AutoIncrement=p
#AccAu3Wrapper_Res_Language=2052
#AccAu3Wrapper_Res_requestedExecutionLevel=highestAvailable
#AccAu3Wrapper_Add_Constants=y
#EndRegion ;**** 由 AccAu3Wrapper_GUI 创建指令 ****
#include <StaticConstants.au3>
; *** AutoIt3Wrapper 结束 ***
#include <GUIConstants.au3>
#include <WinAPIFiles.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <Process.au3>
#include <Timers.au3>
#include <Date.au3>
_WinAPI_Wow64EnableWow64FsRedirection(False)
FileInstall("D:\au3\Skin\斜黑风格.she", @TempDir & "\3.she", 1)
FileInstall("D:\au3\Skin\Skin.dll", @TempDir & "\", 1)
$skins = @TempDir & "\3.she"
$Dll = DllOpen(@TempDir & "\Skin.dll")
DllCall($Dll, "int", "SkinH_AttachEx", "str", $skins, "str", "mhgd")
DllCall($Dll, "int", "SkinH_SetAero", "int", 1)
FileDelete(@TempDir & "\3.she")
If FileExists(@ScriptDir & "\cofing.ini") Then
Else
FileInstall("D:\au3\QT\cofing.ini", @ScriptDir & "\cofing.ini", 1)
FileSetAttrib(@ScriptDir & "\cofing.ini", "+H", 1)
EndIf
Local $cofing = @ScriptDir & "\cofing.ini"
Local $backlj = IniRead($cofing, "LJ", "back", "")
Local $Reselj = IniRead($cofing, "LJ", "Rese", "")
$MHT = GUICreate("Twist File_back ||麻花腾文件备份还原工具。版本 V 1.0.0.1", 700, 412)
$Pro = GUICtrlCreateProgress(10, 335, 680, 15)
$Pro2 = GUICtrlCreateProgress(10, 355, 680, 15)
$SJ = GUICtrlCreateLabel("", 10, 190, 680, 25, BitOR(0x1, 0x0300))
GUICtrlSetFont(-1, 14, 600, 1, "浪漫雅圆")
$Pro0Text = GUICtrlCreateLabel("", 10, 220, 680, 40, BitOR(0x1, 0x0300))
GUICtrlSetFont(-1, 25, 650, 1, "浪漫雅圆")
$ProText = GUICtrlCreateLabel("", 10, 295, 680, 25, BitOR(0x1, 0x0300))
GUICtrlSetFont(-1, 12, 400, 1, "浪漫雅圆")
$Pro2Text = GUICtrlCreateLabel("", 10, 265, 680, 25, BitOR(0x1, 0x0300))
GUICtrlSetFont(-1, 12, 400, 1, "浪漫雅圆")
$back = GUICtrlCreateButton("back", 620, 376, 70, 28) ;,BitOR(0x1, 0x0300))
GUICtrlSetFont(-1, 12, 400, 1, "浪漫雅圆")
$Rese = GUICtrlCreateButton("Rese", 542, 376, 70, 28) ;,BitOR(0x1, 0x0300))
GUICtrlSetFont(-1, 12, 400, 1, "浪漫雅圆")
$ini = GUICtrlCreateButton("INI", 485, 376, 50, 28) ;,BitOR(0x1, 0x0300))
GUICtrlSetFont(-1, 12, 400, 1, "浪漫雅圆")
$setupfont = GUICtrlCreateButton("安装所缺字体", 360, 376, 118, 28)
GUICtrlSetFont(-1, 12, 400, 1, "浪漫雅圆")
$BK = GUICtrlCreateLabel("请打开INI编辑备份、恢复路径。", 10, 376, 345, 28, BitOR(0x1, 0x0300))
GUICtrlSetFont(-1, 12, 400, 1, "浪漫雅圆")
FileInstall("D:\AU3\一键还原\ICO\LOGO.ICO", @TempDir & "\LOGO.ICO", 1)
GUICtrlCreateIcon(@TempDir & "\LOGO.ico", -1, 282, 18, 136, 136)
GUICtrlCreateGroup("", 2, 1, 696, 410)
;~ WinSetTrans("MoveSoft","",200)
GUICtrlCreateLabel("", 10, 331, 680, 1, $SS_BLACKRECT)
GUICtrlCreateLabel("", 10, 406, 680, 1, $SS_BLACKRECT)
GUICtrlCreateLabel("", 10, 373, 680, 1, $SS_BLACKRECT)
GUICtrlCreateLabel("", 10, 169, 680, 1, $SS_BLACKRECT)
$GROUP = GUICtrlCreateGroup("备份|还原路径", 10, 178, 680, 150)
GUICtrlSetFont(-1, 9, 400, 1, "浪漫雅圆")
GUICtrlCreateGroup("知识能改变命运??", 10, 10, 680, 150)
GUICtrlSetFont(-1, 9, 400, 1, "浪漫雅圆")
$www = GUICtrlCreateLabel("", 160, 210, 380, 40, BitOR(0x1, 0x0300))
GUICtrlSetFont(-1, 12, 550, 1, "浪漫雅圆")
$www1 = GUICtrlCreateLabel("", 160, 255, 380, 40, BitOR(0x1, 0x0300))
GUICtrlSetFont(-1, 12, 550, 1, "浪漫雅圆")
GUISetState()
DKINI()
Dim $timer = TimerInit(), $Day = 0
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $setupfont
;~ GUICtrlSetState($setupfont, 128)
GUICtrlSetData($BK, "正在安装字体,请稍候......")
FileInstall("D:\au3\FONT\font\SIMYOU", @TempDir & "\SIMYOU.TTF", 1)
FileInstall("D:\au3\FONT\font\浪漫雅园", @TempDir & "\浪漫雅园.ttf", 1)
FileInstall("D:\au3\FONT\font\时尚中黑简体", @TempDir & "\时尚中黑简体.ttf", 1)
FileInstall("D:\au3\FONT\FontRegx64.exe", @TempDir & "\FontRegx64.exe", 1)
FileInstall("D:\au3\FONT\FontRegx86.exe", @TempDir & "\FontRegx86.exe", 1)
FileInstall("D:\au3\FONT\fonts.bat", @TempDir & "\fonts.bat", 1)
_RunDos(@TempDir & "\fonts.bat")
Sleep(1000)
FileDelete(@TempDir & "\FontRegx64.exe")
FileDelete(@TempDir & "\FontRegx86.exe")
FileDelete(@TempDir & "\fonts.bat")
Run("Twist File_back.exe")
Exit
Case $back
GUICtrlSetState($www, 32)
GUICtrlSetState($www1, 32)
AdlibRegister('Timer', 1000)
_BACK()
GUICtrlSetState($www, 64 + 16)
GUICtrlSetState($GROUP, 64 + 16)
GUICtrlSetState($www1, 64 + 16)
GUICtrlSetState($Pro, 16)
GUICtrlSetState($Pro2, 16)
Case $Rese
GUICtrlSetState($www1, 32)
GUICtrlSetState($www, 32)
AdlibRegister('Timer', 1000)
Rese()
GUICtrlSetState($www, 64 + 16)
GUICtrlSetState($GROUP, 64 + 16)
GUICtrlSetState($www1, 64 + 16)
GUICtrlSetState($Pro, 16)
GUICtrlSetState($Pro2, 16)
Case $ini
WinSetState($MHT, "", @SW_MINIMIZE)
If FileExists(@ScriptDir & "\cofing.ini") Then
ShellExecuteWait("notepad.exe", @ScriptDir & "\cofing.ini")
Run("Twist File_back.exe")
Exit
Else
MsgBox(64, "麻花腾提示你!", "没有发现配置文件!", 3)
WinSetState($MHT, "", @SW_RESTORE)
EndIf
EndSwitch
WEnd
Func DKINI()
Local Const $sFilePath = (@ScriptDir & "\cofing.ini")
Local $aArray = IniReadSection($sFilePath, "LJ")
If Not @error Then
For $i = 1 To $aArray[0][0]
GUICtrlSetData($WWW, "还原路径为:" & $aArray[1][1])
GUICtrlSetData($WWW1, "备份路径为:" & $aArray[2][1])
Next
EndIf
EndFunc ;==>DKINI
Func Rese()
IF FileExists($backlj) Then
GUICtrlSetState($Pro, 16)
GUICtrlSetState($Pro2, 16)
ProgressCopy($Reselj, $backlj, 1)
GUICtrlSetState($Pro, 32)
GUICtrlSetState($GROUP, 32)
GUICtrlSetState($www, 32)
GUICtrlSetState($www1, 32)
GUICtrlSetState($Pro2, 32)
AdlibUnRegister('Timer')
Else
MsgBox(786448, "麻花腾提示你!", "没有发现要还原的目录!现新建1个", 3)
DirCreate($backlj)
GUICtrlSetState($Pro, 16)
GUICtrlSetState($Pro2, 16)
ProgressCopy($Reselj, $backlj, 1)
GUICtrlSetState($Pro, 32)
GUICtrlSetState($GROUP, 32)
GUICtrlSetState($www, 32)
GUICtrlSetState($www1, 32)
GUICtrlSetState($Pro2, 32)
AdlibUnRegister('Timer')
EndIf
EndFunc ;==>Rese
Func _BACK()
IF FileExists($backlj) Then
DirCreate($Reselj)
GUICtrlSetState($Pro, 16)
GUICtrlSetState($Pro2, 16)
ProgressCopy($backlj, $Reselj, 1)
GUICtrlSetState($Pro, 32)
GUICtrlSetState($GROUP, 32)
GUICtrlSetState($www, 32)
GUICtrlSetState($www1, 32)
GUICtrlSetState($Pro2, 32)
AdlibUnRegister('Timer')
Else
AdlibUnRegister('Timer')
MsgBox(64, "麻花腾提示你!", "没有发现要备份的目录!", 3)
endif
EndFunc ;==>_BACK
Func ProgressCopy($current, $destination, $UseMultiColour = 0, $attrib = "-R", $overwrite = 1, $Run1 = 0)
If $Run1 = 0 Then
Global $OverallQty, $Overall, $source, $overallpercent, $Pro0Text, $Pro, $ProText, $Pro2, $Pro2Text, $LocalPercent
DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0)
If Not FileExists($destination) Then DirCreate($destination) ; This is why it was failing, the dir did not exist
$source = $current
If StringRight($current, 1) = '\' Then $current = StringTrimRight($current, 1)
If StringRight($destination, 1) <> '\' Then $destination = $destination & "\"
$tosearch = $current
$Overall = DirGetSize($tosearch, 1)
$OverallQty = $Overall[1]
$Run1 = 1
EndIf
$Size = DirGetSize($current, 3)
$Qty = $Size[1]
Local $search = FileFindFirstFile($current & "\*.*")
While 1
Dim $file = FileFindNextFile($search)
If @error Or StringLen($file) < 1 Then ExitLoop
If Not StringInStr(FileGetAttrib($current & "\" & $file), "D") And ($file <> "." Or $file <> "..") Then
$Qty -= 1
$LocalPercent = 100 - (($Qty / $Size[1]) * 100)
$OverallQty -= 1
$overallpercent = 100 - (($OverallQty / $Overall[1]) * 100)
GUICtrlSetData($Pro0Text, "" & Int($overallpercent) & "%")
GUICtrlSetData($Pro, $overallpercent)
GUICtrlSetData($Pro2, $LocalPercent)
GUICtrlSetData($Pro2Text, "正在拷贝: " & $file & "文件")
If $UseMultiColour Then
GUICtrlSetColor($Pro2, _ChangeColour($LocalPercent))
GUICtrlSetColor($Pro, _ChangeColour($overallpercent))
EndIf
FileCopy($current & "\" & $file, $destination & StringTrimLeft($current, StringLen($source)) & "\" & $file, $overwrite)
FileSetAttrib($destination & StringTrimLeft($current, StringLen($source)) & "\" & $file, $attrib)
EndIf
If StringInStr(FileGetAttrib($current & "\" & $file), "D") And ($file <> "." Or $file <> "..") Then
DirCreate($destination & StringTrimLeft($current, StringLen($source)) & "\" & $file)
FileSetAttrib($destination & StringTrimLeft($current, StringLen($source)) & "\" & $file, $attrib)
GUICtrlSetData($ProText, "拷贝路径:" & $current & "\" & $file)
ProgressCopy($current & "\" & $file, $destination, $UseMultiColour, $attrib, $overwrite, 1)
EndIf
WEnd
FileClose($search)
If $overallpercent = 100 Then
GUICtrlSetData($Pro2Text, "已完成: 100% ")
GUICtrlSetData($Pro, 100)
GUICtrlSetData($Pro2, 100)
Sleep(2000)
GUICtrlSetState($Pro2Text, 32)
GUICtrlSetState($SJ, 32)
GUICtrlSetState($Pro0Text, 32)
GUICtrlSetState($ProText, 32)
$Run1 = 0
EndIf
EndFunc ;==>ProgressCopy
Func _ChangeColour($start)
$Redness = Int(255 - ($start / 100 * 512))
If $Redness < 0 Then $Redness = 0
$Greeness = Int(($start / 100 * 512) - 257)
If $Greeness < 0 Then $Greeness = 0
$Blueness = Int(255 - ($Redness + $Greeness))
Return ($Redness * 256 * 256) + ($Greeness * 256) + $Blueness
EndFunc ;==>_ChangeColour
Func Timer()
Local $Secs, $Mins, $Hour, $Time, $ticks, $sTime
$ticks = Int(TimerDiff($timer))
If $ticks >= 86400000 Then
$Day += 1
$timer = TimerInit()
$ticks = 0
EndIf
_TicksToTime($ticks, $Hour, $Mins, $Secs)
$Time = StringFormat('' & '%02s:%02s:%02s', $Hour, $Mins, $Secs)
If $sTime <> $Time Then
GUICtrlSetData($SJ, $Time)
EndIf
$sTime = $Time
EndFunc ;==>Timer
|