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

MUI_PAGE_CUSTOMFUNCTION_PRE of customPageAfterChangeDir conflict #8679

Open
Yueyanc opened this issue Nov 13, 2024 · 1 comment
Open

MUI_PAGE_CUSTOMFUNCTION_PRE of customPageAfterChangeDir conflict #8679

Yueyanc opened this issue Nov 13, 2024 · 1 comment

Comments

@Yueyanc
Copy link

Yueyanc commented Nov 13, 2024

  • Electron-Builder Version:
    24.13.3
  • Node Version:
    Does not matter
  • Electron Version:
  • Does not matter
  • Electron Type (current, beta, nightly):
  • Does not matter
  • Target:
!ifdef allowToChangeInstallationDirectory
    !include StrContains.nsh

    !insertmacro skipPageIfUpdated
    !insertmacro MUI_PAGE_DIRECTORY

    # pageDirectory leave doesn't work (it seems because $INSTDIR is set after custom leave function)
    # so, we use instfiles pre
    !define MUI_PAGE_CUSTOMFUNCTION_PRE instFilesPre

    # sanitize the MUI_PAGE_DIRECTORY result to make sure it has a application name sub-folder
    Function instFilesPre
      ${StrContains} $0 "${APP_FILENAME}" $INSTDIR
      ${If} $0 == ""
        StrCpy $INSTDIR "$INSTDIR\${APP_FILENAME}"
      ${endIf}
    FunctionEnd
  !endif

  # after change installation directory and before install start, you can show custom page here.
  !ifmacrodef customPageAfterChangeDir
    !insertmacro customPageAfterChangeDir
  !endif

  !insertmacro MUI_PAGE_INSTFILES

MUI_PAGE_CUSTOMFUNCTION_PRE cannot be defined in customPageAfterChangeDir

!macro customPageAfterChangeDir
  !define MUI_PAGE_CUSTOMFUNCTION_PRE XXXX
  !insertmacro MUI_PAGE_DIRECTORY
!macroend customPageAfterChangeDir

The error MUI_PAGE_CUSTOMFUNCTION_PRE is already defined

@Yueyanc
Copy link
Author

Yueyanc commented Nov 13, 2024

How do I ensure that customPageAfterChangeDir only appears during installation and is hidden during update

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

No branches or pull requests

1 participant