Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Add customWelcomePage example to Custom NSIS script #7001

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
mmaietta marked this conversation as resolved.
Show resolved Hide resolved
```

* `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