Try to handle Unicode mode changes after !include
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6372 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
41c993aa0b
commit
db1838e746
2 changed files with 20 additions and 14 deletions
|
@ -43,7 +43,7 @@ ${EndIf}
|
||||||
|
|
||||||
|
|
||||||
!ifndef __WIN_COM__INC
|
!ifndef __WIN_COM__INC
|
||||||
!define __WIN_COM__INC
|
!define __WIN_COM__INC ${NSIS_CHAR_SIZE}
|
||||||
!verbose push
|
!verbose push
|
||||||
!verbose 3
|
!verbose 3
|
||||||
|
|
||||||
|
@ -57,6 +57,10 @@ ${EndIf}
|
||||||
|
|
||||||
!define NSISCOMCALL "!insertmacro NSISCOMCALL "
|
!define NSISCOMCALL "!insertmacro NSISCOMCALL "
|
||||||
!macro NSISCOMCALL vtblidx decl ptr params
|
!macro NSISCOMCALL vtblidx decl ptr params
|
||||||
|
!if ${NSIS_CHAR_SIZE} <> ${__WIN_COM__INC}
|
||||||
|
; Warn if QueryInterface() for IID_IShellLink etc will return the wrong interface
|
||||||
|
!warning "NSIS_CHAR_SIZE changed, existing defines and macros might not work correctly!"
|
||||||
|
!endif
|
||||||
System::Call `${ptr}->${vtblidx}${decl}${params}`
|
System::Call `${ptr}->${vtblidx}${decl}${params}`
|
||||||
!macroend
|
!macroend
|
||||||
!define NSISCOMIFACEDECL "!insertmacro NSISCOMIFACEDECL "
|
!define NSISCOMIFACEDECL "!insertmacro NSISCOMIFACEDECL "
|
||||||
|
|
|
@ -149,21 +149,15 @@
|
||||||
# use this to make all nt > 9x
|
# use this to make all nt > 9x
|
||||||
|
|
||||||
!ifdef WINVER_NT4_OVER_W95
|
!ifdef WINVER_NT4_OVER_W95
|
||||||
!define __WINVERTMP ${WINVER_NT4}
|
!define /redef /math WINVER_NT4 ${WINVER_NT4} | ${_WINVER_VERXBIT}
|
||||||
!undef WINVER_NT4
|
|
||||||
!define /math WINVER_NT4 ${__WINVERTMP} | ${_WINVER_VERXBIT}
|
|
||||||
!undef __WINVERTMP
|
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
# some definitions from header files
|
# some definitions from header files
|
||||||
|
|
||||||
!ifdef NSIS_UNICODE
|
!define OSVERSIONINFOW_SIZE 276
|
||||||
!define OSVERSIONINFO_SIZE 276 ; OSVERSIONINFOW
|
!define OSVERSIONINFOEXW_SIZE 284
|
||||||
!define OSVERSIONINFOEX_SIZE 284 ; OSVERSIONINFOEXW
|
!define OSVERSIONINFOA_SIZE 148
|
||||||
!else
|
!define OSVERSIONINFOEXA_SIZE 156
|
||||||
!define OSVERSIONINFO_SIZE 148 ; OSVERSIONINFOA
|
|
||||||
!define OSVERSIONINFOEX_SIZE 156 ; OSVERSIONINFOEXA
|
|
||||||
!endif
|
|
||||||
!define /ifndef VER_PLATFORM_WIN32_NT 2
|
!define /ifndef VER_PLATFORM_WIN32_NT 2
|
||||||
!define /ifndef VER_NT_WORKSTATION 1
|
!define /ifndef VER_NT_WORKSTATION 1
|
||||||
|
|
||||||
|
@ -216,9 +210,17 @@
|
||||||
Push $3 ;bld
|
Push $3 ;bld
|
||||||
Push $R0 ;temp
|
Push $R0 ;temp
|
||||||
|
|
||||||
|
# a plugin call will lock the Unicode mode, it is now safe to set the struct size
|
||||||
|
!ifdef NSIS_UNICODE
|
||||||
|
!define /redef OSVERSIONINFO_SIZE ${OSVERSIONINFOW_SIZE}
|
||||||
|
!define /redef OSVERSIONINFOEX_SIZE ${OSVERSIONINFOEXW_SIZE}
|
||||||
|
!else
|
||||||
|
!define /redef OSVERSIONINFO_SIZE ${OSVERSIONINFOA_SIZE}
|
||||||
|
!define /redef OSVERSIONINFOEX_SIZE ${OSVERSIONINFOEXA_SIZE}
|
||||||
|
!endif
|
||||||
|
|
||||||
# allocate memory
|
# allocate memory
|
||||||
System::Alloc ${OSVERSIONINFOEX_SIZE}
|
System::Call '*(&i${OSVERSIONINFOEX_SIZE})p.r0'
|
||||||
Pop $0
|
|
||||||
|
|
||||||
# use OSVERSIONINFOEX
|
# use OSVERSIONINFOEX
|
||||||
!insertmacro __WinVer_Call_GetVersionEx ${OSVERSIONINFOEX_SIZE}
|
!insertmacro __WinVer_Call_GetVersionEx ${OSVERSIONINFOEX_SIZE}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue