生成electron app.exe,它将在安装期间请求用户输入(使用electron builder和nsis)?

生成electron app.exe,它将在安装期间请求用户输入(使用electron builder和nsis)?,electron,windows-installer,nsis,electron-builder,Electron,Windows Installer,Nsis,Electron Builder,看起来一切都是对的。发布的NSIS脚本用于创建自定义页面。你的问题是什么?你是否有任何错误,或者你只是不知道该怎么做 问:安装程序中没有显示您的页面 如果否:是否在electron nsis脚本中包含了自定义页面,以便实际显示该页面 问:在创建自定义页面时,您是否遇到了麻烦 如果是:试试这个工具:(我是它的开发者,所以请随意在这里问任何问题) 很难说这几条信息有什么问题,请发布完整的脚本和日志。问题是什么?编译器错误?首先创建自定义页面显示我只想显示此页面一次,并在“选择位置”和“安装进度”页面

看起来一切都是对的。发布的NSIS脚本用于创建自定义页面。你的问题是什么?你是否有任何错误,或者你只是不知道该怎么做

问:安装程序中没有显示您的页面

如果否:是否在electron nsis脚本中包含了自定义页面,以便实际显示该页面

问:在创建自定义页面时,您是否遇到了麻烦

如果是:试试这个工具:(我是它的开发者,所以请随意在这里问任何问题)


很难说这几条信息有什么问题,请发布完整的脚本和日志。

问题是什么?编译器错误?首先创建自定义页面显示我只想显示此页面一次,并在“选择位置”和“安装进度”页面之间显示。好的,发布完整脚本。 I am trying to generate electron app.exe with the use of **electron-builder** and **nsis**, which should ask user input at time of installation. Following is my **package.json**. ... "build": { "appId": "com.electron.test", "productName": "test", "win": { "target": [ "nsis" ], "icon": "assets/icon.ico" }, "nsis": { "warningsAsErrors": false, "installerIcon": "assets/icon.ico", "runAfterFinish": false, "oneClick": false, "perMachine": true, "allowToChangeInstallationDirectory": true, "installerHeader": "assets/installerHeader.bmp", "include": "build/installer.nsh" }, "mac": { "category": "your.app.category.type" } } ... I want to display custom page **Between** Select Location Page and Installation Progress Page. Following is my **installer.nsh** which is create one custom page i.e. ask for user to input username and password.

!include "EnvVarUpdate.nsh"
!include "MUI2.nsh"
!include "nsDialogs.nsh"
!include "LogicLib.nsh"

Var Dialog
Var UserLabel
Var UserText
Var UserState
Var PassLabel
Var PassText
Var PassState

;--------------------------------
; Show install details
    ShowInstDetails show

;--------------------------------
;Interface Settings

    !define MUI_ABORTWARNING

Page custom nsDialogsPage nsDialogsPageLeave

Function nsDialogsPage

    nsDialogs::Create 1018
    Pop $Dialog

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

    ${NSD_CreateLabel} 0 0 100% 12u "Username:"
    Pop $UserLabel

    ${NSD_CreateText} 0 13u 100% 12u $UserState
    Pop $UserText

    ${NSD_CreateLabel} 0 39u 100% 12u "Password:"
    Pop $PassLabel

    ${NSD_CreatePassword} 0 52u 100% 12u $PassState
    Pop $PassText

    nsDialogs::Show

FunctionEnd

Function nsDialogsPageLeave

    ${NSD_GetText} $UserText $UserState
    ${NSD_GetText} $PassText $PassState

    ${If} $UserState == ""
        MessageBox MB_OK "Username is missing."
        Abort
    ${EndIf}

    ${If} $PassState == ""
        MessageBox MB_OK "Password is missing."
        Abort
    ${EndIf}

    StrCpy $1 $UserState
    StrCpy $2 $PassState

    FileOpen $9 $INSTDIR\credentials.txt w
    FileWrite $9 "$1:$2"
    FileClose $9
    SetFileAttributes $INSTDIR\credentials.txt HIDDEN|READONLY

FunctionEnd

Section
SectionEnd


!macro customHeader
    
!macroend

!macro preInit
    
!macroend

!macro customInstall
    ${EnvVarUpdate} $0 "PATH" "A" "HKLM" "$INSTDIR"
!macroend

!macro customUnInstall
    ${un.EnvVarUpdate} $0 "PATH" "R" "HKLM" "$INSTDIR"
!macroend
Please provide any solution. **Thanks & Regards** Rachit V. Sakhidas