Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
fix(Windows): Define installer language before trying to access it
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
anthonybilinski committed Mar 5, 2022
1 parent 5526d13 commit 1353fc9
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 40 deletions.
39 changes: 19 additions & 20 deletions windows/qtox.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
##############
Expand Down Expand Up @@ -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
#################
Expand Down
39 changes: 19 additions & 20 deletions windows/qtox64.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
##############
Expand Down Expand Up @@ -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
#################
Expand Down

0 comments on commit 1353fc9

Please sign in to comment.