Skip to content

Commit

Permalink
docs: Add customWelcomePage example to Custom NSIS script (#7001)
Browse files Browse the repository at this point in the history
  • Loading branch information
hueyyeng authored Jul 16, 2022
1 parent c0be3e5 commit 61d8930
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions docs/configuration/nsis.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,31 +37,36 @@ Two options are available — [include](#NsisOptions-include) and [script](#Nsis
Keep in mind — if you customize NSIS script, you should always state about it in the issue reports. And don't expect that your issue will be resolved.

1. Add file `build/installer.nsh`.
2. Define wanted macro to customise: `customHeader`, `preInit`, `customInit`, `customUnInit`, `customInstall`, `customUnInstall`, `customRemoveFiles`, `customInstallMode`.
2. Define wanted macro to customise: `customHeader`, `preInit`, `customInit`, `customUnInit`, `customInstall`, `customUnInstall`, `customRemoveFiles`, `customInstallMode`, `customWelcomePage`.

!!! example
```nsis
!macro customHeader
!system "echo '' > ${BUILD_RESOURCES_DIR}/customHeader"
!macroend

!macro preInit
; This macro is inserted at the beginning of the NSIS .OnInit callback
!system "echo '' > ${BUILD_RESOURCES_DIR}/preInit"
!macroend

!macro customInit
!system "echo '' > ${BUILD_RESOURCES_DIR}/customInit"
!macroend

!macro customInstall
!system "echo '' > ${BUILD_RESOURCES_DIR}/customInstall"
!macroend

!macro customInstallMode
# set $isForceMachineInstall or $isForceCurrentInstall
# set $isForceMachineInstall or $isForceCurrentInstall
# to enforce one or the other modes.
!macroend

!macro customWelcomePage
# Welcome Page is not added by default for installer.
!insertMacro MUI_PAGE_WELCOME
!macroend
```

* `BUILD_RESOURCES_DIR` and `PROJECT_DIR` are defined.
Expand All @@ -81,7 +86,7 @@ If you want to include additional resources for use during installation, such as

??? question "Is there a way to call just when the app is installed (or uninstalled) manually and not on update?"
Use `${isUpdated}`.

```nsis
${ifNot} ${isUpdated}
# your code
Expand Down Expand Up @@ -116,7 +121,7 @@ For portable app, following environment variables are available:
??? question "How do change the default installation directory to custom?"

It is very specific requirement. Do not do if you are not sure. Add [custom macro](#custom-nsis-script):

```nsis
!macro preInit
SetRegView 64
Expand All @@ -129,9 +134,9 @@ For portable app, following environment variables are available:
```

??? question "Is it possible to made single installer that will allow configuring user/machine installation?"

Yes, you need to switch to assisted installer (not default one-click).

package.json
```json
"build": {
Expand Down

0 comments on commit 61d8930

Please sign in to comment.