Skip to content
⌘ NSIS Forum Archive

Finish page doesn't close

15 posts

dexeux#

Finish page doesn't close

When i press the finish button multiple times, in the mui finish page, the text in the window disappears but the window stays. Pressing finish after this happens does nothing.

.
Anders#
Originally Posted by dexeux View Post
When i press the finish button multiple times, in the mui finish page, the text in the window disappears but the window stays. Pressing finish after this happens does nothing.
And do you really think this is enough information for us to go on?

How about some more details!

It looks like Windows 8 but I don't know for sure.

There are two MUI versions, which one are you using? And the NSIS version?

Please post a minimal example script that reproduces the problem...
dexeux#
Sorry,
I'm using MUI2 in NSIS 3.0rc1 with Windows 8.1

Here are the includes within the installer
include LogicLib.nsh 
!include nsDialogs.nsh .
!include MUI2.nsh
!include InstallOptions.nsh
!include Memento.nsh
!include WinVer.nsh
!include WordFunc.nsh
!include FileFunc.nsh
!include UAC.nsh ;v0.2.4c
!include Library.nsh
!include x64.nsh
;!include LogicLib.nsh
!include nsProcess.nsh ;v1.6
!include nsResize.nsh ;v1.0.0.0 Used to resize the install window

Idk if this helps

!define MUI_PAGE_CUSTOMFUNCTION_SHOW FinishPage_Show
!insertmacro MUI_PAGE_FINISH

Function FinishPage_Show
${nsResize_FinishPage} ${AddWidth} 10u
FunctionEnd
dexeux#
I think this occurs when you click the run after install radio button on the intstallers finish page.
Anders#
You are using several 3rd-party headers and plugins, remove/comment out things until the problem goes away...
dexeux#
I ran some tests and it seems to occur due to the sheer amount of files within the installer. When I remove a large portion of the files from the install section the bug no longer occurs.
Removing the files makes the installer go from 92->10mb.
Anders#
Originally Posted by dexeux View Post
I ran some tests and it seems to occur due to the sheer amount of files within the installer. When I remove a large portion of the files from the install section the bug no longer occurs.
Removing the files makes the installer go from 92->10mb.
That does not sound right, the number of files should not really matter.

This works fine for me on Windows 8:
OutFile test.exe
Name "Finish page tester"
RequestExecutionLevel user
!include MUI2.nsh
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_LANGUAGE "English"
Section "Dummy Files"
InitPluginsDir
SetOutPath $PluginsDir
File "$%WinDir%\System32\s*.dll" ; ~50MiB on Windows 8
SetOutPath $Temp
SectionEnd 
dexeux#
Yes you are right it. I tested a dummy installer with a 1g file and it worked fine. I have the problem narrowed down to 2 different commands.
dexeux#
Is it possible that commands place in .onInstSuccess are holding up the application from closing when the finish button is pressed? Ie I added sleep 10000 and this is reproduced.

edit: nvm
dexeux#
I moved the function that is running on


!define MUI_FINISHPAGE_RUN
!define MUI_FINISHPAGE_RUN_FUNCTION LaunchApplication
to happen in .oninstSuccess and the problem dissapears.
dexeux#
Function LaunchApplication
!insertmacro UAC_AsUser_Call function LaunchApplicationAsUser ${UAC_SYNCREGISTERS}
FunctionEnd

Function LaunchApplicationAsUser
!insertmacro UAC_AsUser_ExecShell "" "$INSTDIR\${APPLICATION_EXECUTABLE}" "" "" "SW_SHOWMAXIMIZED"
FunctionEnd
I tried once just calling the second function but it doesn't change anything.
Anders#
You certainly don't want to call UAC_AsUser_ExecShell from something started by UAC_AsUser_Call!

This sound like a bug in the plug-in and not in NSIS. Unfortunately I don't have time to work on that plug-in so I suggest that you look for other solutions...
dexeux#
Yes it looks like using

!define MUI_FINISHPAGE_RUN "$INSTDIR\${APPLICATION_EXECUTABLE}"
Does not get this problem.

Calling the function to launch directly within the "launchapplication" using the uac macro does bring the problem though.
dexeux#
Alright I found a quick solution to stopping the MUI_FINISHPAGE_RUN function from being able to be launched multiple times.

I added this within the Finish.nsh page right after
Function "${LEAVE}"
This disables the button from being pressed multiple times:


EnableWindow $mui.Button.Next 0