NSIS。在自定义脚本中使用函数的问题

问题描述 投票:0回答:1

我正在尝试使用反馈表单创建卸载程序的自定义页面。我阅读了文档(https://www.electron.build/configuration/nsis#NsisOptions-script),并使用customUnInstall宏制作了所有内容。我发现了一些与相同问题有关的问题,但未解决(https://github.com/electron-userland/electron-builder/issues/3871)。问题是使用函数。

尝试构建时返回错误:“警告6020:找到了卸载程序脚本代码,但从未使用过WriteUninstaller-不会创建任何卸载程序。错误:警告被视为错误”

有脚本代码,我用!insertmacro插入到customUnInstall脚本中:

Function un.TestFunc
    MessageBox MB_OK "HELLO"
FunctionEnd
!macro testmacro
        Var /GLOBAL Dialog
        Var /GLOBAL CheckBox

    nsDialogs::Create 1018
    Pop $Dialog

    ${NSD_CreateCheckbox} 0 25u 100% 10u "&Checkbox 1"
    Pop $CheckBox
    ${NSD_OnClick} $CheckBox un.TestFunc

        nsDialogs::Show
!macroend

有关详细信息,有一些关于使用电子生成器实用程序https://www.electron.build/configuration/nsis#NsisOptions-script创建自定义安装程序的东西>

所以,我在做什么错?如果您能帮助我,我将不胜感激。

UPD:问题2。我找到了有关自定义安装程序页面(Add custom page/field to NSIS setup created with electron-builder)的答案,但是如果我对卸载部分进行了同样的操作,则会出现相同的错误。当然,在package.json中,我包含uninstall.nsh而不是installer.nsh。

!include nsDialogs.nsh

XPStyle on

Var Dialog
Var Text

UninstPage custom un.myCustomPage

Function un.myCustomPage

    nsDialogs::Create 1018
    Pop $Dialog

    ${If} $Dialog == error
        Abort
    ${EndIf}


    ${NSD_CreateLabel} 0 15 100% 20u "We are looking forward your return!"
    Pop $Text

    nsDialogs::Show

FunctionEnd



Section
SectionEnd

我正在尝试使用反馈表单创建卸载程序的自定义页面。我阅读了文档(https://www.electron.build/configuration/nsis#NsisOptions-script),并使用customUnInstall宏制作了所有内容。 ...

function macros nsis electron-builder uninstaller
1个回答
0
投票

只需将WriteUninstaller

© www.soinside.com 2019 - 2024. All rights reserved.