Browse Source

fix(Windows): Define installer language before trying to access it

LangString UninstLogMissing statement was accessing LANG_ENGLISH before it was
defined by the MUI_LANGUAGE macro. It caused a warning, but still defaulted to
English.
reviewable/pr6515/r7
Anthony Bilinski 4 years ago
parent
commit
1353fc934e
No known key found for this signature in database
GPG Key ID: 2AA8E0DA1B31FB3C
  1. 39
      windows/qtox.nsi
  2. 39
      windows/qtox64.nsi

39
windows/qtox.nsi

@ -32,6 +32,9 @@ VIAddVersionKey "FileVersion" "${VERSION}" @@ -32,6 +32,9 @@ VIAddVersionKey "FileVersion" "${VERSION}"
##############
#DEFINE MACROS
##############
;Set the name of the uninstall log
!define UninstLog "uninstall.log"
Var UninstLog
;AddItem macro
!macro AddItem Path
@ -149,26 +152,6 @@ VIAddVersionKey "FileVersion" "${VERSION}" @@ -149,26 +152,6 @@ VIAddVersionKey "FileVersion" "${VERSION}"
!macroend
!define RestoreFiles "!insertmacro RestoreFiles"
###################
#PREPARE UNINST LOG
###################
;Set the name of the uninstall log
!define UninstLog "uninstall.log"
Var UninstLog
;Uninstall log file missing.
LangString UninstLogMissing ${LANG_ENGLISH} "${UninstLog} not found!$\r$\nUninstallation cannot proceed!"
Section -openlogfile
CreateDirectory "$INSTDIR"
IfFileExists "$INSTDIR\${UninstLog}" +3
FileOpen $UninstLog "$INSTDIR\${UninstLog}" w
Goto +4
SetFileAttributes "$INSTDIR\${UninstLog}" NORMAL
FileOpen $UninstLog "$INSTDIR\${UninstLog}" a
FileSeek $UninstLog 0 END
SectionEnd
##############
#MODERN UI
##############
@ -216,6 +199,22 @@ FunctionEnd @@ -216,6 +199,22 @@ FunctionEnd
!insertmacro MUI_LANGUAGE "English"
###################
#PREPARE UNINST LOG
###################
;Uninstall log file missing.
LangString UninstLogMissing ${LANG_ENGLISH} "${UninstLog} not found!$\r$\nUninstallation cannot proceed!"
Section -openlogfile
CreateDirectory "$INSTDIR"
IfFileExists "$INSTDIR\${UninstLog}" +3
FileOpen $UninstLog "$INSTDIR\${UninstLog}" w
Goto +4
SetFileAttributes "$INSTDIR\${UninstLog}" NORMAL
FileOpen $UninstLog "$INSTDIR\${UninstLog}" a
FileSeek $UninstLog 0 END
SectionEnd
#################
#INSTALL
#################

39
windows/qtox64.nsi

@ -32,6 +32,9 @@ VIAddVersionKey "FileVersion" "${VERSION}" @@ -32,6 +32,9 @@ VIAddVersionKey "FileVersion" "${VERSION}"
##############
#DEFINE MACROS
##############
;Set the name of the uninstall log
!define UninstLog "uninstall.log"
Var UninstLog
;AddItem macro
!macro AddItem Path
@ -149,26 +152,6 @@ VIAddVersionKey "FileVersion" "${VERSION}" @@ -149,26 +152,6 @@ VIAddVersionKey "FileVersion" "${VERSION}"
!macroend
!define RestoreFiles "!insertmacro RestoreFiles"
###################
#PREPARE UNINST LOG
###################
;Set the name of the uninstall log
!define UninstLog "uninstall.log"
Var UninstLog
;Uninstall log file missing.
LangString UninstLogMissing ${LANG_ENGLISH} "${UninstLog} not found!$\r$\nUninstallation cannot proceed!"
Section -openlogfile
CreateDirectory "$INSTDIR"
IfFileExists "$INSTDIR\${UninstLog}" +3
FileOpen $UninstLog "$INSTDIR\${UninstLog}" w
Goto +4
SetFileAttributes "$INSTDIR\${UninstLog}" NORMAL
FileOpen $UninstLog "$INSTDIR\${UninstLog}" a
FileSeek $UninstLog 0 END
SectionEnd
##############
#MODERN UI
##############
@ -216,6 +199,22 @@ FunctionEnd @@ -216,6 +199,22 @@ FunctionEnd
!insertmacro MUI_LANGUAGE "English"
###################
#PREPARE UNINST LOG
###################
;Uninstall log file missing.
LangString UninstLogMissing ${LANG_ENGLISH} "${UninstLog} not found!$\r$\nUninstallation cannot proceed!"
Section -openlogfile
CreateDirectory "$INSTDIR"
IfFileExists "$INSTDIR\${UninstLog}" +3
FileOpen $UninstLog "$INSTDIR\${UninstLog}" w
Goto +4
SetFileAttributes "$INSTDIR\${UninstLog}" NORMAL
FileOpen $UninstLog "$INSTDIR\${UninstLog}" a
FileSeek $UninstLog 0 END
SectionEnd
#################
#INSTALL
#################

Loading…
Cancel
Save