NSIS卸载程序不支持';t运行un.onInit

NSIS卸载程序不支持';t运行un.onInit,nsis,uninstallation,uninstallstring,Nsis,Uninstallation,Uninstallstring,在我的.nsi文件中,un.onInit函数中有以下逻辑: Function un.onInit MessageBox MB_YESNO "This will uninstall. Continue?" IDYES checkRunning checkRunning: FindProcDLL::FindProc "app.exe" IntCmp $R0 1 0 notRunning MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMA

在我的.nsi文件中,
un.onInit
函数中有以下逻辑:

Function un.onInit

  MessageBox MB_YESNO "This will uninstall. Continue?" IDYES checkRunning
  checkRunning:
    FindProcDLL::FindProc "app.exe"
    IntCmp $R0 1 0 notRunning
    MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION "${PRODUCT} is running, please close it so the installation can proceed." /SD IDCANCEL IDRETRY checkRunning
    Abort

  notRunning:
    !insertmacro Init "uninstaller"
FunctionEnd
但是,永远不会显示messageBox(进程正在运行消息)。因此,我查阅了大量文档,显然运行静默模式会阻止调用此方法,因此我在.nsi文件中添加了
sileninstall normal
silentunstall normal
。然而,这也不起作用

我尝试通过手动转到uninstall.exe并运行安装程序来调用卸载程序,该安装程序检查是否已安装版本以及是否有调用:

uninst:
    ClearErrors
    ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
    ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT}" "UninstallString"
    StrCmp $R0 "" done
    Abort
然而,这两种调用都不会触发到“正常”模式。那么,如何调用我的un.onInit函数呢

编辑:
当有人要整个文件时。我只复制了相关部分,但如果需要更多,请随意查看。请注意,整个文件已经很旧了,我只是在更新它。

在升级MUI2(现代用户界面2.0)、降级到NSIS 2.5并使用插件后,我让它工作了。现在正在调用该函数,我的检查使用新插件工作。NSIS>2.46上的FindProcDLL插件已损坏,请将整个.nsi文件发布到此处。调用顺序有时会影响“本机”nsi方法。另外,“nsProcess.nsh”是我用来检查正在运行的应用程序的;我并不是说这是问题所在,但我以前没有见过用于此的
FindProcDLL
。@Killercam检查编辑我很好奇使用
un.onGUIInit
instead@idleberg我刚试过,不幸的是它也没有触发。尽管这个函数不是用来中止(afaik)的,但它是一个很好的建议。这并不能解释为什么没有messagebox!你的版本号也让我困惑,没有2.4.6。有2.46。非官方的fork有2.46.x版本,但是如果您希望这些特性出现在那里,您应该使用NSIS 3。