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

StartApp doesn't work when use nsis boringInstaller #1412

Closed
BitANT-Moon opened this issue Mar 28, 2017 · 1 comment
Closed

StartApp doesn't work when use nsis boringInstaller #1412

BitANT-Moon opened this issue Mar 28, 2017 · 1 comment

Comments

@BitANT-Moon
Copy link

  • Version: ^16.4..2
  • Target: nsis

In "boringInstaller.nsh" line 9

    Function StartApp
        ${if} ${Updated}
            ${StdUtils.ExecShellAsUser} $0 "$SMPROGRAMS\${PRODUCT_FILENAME}.lnk" "open" "--updated"
        ${else}
            ${StdUtils.ExecShellAsUser} $0 "$SMPROGRAMS\${PRODUCT_FILENAME}.lnk" "open" ""
        ${endif}
    FunctionEnd

In "common.nsh" line 41

  !ifdef MENU_FILENAME
    StrCpy $startMenuLink "$SMPROGRAMS\${MENU_FILENAME}\${PRODUCT_FILENAME}.lnk"
  !else
    StrCpy $startMenuLink "$SMPROGRAMS\${PRODUCT_FILENAME}.lnk"
  !endif

This means if define MENU_FILENAME(nsis.menuCategory = true) the link will not be found, and app doesn't run after finish install.
My solution is:

  1. use "$startMenuLink" replace with "$SMPROGRAMS${PRODUCT_FILENAME}.lnk" in
    "boringInstaller.nsh"
  2. move startMenuLink's declare statement below '!include "allowOnlyOneInstallerInstance.nsh"'

boringInstaller.nsh line 9

    Function StartApp
        ${if} ${Updated}
            ${StdUtils.ExecShellAsUser} $0 "$startMenuLink" "open" "--updated"
            # ${StdUtils.ExecShellAsUser} $0 "$SMPROGRAMS\${PRODUCT_FILENAME}.lnk" "open" "--updated"
        ${else}
            ${StdUtils.ExecShellAsUser} $0 "$startMenuLink" "open" ""
            # ${StdUtils.ExecShellAsUser} $0 "$SMPROGRAMS\${PRODUCT_FILENAME}.lnk" "open" ""
        ${endif}
    FunctionEnd

installer.nsi line 3

!include "allowOnlyOneInstallerInstance.nsh"

Var startMenuLink
Var desktopLink
@develar
Copy link
Member

develar commented Mar 28, 2017

You are hero. Thanks a lot for fixing #1151.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants