Skip to content

OnSecondInstanceLaunch not being triggered when "Launch Program" is added to finish page of NSIS installer #4959

@FunOrange

Description

@FunOrange

Description

I've added a "Launch Program" checkbox to the last step of my NSIS installer. After the app is launched, nothing happens when the custom uri scheme is invoked from a normal, non-elevated process. I've outlined what the source of this issue is below.

To Reproduce

  1. Modify wails.json to register custom protocol scheme as defined in docs (https://wails.io/docs/guides/custom-protocol-schemes/)
  2. Modify build\windows\installer\project.nsi to include the following:
!insertmacro MUI_PAGE_WELCOME # Welcome to the installer page.
# !insertmacro MUI_PAGE_LICENSE "resources\eula.txt" # Adds a EULA page to the installer
!insertmacro MUI_PAGE_DIRECTORY # In which folder install page.
!insertmacro MUI_PAGE_INSTFILES # Installing page.
!define MUI_FINISHPAGE_RUN "$INSTDIR\${PRODUCT_EXECUTABLE}"
!define MUI_FINISHPAGE_RUN_TEXT "Launch ${INFO_PRODUCTNAME}"
!insertmacro MUI_PAGE_FINISH # Finished installation page.
  1. Run wails build -nsis
  2. Run the installer
  3. Tick "Launch [program name]" checkbox
  4. Observe that app runs in Elevated mode
  5. open [urischeme]:// from a non-elevated process
  6. Observe that second app window is not created, however OnSecondInstanceLaunch is not being called in the original elevated process.

Expected behaviour

Non-elevated second process should be able to do IPC with elevated first process in order to trigger OnSecondInstanceLaunch.

Screenshots

No response

Attempted Fixes

No response

System Details

# Wails
Version | v2.11.0


# System
┌───────────────────────────────────────────────────────────────────────────────────┐
| OS           | Windows 10 Pro                                                     |
| Version      | 2009 (Build: 26200)                                                |
| ID           | 25H2                                                               |
| Branding     | Windows 11 Pro                                                     |
| Go Version   | go1.25.5                                                           |
| Platform     | windows                                                            |
| Architecture | amd64                                                              |
| CPU          | 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz                     |
| GPU 1        | Meta Virtual Monitor (Meta Inc.) - Driver: 17.12.55.198            |
| GPU 2        | NVIDIA GeForce RTX 3070 Laptop GPU (NVIDIA) - Driver: 32.0.15.9174 |
| Memory       | 64GB                                                               |
└───────────────────────────────────────────────────────────────────────────────────┘

# Dependencies
┌───────────────────────────────────────────────────────┐
| Dependency | Package Name | Status    | Version       |
| WebView2   | N/A          | Installed | 144.0.3719.93 |
| Nodejs     | N/A          | Installed | 22.14.0       |
| npm        | N/A          | Installed | 10.9.2        |
| *upx       | N/A          | Installed | upx 5.1.0     |
| *nsis      | N/A          | Installed | v3.11         |
|                                                       |
└─────────────── * - Optional Dependency ───────────────┘

# Diagnosis
 SUCCESS  Your system is ready for Wails development!

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't workingawaiting feedbackMore information is required from the requestor

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions