I have created an Electron app which is packaged into an NSIS installer with electron-builder.
Now I would like to add a custom text field to the installer, where the us
I've been working on the same thing recently. Here's what I did:
First, use the include option to point to a .nsh file (I'm doing this in package.json):
{
"build": {
"appId": "...",
"nsis": {
"include": "build/installer.nsh"
}
}
}
Then you can put your custom NSIS code inside that .nsh file:
!include nsDialogs.nsh
XPStyle on
Var Dialog
Page custom myCustomPage
Function myCustomPage
nsDialogs::Create 1018
Pop $Dialog
${If} $Dialog == error
Abort
${EndIf}
...
nsDialogs::Show
FunctionEnd
Section
SectionEnd
I adapted code from Mevia's question when I was creating my custom page. This will make a page that appears before the actual installation (Mevia's problem), so you should be careful where you save the input data.
I believe that using include
instead of a script
is what allows you to write code for a single page, rather than having to write the entire installer script yourself.