Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/database/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
NSIS。强制退出安装程序_Nsis - Fatal编程技术网

NSIS。强制退出安装程序

NSIS。强制退出安装程序,nsis,Nsis,我定义了自定义中止函数并想退出其中的安装程序 !define MUI_ABORTWARNING !define MUI_CUSTOMFUNCTION_ABORT customOnUserAbort Function customOnUserAbort Quit (or Abort) #no matter FunctionEnd 此外,我还有一个自定义页面,在MyCustomLeave(离开页面时)功能中,在后台执行长寿命过程 当我点击右上角的交叉按钮时,会调用customOnUser

我定义了自定义中止函数并想退出其中的安装程序

!define MUI_ABORTWARNING
!define MUI_CUSTOMFUNCTION_ABORT customOnUserAbort

Function customOnUserAbort
    Quit (or Abort) #no matter
FunctionEnd
此外,我还有一个自定义页面,在
MyCustomLeave
(离开页面时)功能中,在后台执行长寿命过程

当我点击右上角的交叉按钮时,会调用
customOnUserBort
函数,并打开一个新的透明灰色窗口,但安装程序不会退出,直到workerfunc完成

如何强制退出安装程序?或者如何禁用红十字按钮? 请帮帮我


谢谢。

为什么您要向我们展示所有我们不需要知道的ListView内容,而不展示如何使用workerfunc?请提供一个小的例子,充分再现问题…它不在乎什么功能。。。我问您为什么安装程序不能立即停止。它不能立即停止,因为您调用了一个名为CallAndWait的函数。BgWorker插件不是设计用于休假功能的。您不应该在离开页面回调中执行需要很长时间的操作…请给我一个建议如何做会更好
Function MyCustomLeave
    ShowWindow $UnderTopLabel 0
    ShowWindow $UnderTopLabel2 1

    EnableWindow $CustomNext.Button 0

    EnableWindow $RADIO1 0
    EnableWindow $RADIO_LABEL1 0
    EnableWindow $RADIO2 0
    EnableWindow $RADIO_LABEL2 0
    ShowWindow $GROUP1 ${SW_HIDE}

    ${NSD_LV_GetCheckState} $GROUP1 $unpackIndex $Checkbox_StateUnpackIndex

    ${NSD_LV_GetCheckState} $GROUP1 $hpIndex $Checkbox_StateSetUpHomepage
     ${if} $Checkbox_StateSetUpHomepage == 1
        StrCpy $ChangeHomepage 1
     ${else}
        StrCpy $ChangeHomepage 0
     ${endif}

    ${NSD_LV_GetCheckState} $GROUP1 $searchIndex $Checkbox_StateSetUpSearch
     ${if} $Checkbox_StateSetUpSearch == 1
        StrCpy $ChangeSearch 1
     ${else}
        StrCpy $ChangeSearch 0
     ${endif}

    ${NSD_LV_GetCheckState} $GROUP1 $ntIndex $Checkbox_StateSetUpNewTabPage
     ${if} $Checkbox_StateSetUpNewTabPage == 1
        StrCpy $ChangeNewTabPage 1
     ${else}
        StrCpy $ChangeNewTabPage 0
     ${endif}

     /*CUSTOM_PAGE_SOFT_3*/

    Call ValidateCheckedExtraSoft

    GetFunctionAddress $0 **workerfunc**
    BgWorker::CallAndWait #in background
FunctionEnd