Announcement

Collapse
No announcement yet.

SpaceTexts inside a function

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • SpaceTexts inside a function

    Hi.
    I've rearranged my installer to slightly deviate from the "standard" model, by putting MUI_PAGE_DIRECTORY before MUI_PAGE_COMPONENTS.
    The idea is to let the user select a "base" directory for several programs, and the rest of the paths are resolved by the installer itself.
    The problem is that when selecting this "base" directory, the user has not chosen the components to install yet, so the "Space required" and "Space available" fields are meaningless yet.
    So what I want to do is to hide them at the MUI_PAGE_DIRECTORY and then show them again at MUI_PAGE_COMPONENTS.
    I saw some threads regarding that, but it seems that none of those options worked for me:
    1. using SpaceTexts none removes this text entirely - which is good, but I can't return to
    SpaceTexts at a later page because the compiler doesn't allow to use it inside a
    (MUI_PAGE_CUSTOM_FUNCTION_PRE) function.

    2. I tried doing as advised e.g. in


    FindWindow $0 "#32770" "" $HWNDPARENT
    GetDlgItem $1 $0 1023 ; 1023 = IDC_SPACEREQUIRED
    ShowWindow $1 0 ; 0 = SW_HIDE

    but that disabled the "available" text in the COMPONENTS page, changing nothing in
    the DIRECTORY page.

    Can anyone advise me how to handle this case?

    Thanks a lot,
    Simon

  • #2
    Originally Posted by SimonKolotov View Post
    FindWindow $0 "#32770" "" $HWNDPARENT
    GetDlgItem $1 $0 1023 ; 1023 = IDC_SPACEREQUIRED
    ShowWindow $1 0 ; 0 = SW_HIDE
    Try putting this in the Directory show function. It sounds like you inserted it after the directory page. It shouldn't affect the components page because internally they are separate resources.
    "Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
    NSIS 3 POSIX Ninja
    Wiki Profile

    Comment


    • #3
      You are right, I put it in the wrong SHOW function...

      How can I find the handle for the other - AvailableSpace field, to hide it too?

      Thanks

      Comment


      • #4
        Same code, but use 1024 (IDC_SPACEAVAILABLE) in GetDlgItem.
        "Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
        NSIS 3 POSIX Ninja
        Wiki Profile

        Comment

        Working...
        X
        😀
        🥰
        🤢
        😎
        😡
        👍
        👎