extract CallArtificialFunction to Util.nsh
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5780 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
8e06903fc9
commit
7c1a3aa639
3 changed files with 37 additions and 19 deletions
|
@ -11,6 +11,7 @@ includes = Split("""
|
|||
StrFunc.nsh
|
||||
TextFunc.nsh
|
||||
UpgradeDLL.nsh
|
||||
Util.nsh
|
||||
VB6RunTime.nsh
|
||||
WinMessages.nsh
|
||||
WinVer.nsh
|
||||
|
|
35
Include/Util.nsh
Normal file
35
Include/Util.nsh
Normal file
|
@ -0,0 +1,35 @@
|
|||
; ---------------------
|
||||
; Util.nsh
|
||||
; ---------------------
|
||||
;
|
||||
; Voodoo macros to make end-user usage easier. This may be documented someday.
|
||||
|
||||
!verbose push
|
||||
!verbose 3
|
||||
|
||||
!ifndef ___UTIL__NSH___
|
||||
!define ___UTIL__NSH___
|
||||
|
||||
# see WinVer.nsh and *Func.nsh for usage examples
|
||||
!macro CallArtificialFunction NAME
|
||||
!ifndef __UNINSTALL__
|
||||
!define CallArtificialFunction_TYPE inst
|
||||
!else
|
||||
!define CallArtificialFunction_TYPE uninst
|
||||
!endif
|
||||
Call :.${NAME}${CallArtificialFunction_TYPE}
|
||||
!ifndef ${NAME}${CallArtificialFunction_TYPE}_DEFINED
|
||||
Goto ${NAME}${CallArtificialFunction_TYPE}_DONE
|
||||
!define ${NAME}${CallArtificialFunction_TYPE}_DEFINED
|
||||
.${NAME}${CallArtificialFunction_TYPE}:
|
||||
!insertmacro ${NAME}
|
||||
Return
|
||||
${NAME}${CallArtificialFunction_TYPE}_DONE:
|
||||
!endif
|
||||
!undef CallArtificialFunction_TYPE
|
||||
!macroend
|
||||
!define CallArtificialFunction `!insertmacro CallArtificialFunction`
|
||||
|
||||
!endif # !___UTIL__NSH___
|
||||
|
||||
!verbose pop
|
|
@ -83,6 +83,7 @@
|
|||
!define ___WINVER__NSH___
|
||||
|
||||
!include LogicLib.nsh
|
||||
!include Util.nsh
|
||||
|
||||
!define WINVER_95 0x400
|
||||
!define WINVER_98 0x40A ;4.10
|
||||
|
@ -94,25 +95,6 @@
|
|||
!define WINVER_2003 0x502
|
||||
!define WINVER_VISTA 0x600
|
||||
|
||||
!macro CallArtificialFunction NAME
|
||||
!ifndef __UNINSTALL__
|
||||
!define CallArtificialFunction_TYPE inst
|
||||
!else
|
||||
!define CallArtificialFunction_TYPE uninst
|
||||
!endif
|
||||
Call :.${NAME}${CallArtificialFunction_TYPE}
|
||||
!ifndef ${NAME}${CallArtificialFunction_TYPE}_DEFINED
|
||||
Goto ${NAME}${CallArtificialFunction_TYPE}_DONE
|
||||
!define ${NAME}${CallArtificialFunction_TYPE}_DEFINED
|
||||
.${NAME}${CallArtificialFunction_TYPE}:
|
||||
!insertmacro ${NAME}
|
||||
Return
|
||||
${NAME}${CallArtificialFunction_TYPE}_DONE:
|
||||
!endif
|
||||
!undef CallArtificialFunction_TYPE
|
||||
!macroend
|
||||
!define CallArtificialFunction `!insertmacro CallArtificialFunction`
|
||||
|
||||
!macro __GetWinVer
|
||||
!insertmacro _LOGICLIB_TEMP
|
||||
System::Call kernel32::GetVersion()i.s
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue