Old 27th July 2017, 20:51   #1
SimonKolotov
Junior Member
 
Join Date: Jul 2017
Posts: 6
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
https://nsis-dev.github.io/NSIS-Foru...t-184574.html:

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
SimonKolotov is offline   Reply With Quote
Old 28th July 2017, 04:59   #2
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 853
Quote:
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
JasonFriday13 is offline   Reply With Quote
Old 28th July 2017, 16:48   #3
SimonKolotov
Junior Member
 
Join Date: Jul 2017
Posts: 6
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
SimonKolotov is offline   Reply With Quote
Old 29th July 2017, 04:29   #4
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 853
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
JasonFriday13 is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump