|
![]() |
#1 |
Junior Member
Join Date: Apr 2010
Posts: 29
|
MUI_HWND not recognised
Hello,
I am trying to hide the 'RUN' checkbox on the finishpage on a condition. Using the following function: PHP Code:
PHP Code:
PHP Code:
The function is called and the condition is true, but $R9 is always 0 Am I missing something? |
![]() |
![]() |
![]() |
#2 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
If you're using MUI2 there's no longer a MUI_HWND variable. Instead you want $mui.FinishPage (or for the check boxes; $mui.FinishPage.Run or $mui.FinishPage.ShowReadme).
Stu |
![]() |
![]() |
![]() |
#3 |
Junior Member
Join Date: Apr 2010
Posts: 29
|
I am using MUI 1
PHP Code:
|
![]() |
![]() |
![]() |
#4 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Switch to MUI2?
Stu |
![]() |
![]() |
![]() |
#5 |
Junior Member
Join Date: Apr 2010
Posts: 29
|
Same problem.
Johan |
![]() |
![]() |
![]() |
#6 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
In which case you must be using the variables before they are defined in the script.
Stu |
![]() |
![]() |
![]() |
#7 |
Junior Member
Join Date: Apr 2010
Posts: 29
|
I don't think so.
I include the NSIS .nsh files before I include my own .nsh files. The function 'HideCheckbox' is in a seperate .nsh file that's included after the MUI.nsh I don't have to define the $MUI_HWND variable in my script? Johan |
![]() |
![]() |
![]() |
#8 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
The MUI_HWND variable is defined when you !insertmacro MUI_PAGE_WELCOME or !insertmacro MUI_PAGE_FINISH. You cannot reference it before. And seriously, unless you are using InstallOptions in your installer, you should switch to MUI2. It uses nsDialogs for its custom pages which is a lot faster than InstallOptions (and has less overhead).
Stu |
![]() |
![]() |
![]() |
#9 |
Junior Member
Join Date: Apr 2010
Posts: 29
|
Switched to MUI2.
Changed $MUI_HWND to $mui.FinishPage.Run Getting warning: PHP Code:
Order of includes and pages: PHP Code:
Johan |
![]() |
![]() |
![]() |
#10 |
Major Dude
Join Date: Oct 2006
Posts: 1,892
|
Then you're probably including your Install_Functions.nsh before you're inserting the page macros.
|
![]() |
![]() |
![]() |
#11 |
Junior Member
Join Date: Apr 2010
Posts: 29
|
Had to split my 'Install_Functions.nsh' into 2 files.
Moved the split off part to a position after the Finish_Page definition. Then it works. I am not happy to have include files on more than 1 place in the code. ![]() It's getting to be a mess. (I have just under 200 include files, and the .NSI alone is over 15.000 lines) B.T.W. Are there rules where to place certain parts of code? The help isn't clear about that. We want to have equal call grouped together: First all constants Second all variables Next all includes (Split into NSIS internal, Project specific, Custom pages) Next all page definitions Finally _PRE, _SHOW and _LEAVE functions Johan |
![]() |
![]() |
![]() |
#12 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
There are no rules, (except for the order of MUI macro/defines for example) it's just a matter of getting it right so that it builds OK. However I would always place functions after page definitions (and sometimes after sections too). How about moving your page definitions to another include?
Stu |
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|