I have an uninstaller created in NSIS.
It has 3 pages (1 custom page (Confirm), the macro MUI_UNPAGE_INSTFILES
and another custom page (Finish)).
My problem is that I'm unable to hide the 'Back' button in the "INSTFILES" page. I have tried various things to hide it, but it simply stays there in disabled state.
This is the code that I'm using to hide the Back button:
GetDlgItem $1 $HWNDPARENT 3
ShowWindow $1 ${SW_HIDE}
Above code works fine for Next and Cancel button when used with ID 1 and 2.
I have tried the above code in various places
Code:
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE un.InstShow
UninstPage custom un.UninstConfirm_Show
!define MUI_PAGE_CUSTOMFUNCTION_PRE un.InstShow
!define MUI_PAGE_CUSTOMFUNCTION_SHOW un.InstShow
!insertmacro MUI_UNPAGE_INSTFILES
UninstPage custom un.UninstFinish_Show
un.InstShow
has the logic to hide the button.
Any help would be appreciated. I have spent close to 4-5 hours on this with no luck.
This is how the screen looks now (Note that I have hidden Next and Cancel buttons in the image, to illustrate that hiding those buttons are working fine for me) :
GetDlgItem $1 $HWNDPARENT 3
ShowWindow $1 ${SW_HIDE}
This code is perfectly correct and working fine (tested).
I think there is some other code which shows the button again.
Eg in scenario when you hide the button in LEAVE function of page X, the following page may show the button again. This happens often in regular UI.
The solution is to check all your custom pages and also the standard pages for any operations regarding this button.
The internal page flag PF_BACK_SHOW in NSIS is set for all pages except the first page, you have to hack your way around it.
If the InstFiles page is the last page or if you don't want the back button on the pages after then you can move the button:
Section -un.Main
GetDlgItem $1 $hwndParent 3
System::Call USER32::MoveWindow(pr1,i-9,i-9,i1,i1,i1)
SectionEnd
If you only want to hide it on the InstFiles page but not on the pages after then you must use a timer and call ShowWindow
in the timer callback.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.