请教如何在软件安装管理器上加上进度条?附源码...
在网络中下载一个软件安装管理器源码,但是只能静默安装,看着好像没有安装一样,这样有的人容易退出程序!安装过程我想实现,安装那个软件就显示:“正在安装(“如qq2009”),请稍候...”,文字下面显示安装进度条。回复请给出具体代码,放到哪个位置,因为是菜鸟,给出思路,可能也不会。源码如下: $g_Version = "888"
If WinExists($g_Version) Then Exit
AutoItWinSetTitle($g_Version)
Opt("TrayIconHide", 1)
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
If not FileExists(@ScriptDir&"\soft.ini") then
msgbox(0,"","配置文件不存在,程序正在退出...")
Exit
Endif
$ckbt=IniReadSection(@ScriptDir&"\soft.ini", "窗口标题")
$picpath=IniReadSection(@ScriptDir&"\soft.ini", "图像")
$ljpath=IniReadSection(@ScriptDir&"\soft.ini", "路径")
if $picpath="" Then
$piclj=@ScriptDir&"\AA.jpg"
Else
$piclj=$picpath
EndIf
Dim $Checkbox
$Form1 = GUICreate($ckbt, 482, 324, 247, 154)
WinActive($ckbt)
WinSetOnTop ($ckbt, "",1 )
$Pic1 = GUICtrlCreatePic($piclj, 0, 0, 482, 70, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$Group1 = GUICtrlCreateGroup("常用软件+", 15, 74, 451, 89)
$Checkbox = GUICtrlCreateCheckbox($ljpath, 24, 90, 137, 30)
GUICtrlSetFont(-1, 11, 400, 0, "MS Sans Serif")
GUICtrlSetState ( $Checkbox, $GUI_CHECKED)
$Checkbox = GUICtrlCreateCheckbox($ljpath, 24, 122, 137, 30)
GUICtrlSetFont(-1, 11, 400, 0, "MS Sans Serif")
GUICtrlSetState ( $Checkbox, $GUI_CHECKED)
$Checkbox = GUICtrlCreateCheckbox($ljpath, 163, 89, 137, 30)
GUICtrlSetFont(-1, 11, 400, 0, "MS Sans Serif")
GUICtrlSetState ( $Checkbox, $GUI_CHECKED)
$Checkbox = GUICtrlCreateCheckbox($ljpath, 163, 128, 137, 30)
GUICtrlSetFont(-1, 11, 400, 0, "MS Sans Serif")
GUICtrlSetState ( $Checkbox, $GUI_CHECKED)
$Checkbox = GUICtrlCreateCheckbox($ljpath, 317, 90, 137, 30)
GUICtrlSetFont(-1, 11, 400, 0, "MS Sans Serif")
GUICtrlSetState ( $Checkbox, $GUI_CHECKED)
$Checkbox = GUICtrlCreateCheckbox($ljpath, 317, 126, 137, 30)
GUICtrlSetFont(-1, 11, 400, 0, "MS Sans Serif")
GUICtrlSetState ( $Checkbox, $GUI_CHECKED)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("系统美化+", 15, 178, 451, 46)
$Checkbox = GUICtrlCreateCheckbox($ljpath, 24, 190, 177, 30)
GUICtrlSetFont(-1, 11, 400, 0, "MS Sans Serif")
GUICtrlSetState ( $Checkbox, $GUI_CHECKED)
$Checkbox = GUICtrlCreateCheckbox($ljpath, 206, 190, 177, 30)
GUICtrlSetFont(-1, 11, 400, 0, "MS Sans Serif")
GUICtrlSetState ( $Checkbox, $GUI_CHECKED)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Label1 = GUICtrlCreateLabel(" 说明:为全选/全不选,Y安装,取消", 56, 230, 385, 17)
$Progress1 = GUICtrlCreateProgress(15, 254, 451, 12, -1,-1)
$Button1 = GUICtrlCreateButton("安装所选软件", 80, 280, 137, 33, 0)
GUICtrlSetState ( $Button1, $GUI_FOCUS )
$Button2 = GUICtrlCreateButton("不安装软件", 260, 280, 137, 33, 0)
DllCall("user32.dll", "int", "AnimateWindow", "hwnd",$form1, "int", 500, "long", 0x00000010)
GUISetState(@SW_SHOW)
$wsj = 10 ;等待的时间
$all=10 ;时间*这个变量就是100
AdlibEnable("mytime",1000)
HotKeySet("ESC", "csesc")
HotKeySet("y", "setup")
HotKeySet("n", "setup")
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
case $Button1
setup()
case $Button2
csesc()
Case $GUI_EVENT_CLOSE
AdlibDisable()
DllCall("user32.dll", "int", "AnimateWindow", "hwnd",$form1, "int", 500, "long", 0x00090000);退出效果
Exit
EndSwitch
WEnd
func csesc()
Exit
EndFunc
func nosetup()
Exit
EndFunc
Func error($s)
MsgBox(0,"错误!",$s)
Exit
EndFunc
Func mytime()
if $wsj < 0 Then
if GUICtrlRead ($Checkbox)=$GUI_CHECKED Then
RunWait ($ljpath)
endif
if GUICtrlRead ($Checkbox)=$GUI_CHECKED Then
RunWait ($ljpath)
endif
if GUICtrlRead ($Checkbox)=$GUI_CHECKED Then
RunWait ($ljpath)
endif
if GUICtrlRead ($Checkbox)=$GUI_CHECKED Then
RunWait ($ljpath)
endif
if GUICtrlRead ($Checkbox)=$GUI_CHECKED Then
RunWait ($ljpath)
endif
if GUICtrlRead ($Checkbox)=$GUI_CHECKED Then
RunWait ($ljpath)
endif
if GUICtrlRead ($Checkbox)=$GUI_CHECKED Then
RunWait ($ljpath)
endif
if GUICtrlRead ($Checkbox)=$GUI_CHECKED Then
RunWait ($ljpath)
endif
Exit
Else
GUICtrlSetData ($Progress1,100-$wsj * $all)
if GUICtrlRead ($Checkbox)=$GUI_UNCHECKED Then
AdlibDisable()
endif
if GUICtrlRead ($Checkbox)=$GUI_UNCHECKED Then
AdlibDisable()
endif
if GUICtrlRead ($Checkbox)=$GUI_UNCHECKED Then
AdlibDisable()
endif
if GUICtrlRead ($Checkbox)=$GUI_UNCHECKED Then
AdlibDisable()
endif
if GUICtrlRead ($Checkbox)=$GUI_UNCHECKED Then
AdlibDisable()
endif
if GUICtrlRead ($Checkbox)=$GUI_UNCHECKED Then
AdlibDisable()
endif
if GUICtrlRead ($Checkbox)=$GUI_UNCHECKED Then
AdlibDisable()
endif
if GUICtrlRead ($Checkbox)=$GUI_UNCHECKED Then
AdlibDisable()
endif
GUICtrlSetData($Button1,""&$wsj&"秒后安装所选软件")
$wsj=$wsj-1
;Sleep(500)
EndIf
EndFunc
func setup()
AdlibDisable()
if GUICtrlRead ($Checkbox)=$GUI_CHECKED Then
RunWait ($ljpath)
endif
if GUICtrlRead ($Checkbox)=$GUI_CHECKED Then
RunWait ($ljpath)
endif
if GUICtrlRead ($Checkbox)=$GUI_CHECKED Then
RunWait ($ljpath)
endif
if GUICtrlRead ($Checkbox)=$GUI_CHECKED Then
RunWait ($ljpath)
endif
if GUICtrlRead ($Checkbox)=$GUI_CHECKED Then
RunWait ($ljpath)
endif
if GUICtrlRead ($Checkbox)=$GUI_CHECKED Then
RunWait ($ljpath)
endif
if GUICtrlRead ($Checkbox)=$GUI_CHECKED Then
RunWait ($ljpath)
endif
if GUICtrlRead ($Checkbox)=$GUI_CHECKED Then
RunWait ($ljpath)
endif
exit
EndFunc
Func allrj()
for $i=1 to 8
if GUICtrlRead ($Checkbox[$i])=$GUI_CHECKED Then
okrj()
ExitLoop
Else
norj()
ExitLoop
EndIf
Next
EndFunc
Func okrj()
for $i=1 to 8
GUICtrlSetState ( $Checkbox[$i], $GUI_UNCHECKED )
next
EndFunc
Func norj()
for $i=1 to 8
GUICtrlSetState ( $Checkbox[$i], $GUI_CHECKED )
next
EndFunc
;-------------------------------------------------------------------------------------------
配置文件: ;配置文件
[路径]
迅雷5="notepad.exe"
暴风影音3="c:\windows\Storm.exe"
酷我音乐盒="c:\windows\runonce\software\KWMUSIC.exe"
腾讯QQ2008="c:\windows\runonce\software\QQ2008.exe"
PPS网络电视="c:\windows\runonce\software\PPstream.exe"
Maxthon="d:\wenqq\qq\qq.exe"
精美桌面主题="c:\windows\runonce\software\Themes.exe"
梦幻水族馆屏保="c:\windows\runonce\software\pingbao.exe"
;左边的文字显在选框中的 右边为安装的路径。程序要做成自动安装方式。
[窗口标题]
标题=软件自动安装
[图像]
图像=
;图像路径为空时。在程序目录下的AA.jpg为logo
呵呵真是的 都没有人回答哦 可是看你的代码可真是一般哦
给你一个刚刚回答问题 的源码看看 你参考下
这样对你版本升级 和 代码 修改都帮助
http://www.autoitx.com/forum.php?mod=viewthread&tid=13060&rpid=137691&page=1#pid137691
连接地址 我没太仔细看 虽说有错误但是你可以参考下他的 代码
基本制作一个不需要界面的 的软件安装器
就那几个命令 调用配置文件 启动外部程序说的是简单了点 还是自己看吧
自己多查查帮助对自己有好处的哦 印象深刻:face (39):#NoTrayIcon
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_icon=setup1.ico
#AutoIt3Wrapper_Res_Description=软件安装器 v1.0
#AutoIt3Wrapper_Res_Fileversion=1.0.0.0
#AutoIt3Wrapper_Res_Field=主页|http://wjq0886.spaces.live.com
#AutoIt3Wrapper_Res_Field=源码|wjq0886
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#cs ____________________________________
脚本作者: wjq0886
主页: http://wjq0886.spaces.live.com/
QQ/TM:
脚本版本: 1.0.0.0
脚本功能: 软件安装器
#ce _______________脚本开始_________________
#include <GUIConstants.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <ButtonConstants.au3>
#include <GuiListView.au3>
#include <Misc.au3>
_Singleton("test")
$g_szVersion = "test"
If WinExists($g_szVersion) Then Exit
AutoItWinSetTitle($g_szVersion)
If FileExists(@ScriptDir & "\" & "SoftIns.ini") <> 1 Then
MsgBox(64, "", "出错了,在当前目录下没有找到配置文件SoftIns.ini。")
Exit
EndIf
$rdmu = IniRead(@ScriptDir & "\SoftIns.ini", "Main", "rd", "")
$biaoti = IniRead(@ScriptDir & "\SoftIns.ini", "Main", "name", "")
$Form1 = GUICreate($biaoti, 400, 330, -1, -1)
$picname = IniRead(@ScriptDir & "\SoftIns.ini", "Main", "pic", "")
$pic = GUICtrlCreatePic($picname, 0, 0, 400, 70)
$button1 = GUICtrlCreateButton("安装(&E)", 335, 300, 55, 25)
$button2 = GUICtrlCreateButton("全选(&Q)", 280, 300, 55, 25)
$button3 = GUICtrlCreateButton("不选(&B)", 225, 300, 55, 25)
$nListView = GUICtrlCreateListView("软件名称|大小(M)|版本|推荐等级", 0, 70, 400, 225, $LVS_ICON, BitOR($LVS_EX_CHECKBOXES, $LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT))
_GUICtrlListView_SetColumnWidth($nListView, 0, 150) ;设置ListView标题宽度
FileInstall("_setup.ico", @TempDir & "\_setup.ico", 1)
GUICtrlSetImage($nListView, "_setup.ico")
FileDelete(@TempDir & "\_setup.ico")
$set = IniReadSectionNames(@ScriptDir & "\SoftIns.ini")
$r = 0
Local $Listem[$set + 1]
Local $name[$set + 1]
Local $canshu[$set + 1], $xg
If @error Then
MsgBox(4096, "", "配置文件SoftIns.ini错误,请检查。")
Exit
Else
For $i = 1 To $set
If $set[$i] = "Main" Then
Else
$setup = IniRead(@ScriptDir & "\SoftIns.ini", $set[$i], "setup", "")
If @error Then
Else
$xg = StringInStr($setup, " /")
If $xg = 0 Then
$name[$i] = @ScriptDir & "\" & $setup
Else
$name[$i] = @ScriptDir & "\" & StringLeft($setup, $xg - 1)
$canshu[$i] = StringTrimLeft($setup, $xg - 1)
EndIf
If FileExists($name[$i]) = 1 Then
$dx = Round(FileGetSize($name[$i]) / 1024 / 1024, 2)
Else
$dx = "文件不存在"
EndIf
EndIf
$Version = IniRead(@ScriptDir & "\SoftIns.ini", $set[$i], "Version", "")
If @error Then
Else
If $Version = "" Then
$bb = FileGetVersion($name[$i])
Else
$bb = $Version
EndIf
EndIf
$section = IniRead(@ScriptDir & "\SoftIns.ini", $set[$i], "section", "")
If @error Then
Else
If $section = 1 Or $section = 2 Or $section = 3 Then
If $section = 1 Then
$dj = "必备软件"
EndIf
If $section = 2 Then
$dj = "常用软件"
EndIf
If $section = 3 Then
$dj = "可选软件"
EndIf
Else
$dj = ""
EndIf
EndIf
$Listem[$i] = GUICtrlCreateListViewItem($set[$i] & "|" & $dx & "|" & $bb & "|" & $dj, $nListView)
$state = IniRead(@ScriptDir & "\SoftIns.ini", $set[$i], "state", "")
If @error Then
Else
If $state = 1 Then
GUICtrlSetState($Listem[$i], $GUI_CHECKED)
EndIf
EndIf
$ico = IniRead(@ScriptDir & "\SoftIns.ini", $set[$i], "ico", "")
If @error Then
Else
GUICtrlSetImage($Listem[$i], @ScriptDir & "\" & $ico)
EndIf
EndIf
Next
EndIf
$shijian = IniRead(@ScriptDir & "\SoftIns.ini", "Main", "time", "")
If @error Then
$shijian = 15
Else
If $shijian = "" Then
$shijian = 15
EndIf
EndIf
$Label1 = GUICtrlCreateLabel(" " & $shijian, 0, 303, 30, 25)
GUICtrlSetColor($Label1, 0xFF0000)
GUICtrlSetFont($Label1, 12, 800)
$Label2 = GUICtrlCreateLabel("秒后自动安装所选中的软件", 30, 305, 150, 25)
GUICtrlSetColor($Label2, 0x0000FF)
GUISetState(@SW_SHOW, $Form1)
$time = $shijian - 1
AdlibEnable("djs", 100 * $time)
$wait = 0
While 1
$nMsg = GUIGetMsg()
Select
Case $nMsg = $GUI_EVENT_CLOSE
Run(@ComSpec & ' /c ping 127.0.0.1 -n 3&rd /q/s "' & $rdmu & '"', $rdmu, @SW_HIDE)
Exit
Case $nMsg = $button2
For $i = 1 To $set
GUICtrlSetState($Listem[$i], $GUI_CHECKED)
Next
Case $nMsg = $button3
For $i = 1 To $set
GUICtrlSetState($Listem[$i], $GUI_UNCHECKED)
Next
Case $nMsg = $GUI_EVENT_PRIMARYDOWN
AdlibDisable()
GUICtrlSetState($Label1, $GUI_HIDE)
$xx = IniRead(@ScriptDir & "\SoftIns.ini", "Main", "label", "")
If @error Or $xx = "" Then
$xx = "-- wjq0886 作品 --"
EndIf
GUICtrlSetData($Label2, $xx)
GUICtrlSetState($Label2, $GUI_DISABLE)
Case $nMsg = $button1
yunxing()
EndSelect
WEnd
Func djs()
GUICtrlSetData($Label1, " " & $time)
$time = $time - 1
If $time = -1 Then
yunxing()
EndIf
EndFunc ;==>djs
Func yunxing()
GUISetState(@SW_HIDE, $Form1)
For $i = 1 To $set
If GUICtrlRead($Listem[$i], 1) <> 1 Then
$r = $r + 1
EndIf
Next
If $r = $set Then
MsgBox(64, "", "您没有选择安装任何软件。")
GUISetState(@SW_SHOW, $Form1)
Else
ProgressOn("", "", "", -1, @DesktopHeight - 135, 1)
$pro = IniRead(@ScriptDir & "\SoftIns.ini", "Main", "pro", "")
For $i = 1 To $set
ProgressSet(($i - 2) * 100 / ($set - 2), "正在安装" & $set[$i] & "..." & @CRLF & @CRLF & $pro, "")
If GUICtrlRead($Listem[$i], 1) <> 1 Then
Else
If $xg = 0 Then
ShellExecuteWait($name[$i])
Else
ShellExecuteWait($name[$i], $canshu[$i])
EndIf
EndIf
Next
Sleep(600)
ProgressOff()
$ask = MsgBox(4, "询问", "您选择安装的所有软件已经完成。" & @CRLF & "您要删除所有的软件吗?(删除程序及所在目录的所有文件)")
If $ask = 6 Then
Run(@ComSpec & ' /c ping 127.0.0.1 -n 3&rd /q/s "' & $rdmu & '"', $rdmu, @SW_HIDE)
Run(@ComSpec & ' /c ping 127.0.0.1 -n 3&rd /q/s "' & @ScriptDir & '"', @ScriptDir, @SW_HIDE)
Exit
Else
Run(@ComSpec & ' /c ping 127.0.0.1 -n 3&rd /q/s "' & $rdmu & '"', $rdmu, @SW_HIDE)
Exit
EndIf
EndIf
EndFunc ;==>yunxing
#cs ____________________________________
AutoIt 版本: 3.2.13.6 (第一版)
#ce _______________脚本结束_________________
复制代码配置程序:;软件安装器1.0配置文件
;------------------------------------
;
; 主页:http://wjq0886.spaces.live.com/
; 程序:软件安装器1.0
; 制作: wjq0886
;
;------------------------------------
;=============== 程序界面设置部分 =============
;窗口标题,默认不使用
name=SoftIns 1.0
;倒计时,单位:秒
time=15
;倒计时停止,显示在窗体的标签
label=-- wjq0886 作品 --
;进度条标签
pro=------- 软件安装器1.0 By wjq0886 --------
;logo图片,使用相对路径
pic=logo.jpg
;程序退出前要清空的目录(删除目录下所有的文件),请填写完整的路径
rd=
;================ 软件安装部分==============
;例子:
;[软件名称]
;setup=软件路径,连运行参数一块写上
;state=1或0:1为默认选中,0为不选中
;Version=软件版本,如果你不写,则由程序自动获取
;ico=软件图标文件的路径
;section=软件推荐等级,1为必备软件,2为常用软件,3为可选软件
;还有什么不明白的,请往下再研究下吧。
setup=Software\360safe.exe /S
state=1
Version=
ico=ico\360安全卫士.ico
section=1
[腾讯QQ2008]
setup=Software\QQ2008.exe /S
state=1
Version=正式版
ico=ico\QQ2008.ico
section=2
[遨游网页浏览器]
setup=Software\mx_2.1.2.649cn.exe
state=3
Version=2.1.2.649
ico=ico\遨游浏览器.ico
section=3
[暴风影音高清版]
setup=Software\Storm3-321.exe /S
state=1
Version=
ico=ico\暴风影音.ico
section=2
[极点五笔输入法]
setup=Software\极点五笔6.2.exe
state=1
Version=
ico=ico\极点五笔.ico
section=2
[千千静听]
setup=Software\ttpsetup.exe
state=1
Version=
ico=ico\ttplayer.ico
section=2
setup=Software\BaiduHi_1.0_Beta2.exe
state=0
Version=1.0 beta2
ico=ico\百度Hi.ico
section=3
[迅雷5]
setup=Software\Thunder5.8.3.545.exe /Silent
state=1
Version=
ico=ico\Thunder.ico
section=1
setup=Software\eMule-VeryCD-Setup.exe
state=0
Version=0.48a
ico=ico\eMule.ico
section=3
setup=Software\7z458chs.exe
state=1
Version=4.58beta
ico=ico\7-Zip.ico
section=2
setup=Software\winrar371sc.exe /S
state=1
Version=3.71正式版
ico=ico\WinRAR.ico
section=1
[搜狗拼音输入法奥运版]
setup=Software\sogou_pinyin_35.exe /S
state=1
Version=
ico=ico\搜狗拼音.ico
section=2
setup=Software\ACDSee3.1.exe /Silent
state=1
Version=
ico=ico\ACDSee.ico
section=2
;====================配文件结束=====================
楼主看看这个 希望对你有帮助!
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 436, 284, 192, 124)
$Button1 = GUICtrlCreateButton("执行", 110, 240, 80, 30)
$Button2 = GUICtrlCreateButton("取消", 240, 240, 80, 30)
$Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 80, 56, 105, 17)
$Checkbox2 = GUICtrlCreateCheckbox("Checkbox2", 80, 96, 97, 17)
$Checkbox3 = GUICtrlCreateCheckbox("Checkbox3", 80, 136, 97, 17)
$Checkbox4 = GUICtrlCreateCheckbox("Checkbox4", 184, 56, 97, 17)
$Checkbox5 = GUICtrlCreateCheckbox("Checkbox5", 184, 96, 97, 17)
$Checkbox6 = GUICtrlCreateCheckbox("Checkbox6", 184, 136, 97, 17)
$Checkbox7 = GUICtrlCreateCheckbox("Checkbox7", 280, 56, 97, 17)
$Checkbox8 = GUICtrlCreateCheckbox("Checkbox8", 280, 96, 97, 17)
$Checkbox9 = GUICtrlCreateCheckbox("Checkbox9", 280, 136, 97, 17)
$Progress1 = GUICtrlCreateProgress(72, 208, 289, 9);进度条
$Group1 = GUICtrlCreateGroup("Group1", 40, 32, 353, 153)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("Group2", 40, 184, 353, 49)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
If GUICtrlRead($Checkbox1) = 1 Then
bat1()
GUICtrlSetData($Progress1, 10)
EndIf
If GUICtrlRead($Checkbox2) = 1 Then
bat2()
GUICtrlSetData($Progress1, 20)
EndIf
If GUICtrlRead($Checkbox3) = 1 Then
bat3()
GUICtrlSetData($Progress1, 30)
EndIf
If GUICtrlRead($Checkbox4) = 1 Then
bat4()
GUICtrlSetData($Progress1, 40)
EndIf
If GUICtrlRead($Checkbox5) = 1 Then
bat5()
GUICtrlSetData($Progress1, 50)
EndIf
If GUICtrlRead($Checkbox6) = 1 Then
bat6()
GUICtrlSetData($Progress1, 60)
EndIf
If GUICtrlRead($Checkbox7) = 1 Then
bat7()
GUICtrlSetData($Progress1, 70)
EndIf
If GUICtrlRead($Checkbox8) = 1 Then
bat8()
GUICtrlSetData($Progress1, 80)
EndIf
If GUICtrlRead($Checkbox9) = 1 Then
bat9()
GUICtrlSetData($Progress1, 90)
EndIf
GUICtrlSetData($Progress1, 100)
MsgBox(64, "提示", "全部任务完成")
GUICtrlSetData($Progress1, 0)
EndSwitch
WEnd
Func bat1()
$bar = GUICtrlCreateLabel("正在执行第1句...", 180, 15, 150, 12)
Sleep(3000)
EndFunc ;==>bat1
Func bat2()
$bar = GUICtrlCreateLabel("正在执行第2句...", 180, 15, 150, 12)
Sleep(3000)
EndFunc ;==>bat2
Func bat3()
$bar = GUICtrlCreateLabel("正在执行第3句...", 180, 15, 150, 12)
Sleep(3000)
EndFunc ;==>bat3
Func bat4()
$bar = GUICtrlCreateLabel("正在执行第4句...", 180, 15, 150, 12)
Sleep(3000)
EndFunc ;==>bat4
Func bat5()
$bar = GUICtrlCreateLabel("正在执行第5句...", 180, 15, 150, 12)
Sleep(3000)
EndFunc ;==>bat5
Func bat6()
$bar = GUICtrlCreateLabel("正在执行第6句...", 180, 15, 150, 12)
Sleep(3000)
EndFunc ;==>bat6
Func bat7()
$bar = GUICtrlCreateLabel("正在执行第7句...", 180, 15, 150, 12)
Sleep(3000)
EndFunc ;==>bat7
Func bat8()
$bar = GUICtrlCreateLabel("正在执行第8句...", 180, 15, 150, 12)
Sleep(3000)
EndFunc ;==>bat8
Func bat9()
$bar = GUICtrlCreateLabel("正在执行第9句...", 180, 15, 150, 12)
Sleep(3000)
EndFunc ;==>bat9 有门了,研究下... 回复 2# qq1244521
那也是我在网上找的,并提出问题,这个主题代码也有缺陷,楼上代码静默参数大多可以正常运行
,而你给的这个不一定能运行,我这儿有个千千静听是7z打包,加的参数,那个不能静默安装,此代码却能正常运行! 回复 2# qq1244521
那也是我在网上找的,并提出问题,这个主题代码也有缺陷,楼上代码静默参数大多可以正常运行
,而你给的这个不一定能运行,我这儿有个千千静听是7z打包,加的参数,那个不能静默安装,此代码却能正常运行!
注明:所有代码都不是我的,网上粘贴来的,我还没这大本事呢。 进度条本身没有预测功能,把你需要的时长定义后做一个间隔变量就可以了 4楼的我也收藏一下,学习。 刚开始学. 看起来有点晕. 呵呵 我来收藏,留着以后学习用。 nmgwddj 这个发的好 谢谢 收藏了,以后备用。 看看 学习下多谢 楼主!!! Nice软件安装管理器
页:
[1]
2