#include <GUIConstantsEx.au3>
#include <Process.au3>
#Region
#AutoIt3Wrapper_Icon=black_apple.ico
#AutoIt3Wrapper_
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_Res_Comment=飞渡技术论坛U盘系统
#AutoIt3Wrapper_Res_Description=飞渡技术论坛U盘系统
#AutoIt3Wrapper_Res_FileVersion=1.0
#AutoIt3Wrapper_Res_LegalCopyright=QQ:89224229
#EndRegion
#NoTrayIcon
Dim $DLL
Opt("guicloseonesc", 0)
Opt("GUIOnEventMode", 1)
Global $COMBO3, $LABEL4, $LABEL5, $LABEL7, $LABEL11, $LABEL12, $LABEL13, $LABEL21, $LABEL22, $LABEL23, $INPUT1, $INPUT2, $INPUT3, $INPUT4, $INPUT5, $GROUP3, $HDX, $PDMSG, $HZ, $HF, $HDX0, $IFGO1, $IFGO2
Global $SIZE, $YSIZE, $HDR, $HDG, $HDGL1, $HDGL2, $START, $WJGS
FBLST()
$FORM2 = GUICreate("飞渡技术论坛U盘维护系统 www.53322", 407, 520, -1, -1)
FileInstall("SkinCrafterDll.dll", @TempDir & "SkinCrafterDll.dll", 1)
FileInstall("Thai_Style_ST.skf", @TempDir & "Thai_Style_ST.skf", 1)
Dim $BF = @TempDir & "Thai_Style_ST.skf"
_SKINGUI(@TempDir & "SkinCrafterDll.dll", $BF, $FORM2)
FileInstall("logo.jpg", @TempDir & "\")
$PIC2 = GUICtrlCreatePic(@TempDir & "\logo.jpg", 16, 8, 377, 33)
FileDelete(@TempDir & "\logo.jpg")
$LABEL1 = GUICtrlCreateLabel("请选择要操作的U盘:", 56, 56, 124, 17)
$COMBO1 = GUICtrlCreateCombo("", 56, 80, 201, 25)
$BUTTON1 = GUICtrlCreateButton("刷新U盘", 272, 80, 65, 25)
$LABEL2 = GUICtrlCreateLabel("请选择制作的模式:", 56, 112, 112, 17)
$GROUP1 = GUICtrlCreateGroup("", 72, 136, 105, 81)
$RADIO1 = GUICtrlCreateRadio("USB--ZIP", 88, 152, 81, 25)
$RADIO2 = GUICtrlCreateRadio("USB--HDD", 88, 184, 81, 25)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$GROUP2 = GUICtrlCreateGroup("", 216, 136, 97, 81)
$RADIO3 = GUICtrlCreateRadio("--FAT32", 232, 152, 65, 25)
$RADIO4 = GUICtrlCreateRadio("--FAT16", 232, 184, 65, 25)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$LABEL3 = GUICtrlCreateLabel("请选择安装方式:", 56, 232, 100, 17)
$COMBO2 = GUICtrlCreateCombo("", 57, 256, 153, 25)
GUICtrlSetData($COMBO2, "完整安装|移动硬盘多分区安装", "完整安装")
$LABEL6 = GUICtrlCreateLabel("制作进度:", 56, 360, 64, 17)
$PROGRESS1 = GUICtrlCreateProgress(56, 384, 289, 25)
$BUTTON2 = GUICtrlCreateButton("安装", 56, 424, 81, 33)
$BUTTON3 = GUICtrlCreateButton("初始化U盘", 152, 424, 81, 33)
$BUTTON4 = GUICtrlCreateButton("退出", 256, 424, 83, 33)
$COMBO_THEME = GUICtrlCreateCombo("", 57, 485, 195, 25)
GUICtrlSetData($COMBO_THEME, "飞渡启动背景|绿启动背景", "飞渡启动背景")
$BUTTON_THEME = GUICtrlCreateButton("安装U盘启动背景", 256, 475, 110, 33)
HDLIST()
GUISetState(@SW_SHOW)
HDXR()
GUISetOnEvent($GUI_EVENT_CLOSE, "quit")
GUICtrlSetOnEvent($COMBO2, "choose")
GUICtrlSetOnEvent($BUTTON1, "hdlistag")
GUICtrlSetOnEvent($BUTTON4, "quit")
GUICtrlSetOnEvent($BUTTON3, "csh")
GUICtrlSetOnEvent($BUTTON2, "install")
GUICtrlSetOnEvent($BUTTON_THEME, "theme")
While 1
Sleep(100)
WEnd
Func INSTALL()
HDXR()
PDMS()
If $IFGO1 = "goto1" And $IFGO2 = "goto2" Then PDFS()
If $IFGO1 = "stop1" And $IFGO2 = "stop2" Then Return
EndFunc  ;==>INSTALL
Func PDFS()
If GUICtrlRead($COMBO2) = "完整安装" Then
$PDMSG = MsgBox(4 + 48 + 256 + 262144, "警告", "U盘" & $HDX0 & "将被全盘格式化,是否继续?")
If $PDMSG = 6 Then
GUISetState(@SW_DISABLE)
ToolTip(@CR & "    正在创建启动分区,请稍候……    " & @CR & " ", @DesktopWidth - 500, @DesktopHeight - 240)
_RunDOS(" " & $HDX & " format --force " & $HZ & $HF & " --primary 10M --extended 120M --align")
GUICtrlSetData($PROGRESS1, 20)
ToolTip(@CR & "    正在安装核心插件,请稍候……    " & @CR & " ", @DesktopWidth - 500, @DesktopHeight - 240)
_RunDOS(" " & $HDX & " load zhizun.fba")
GUICtrlSetData($PROGRESS1, 75)
ToolTip(@CR & "    正在完成安装,请稍候……    " & @CR & " ", @DesktopWidth - 500, @DesktopHeight - 240)
_RunDOS(" " & $HDX & " add " & " ghost.img" & "" & $WJGS & " ghost.img")
_RunDOS(" " & $HDX & " add " & " menu2" & "" & $WJGS & " menu2")
GUICtrlSetData($PROGRESS1, 100)
ToolTip("")
GUISetState(@SW_ENABLE)
MsgBox(0 + 262144, "提示", "已安装到U盘 " & $HDX0 & "")
GUICtrlSetData($PROGRESS1, 0)
EndIf
EndIf
If GUICtrlRead($COMBO2) = "移动硬盘多分区安装" And GUICtrlRead($COMBO3) = "3个分区" Then
Dim $YDSIZE1 = GUICtrlRead($INPUT1)
Dim $YDSIZE2 = GUICtrlRead($INPUT2)
Dim $YDSIZE3 = GUICtrlRead($INPUT3)
If StringIsDigit($YDSIZE1) = 1 And StringIsDigit($YDSIZE2) = 1 And StringIsDigit($YDSIZE3) = 1 Then
IF ($HDR - $YDSIZE1 - 140) > 180 AND ($HDR - $YDSIZE1 - $YDSIZE2 - $YDSIZE3 - 140) > 180 Then
$PDMSG = MsgBox(4 + 48 + 256 + 262144, "警告", "硬盘" & $HDX0 & "将被全盘格式化,是否继续?")
If $PDMSG = 6 Then
GUISetState(@SW_DISABLE)
ToolTip(@CR & "    正在创建启动盘,请稍候……    " & @CR & " ", @DesktopWidth - 300, @DesktopHeight - 180)
_RunDOS(" " & $HDX & " format --force " & $HZ & $HF & " --primary 10M --extended 120M --size " & $YDSIZE1 & "M --align")
GUICtrlSetData($PROGRESS1, 10)
ToolTip(@CR & "    正在创建可见分区,请稍候……    " & @CR & " ", @DesktopWidth - 300, @DesktopHeight - 180)
_RunDOS("Gdisk32 " & $HDG & " /cre /ext /for /q /sure")
GUICtrlSetData($PROGRESS1, 25)
ToolTip(@CR & "    正在格式化可见分区,请稍候……    " & @CR & " ", @DesktopWidth - 300, @DesktopHeight - 180)
_RunDOS("Gdisk32 " & $HDG & " /cre /log /sz:" & $YDSIZE2 & " /for /q /NTFS /sure")
_RunDOS("Gdisk32 " & $HDG & " /cre /log /sz:" & $YDSIZE3 & " /for /q /NTFS /sure")
_RunDOS("Gdisk32 " & $HDG & " /cre /log /for /q /NTFS /sure")
GUICtrlSetData($PROGRESS1, 40)
ToolTip(@CR & "    正在安装核心插件,请稍候……    " & @CR & " ", @DesktopWidth
- 300, @DesktopHeight - 180)
_RunDOS(" " & $HDX & " load zhizun.fba")
GUICtrlSetData($PROGRESS1, 80)
ToolTip(@CR & "    正在完成安装,请稍候……    " & @CR & " ", @DesktopWidth - 300, @DesktopHeight - 180)
_RunDOS(" " & $HDX & " add " & " ghost.img" & "" & $WJGS & " ghost.img")
_RunDOS(" " & $HDX & " add " & " menu2" & "" & $WJGS & " menu2")
GUICtrlSetData($PROGRESS1, 100)
ToolTip("")
GUISetState(@SW_ENABLE)
MsgBox(0 + 262144, "提示", "已安装到硬盘 " & $HDX0 & "")
GUICtrlSetData($PROGRESS1, 0)
EndIf
Else
MsgBox(0 + 48 + 262144, "警告", "输入容量范围有误请重新输入")
Return
EndIf
Else
MsgBox(0 + 48 + 262144, "警告", "输入非法请重新输入")
Return
EndIf
EndIf
If GUICtrlRead($COMBO2) = "移动硬盘多分区安装" And GUICtrlRead($COMBO3) = "3个分区" Then
Dim $YDSIZE1 = GUICtrlRead($INPUT1)
Dim $YDSIZE2 = GUICtrlRead($INPUT2)
If StringIsDigit($YDSIZE1) = 1 And StringIsDigit($YDSIZE2) = 1 Then
IF ($HDR - $YDSIZE1 - 140) > 180 AND ($HDR - $YDSIZE1 - $YDSIZE2 - 140) > 180 Then
$PDMSG = MsgBox(4 + 48 + 256 + 262144, "警告", "磁盘" & $HDX0 & "将被全盘格式化,是否继续?")
If $PDMSG = 6 Then
GUISetState(@SW_DISABLE)
ToolTip(@CR & "    正在创建启动盘,请稍候……    " & @CR & " ", @DesktopWidth - 300, @DesktopHeight - 180)
_RunDOS(" " & $HDX & " format --force " & $HZ & $HF & " --primary 10M --extended 120M --size " & $YDSIZE1 & "M --align")
GUICtrlSetData($PROGRESS1, 10)
ToolTip(@CR & "    正在创建可见分区,请稍候……    " & @CR & " ", @DesktopWidth - 300, @DesktopHeight - 180)
_RunDOS("Gdisk32 " & $HDG & " /cre /ext /for /q /sure")
GUICtrlSetData($PROGRESS1, 25)
ToolTip(@CR & "    正在格式化可见分区,请稍候……    " & @CR & " ", @DesktopWidth - 300, @DesktopHeight - 180)
_RunDOS("Gdisk32 " & $HDG & " /cre /log /sz:" & $YDSIZE2 & " /for /q /NTFS /sure")
_RunDOS("Gdisk32 " & $HDG & " /cre /log /for /q /NTFS /sure")
GUICtrlSetData($PROGRESS1, 40)
ToolTip(@CR & "    正在安装核心插件,请稍候……    " & @CR & " ", @DesktopWidth - 300, @DesktopHeight - 180)
_RunDOS(" " & $HDX & " load zhizun.fba")
GUICtrlSetData($PROGRESS1, 80)
ToolTip(@CR & "    正在完成安装,请稍候……    " & @CR & " ", @DesktopWidth - 300, @DesktopHeight - 180)
_RunDOS(" " & $HDX & " add " & " ghost.img" & "" & $WJGS & " ghost.img")
_RunDOS(" " & $HDX & " add " & " menu2" & "" & $WJGS & " menu2")
GUICtrlSetData($PROGRESS1, 100)
ToolTip("")
GUISetState(@SW_ENABLE)
MsgBox(0 + 262144, "提示", "已安装到磁盘 " & $HDX0 & "")
GUICtrlSetData($PROGRESS1, 0)
EndIf
Else
MsgBox(0 + 48 + 262144, "警告", "输入容量范围有误请
重新输入")
Return
EndIf
Else
MsgBox(0 + 48 + 262144, "警告", "输入非法请重新输入")
Return
EndIf
EndIf
If GUICtrlRead($COMBO2) = "移动硬盘多分区安装" And GUICtrlRead($COMBO3) = "2个分区" Then
Dim $YDSIZE1 = GUICtrlRead($INPUT1)
If StringIsDigit($YDSIZE1) = 1 Then
IF ($HDR - $YDSIZE1 - 140) > 180 Then
$PDMSG = MsgBox(4 + 48 + 256 + 262144, "警告", "磁盘" & $HDX0 & "将被全盘格式化,是否继续?")
If $PDMSG = 6 Then
GUISetState(@SW_DISABLE)
ToolTip(@CR & "    正在创建启动盘,请稍候……    " & @CR & " ", @DesktopWidth - 300, @DesktopHeight - 180)
_RunDOS(" " & $HDX & " format --force " & $HZ & $HF & " --primary 10M --extended 120M --size " & $YDSIZE1 & "M --align")
GUICtrlSetData($PROGRESS1, 10)
ToolTip(@CR & "    正在创建可见分区,请稍候……    " & @CR & " ", @DesktopWidth - 300, @DesktopHeight - 180)
_RunDOS("Gdisk32 " & $HDG & " /cre /ext /for /q /sure")
GUICtrlSetData($PROGRESS1, 25)
ToolTip(@CR & "    正在格式化可见分区,请稍候……    " & @CR & " ", @DesktopWidth - 300, @DesktopHeight - 180)
_RunDOS("Gdisk32 " & $HDG & " /cre /log /for /q /NTFS /sure")
GUICtrlSetData($PROGRESS1, 40)
ToolTip(@CR & "    正在安装核心插件,请稍候……    " & @CR & " ", @DesktopWidth - 300, @DesktopHeight - 180)
_RunDOS(" " & $HDX & " load zhizun.fba")
GUICtrlSetData($PROGRESS1, 80)
ToolTip(@CR & "    正在完成安装,请稍候……    " & @CR & " ", @DesktopWidth - 300, @DesktopHeight - 180)
_RunDOS(" " & $HDX & " add " & " ghost.img" & "" & $WJGS & " ghost.img")
_RunDOS(" " & $HDX & " add " & " menu2" & "" & $WJGS & " menu2")
GUICtrlSetData($PROGRESS1, 100)
ToolTip("")
GUISetState(@SW_ENABLE)
MsgBox(0 + 262144, "提示", "已安装到磁盘 " & $HDX0 & "")
GUICtrlSetData($PROGRESS1, 0)
EndIf
Else
MsgBox(0 + 48 + 262144, "警告", "输入容量范围有误请重新输入")
Return
EndIf
Else
MsgBox(0 + 48 + 262144, "警告", "输入非法请重新输入")
Return
EndIf
EndIf
EndFunc  ;==>PDFS
Func PDMS()
If GUICtrlRead($RADIO1) = $GUI_CHECKED Then
$HZ = "--zip "
$IFGO1 = "goto1"
$WJGS = "zip"
EndIf
If GUICtrlRead($RADIO2) = $GUI_CHECKED Then
$HZ = ""
$IFGO1 = "goto1"
$WJGS = "hdd"
EndIf
If GUICtrlRead($RADIO3) = $GUI_CHECKED Then
$HF = "--fat32"
$IFGO2 = "goto2"
EndIf
If GUICtrlRead($RADIO4) = $GUI_CHECKED Then
$HF = "--fat16"
$IFGO2 = "goto2"
EndIf
If GUICtrlRead($RADIO1) = $GUI_UNCHECKED And GUICtrlRead($RADIO2) = $GUI_UNCHECKED Then
$IFGO1 = "stop1"
MsgBox(0 + 48 + 262144, "警告", "请选择启动格式HDD/ZIP")
Return
EndIf
If GUICtrlRead($RADIO3) = $GUI_UNCHECKED And GUICtrlRead($RADIO4) = $GUI_UNCHECKED Then
$IFGO2 = "stop2"
MsgBox(0 + 48 + 262
144, "警告", "请选择磁盘格式FAT32/FAT16")
Return
EndIf
EndFunc  ;==>PDMS
Func HDXR()
$HDX0 = GUICtrlRead($COMBO1)
$HDX1 = StringReplace("" & $HDX0 & "", ":", "")
$HDX2 = StringSplit("" & $HDX1 & "", " ")
$HDX = $HDX2[1]
$HDR = Round($HDX2[2] / 2047, 0)
$HDGL = StringReplace("" & $HDX & "", "(hd", "")
$HDGL2 = StringReplace("" & $HDGL & "", ")", "")
$HDG = $HDGL2 + 1
EndFunc  ;==>HDXR
Func CSH()
HDXR()
$PDMSG = MsgBox(4 + 48 + 256 + 262144, "警告", "磁盘 " & $HDX0 & " 将被全盘格式化,是否继续?")
If $PDMSG = 6 Then
ToolTip(@CR & "    正在初始化磁盘,请稍候……    " & @CR & " ", @DesktopWidth - 500, @DesktopHeight - 260)
GUICtrlSetData($PROGRESS1, 20)
Sleep(300)
GUICtrlSetData($PROGRESS1, 40)
_RunDOS(" " & $HDX & " format --force --raw")
ToolTip("")
GUICtrlSetData($PROGRESS1, 80)
Sleep(300)
GUICtrlSetData($PROGRESS1, 100)
MsgBox(0 + 262144, "提示", "磁盘 " & $HDX0 & " 初始化完毕")
GUICtrlSetData($PROGRESS1, 0)
EndIf
If $PDMSG = 7 Then Return
EndFunc  ;==>CSH
Func CHOOSE()
If GUICtrlRead($COMBO2) = "标准安装" Then
GUICtrlDelete($GROUP3)
GUICtrlDelete($LABEL4)
GUICtrlDelete($LABEL5)
GUICtrlDelete($INPUT1)
GUICtrlDelete($INPUT2)
GUICtrlDelete($INPUT3)
GUICtrlDelete($INPUT4)
GUICtrlDelete($COMBO3)
GUICtrlDelete($INPUT5)
GUICtrlDelete($LABEL7)
GUICtrlDelete($LABEL21)
GUICtrlDelete($LABEL22)
GUICtrlDelete($LABEL23)
EndIf
If GUICtrlRead($COMBO2) = "移动硬盘多分区安装" Then
GUICtrlDelete($INPUT5)
GUICtrlDelete($LABEL7)
$COMBO3 = GUICtrlCreateCombo("", 240, 256, 97, 25)
GUICtrlSetData($COMBO3, "2个分区|3个分区", "3个分区")
$LABEL4 = GUICtrlCreateLabel("可见分区设置:", 240, 232, 100, 17)
$GROUP3 = GUICtrlCreateGroup("请输入各分区容量大小直接输入数字(单位MB)即可:", 56, 280, 289, 73)
$LABEL5 = GUICtrlCreateLabel(" 第1分区:  第2分区: 第3分区: ", 69, 304, 262, 17)
$LABEL22 = GUICtrlCreateLabel("剩余容量", 200, 330, 52, 17)
$INPUT1 = GUICtrlCreateInput("", 72, 328, 49, 21)
$INPUT2 = GUICtrlCreateInput("", 136, 328, 49, 21)
GUICtrlSetOnEvent($COMBO3, "exchan")
EndIf
If GUICtrlRead($COMBO2) = "" Then
GUICtrlDelete($GROUP3)
GUICtrlDelete($LABEL4)
GUICtrlDelete($LABEL5)
GUICtrlDelete($INPUT1)
GUICtrlDelete($INPUT2)
GUICtrlDelete($INPUT3)
GUICtrlDelete($INPUT4)
GUICtrlDelete($COMBO3)
GUICtrlDelete($INPUT5)
GUICtrlDelete($LABEL7)
GUICtrlDelete($LABEL11)
autoitGUICtrlDelete($LABEL12)
GUICtrlDelete($LABEL13)
GUICtrlDelete($LABEL21)
GUICtrlDelete($LABEL22)
GUICtrlDelete($LABEL23)
EndIf
EndFunc  ;==>CHOOSE
Func EXCHAN()
If GUICtrlRead($COMBO3) = "2个分区" Then
GUICtrlDelete($INPUT1)
GUICtrlDelete($INPUT2)
GUICtrlDelete($INPUT3)
GUICtrlDelete($INPUT4)
GUICtrlDelete($LABEL22)
GUICtrlDelete($LABEL23)
$LABEL11 = GUICtr

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。