Skip to content

Commit

Permalink
wininst: fix install window not being in front when uninstall finishes
Browse files Browse the repository at this point in the history
A bit hacky, but the only way I found to make this work.
Move the uninstall code into onGUIInit and call BringToFront so we
create a semi finished install window before the uninstall window opens.

This results in the install window being in focus when the uninstall part
is finished.
  • Loading branch information
lazka committed Feb 5, 2019
1 parent 9dc501c commit b4e25cb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion win_installer/misc/win_installer.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Unicode true
!define QL_INSTDIR_KEY "Software\${QL_NAME}"
!define QL_INSTDIR_VALUENAME "InstDir"

!define MUI_CUSTOMFUNCTION_GUIINIT custom_gui_init
!include "MUI2.nsh"
!include "FileFunc.nsh"

Expand Down Expand Up @@ -232,7 +233,9 @@ Section "Install"
CreateShortCut "$SMPROGRAMS\${QL_NAME}\${EF_NAME}.lnk" "$EF_INST_BIN"
SectionEnd

Function .onInit
Function custom_gui_init
BringToFront

; Read the install dir and set it
Var /GLOBAL instdir_temp

Expand Down Expand Up @@ -275,6 +278,8 @@ Function .onInit
RMDir /r "$INSTDIR"
do_continue:
; the instdir shouldn't exist from here on

BringToFront
FunctionEnd

Section "Uninstall"
Expand Down

0 comments on commit b4e25cb

Please sign in to comment.