我有一个自定义页面,并添加了一个进度条。现在我有两个函数来控制那个进度条。一个功能是停止一些服务,另一个是从安装位置备份一些文件。
Function myCustomPage
Var /GLOBAL progressBar
Var /GLOBAL label
!insertmacro MUI_HEADER_TEXT "Setup is preaparing to install updates" "Please wait"
nsDialogs::Create 1018
${NSD_CreateLabel} 10 15 80% 10% ""
Pop $label
${NSD_CreateProgressBar} 10 30 80% 8% ""
Pop $progressBar
${NSD_CreateTimer} BackUp_Files.Callback 10
${NSD_CreateTimer} Stop_Services.Callback 10
nsDialogs::Show
FunctionEnd
Stop_Services 回调函数
Function Stop_Services.Callback
${NSD_SetText} $label "Stopping services"
${NSD_KillTimer} Stop_Services.Callback
SendMessage $progressBar ${PBM_SETRANGE32} 0 100
SendMessage $progressBar ${PBM_SETPOS} 25 0
Sleep 100
SendMessage $progressBar ${PBM_SETPOS} 25 0
Sleep 100
SendMessage $progressBar ${PBM_SETPOS} 50 0
Sleep 100
SendMessage $progressBar ${PBM_SETPOS} 75 0
Sleep 100
SendMessage $progressBar ${PBM_SETPOS} 100 0
FuncionEnd
Backup_files.callback 具有相同的结构。结果:当我查看标签时,它会在“停止服务”和“备份文件”之间切换。谁能告诉我如何处理这个。我想先停止服务,然后再复制备份文件。停止服务后需要将进度条设置为0,然后重新启动以备份文件。我需要在单个自定义页面上执行此操作。