use new artificial functions to remove the need to declare usage of functions from the header files and to remove the unnecessary differentiation between install and uninstall functions

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5782 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2008-11-21 01:12:22 +00:00
parent 7c1a3aa639
commit dffc61dd63
5 changed files with 4346 additions and 5480 deletions

View file

@ -10,13 +10,6 @@ Include header:
\c !include "FileFunc.nsh"
Include function "GetFileExt" for install and "GetParent" for uninstall:
\c !insertmacro GetFileExt
\c !insertmacro un.GetParent
Call functions:
\c Section Install
@ -25,7 +18,7 @@ Call functions:
\c SectionEnd
\c Section un.Install
\c ${un.GetParent} "C:\My Downloads\Index.html" $R0
\c ${GetParent} "C:\My Downloads\Index.html" $R0
\c ; $R0="C:\My Downloads"
\c SectionEnd
@ -868,7 +861,6 @@ Call functions:
\c !include "WinMessages.nsh"
\c !include "FileFunc.nsh"
\c !insertmacro Locate
\c
\c Section
\c Banner::show /NOUNLOAD "Starting..."
@ -896,7 +888,6 @@ Call functions:
\\<b\\>Example (\W{http://nsis.sourceforge.net/Nxs_plug-in}{NxS plugin}):\\</b\\>
\c !include "FileFunc.nsh"
\c !insertmacro Locate
\c
\c Section
\c nxs::Show /NOUNLOAD `$(^Name) Setup`\
@ -972,13 +963,6 @@ Include header:
\c !include "TextFunc.nsh"
Include function "LineRead" for install and "TrimNewLines" for uninstall:
\c !insertmacro LineRead
\c !insertmacro un.TrimNewLines
Call functions:
\c Section Install
@ -987,7 +971,7 @@ Call functions:
\c SectionEnd
\c Section un.Install
\c ${un.TrimNewLines} "Last line$\r$\n" $R0
\c ${TrimNewLines} "Last line$\r$\n" $R0
\c ; $R0="Last line"
\c SectionEnd
@ -1105,7 +1089,6 @@ Call functions:
\\<b\\>Example5 (replace in file with count of changes - "WordFunc.nsh" required):\\</b\\>
\c !include "WordFunc.nsh"
\c !insertmacro WordReplace
\c
\c Section
\c StrCpy $R0 0
@ -1648,13 +1631,6 @@ Include header:
\c !include "WordFunc.nsh"
Include function "WordFind" for install and "WordReplace" for uninstall:
\c !insertmacro WordFind
\c !insertmacro un.WordReplace
Call functions:
\c Section Install
@ -1663,7 +1639,7 @@ Call functions:
\c SectionEnd
\c Section un.Install
\c ${un.WordReplace} "A--H---S" "-" "x" "+3*" $R0
\c ${WordReplace} "A--H---S" "-" "x" "+3*" $R0
\c ; $R0="A--HxS"
\c SectionEnd

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -30,6 +30,27 @@
!macroend
!define CallArtificialFunction `!insertmacro CallArtificialFunction`
# for usage of artificial functions inside artificial functions
# macro recursion is prohibited
!macro CallArtificialFunction2 NAME
!ifndef __UNINSTALL__
!define CallArtificialFunction2_TYPE inst
!else
!define CallArtificialFunction2_TYPE uninst
!endif
Call :.${NAME}${CallArtificialFunction2_TYPE}
!ifndef ${NAME}${CallArtificialFunction2_TYPE}_DEFINED
Goto ${NAME}${CallArtificialFunction2_TYPE}_DONE
!define ${NAME}${CallArtificialFunction2_TYPE}_DEFINED
.${NAME}${CallArtificialFunction2_TYPE}:
!insertmacro ${NAME}
Return
${NAME}${CallArtificialFunction2_TYPE}_DONE:
!endif
!undef CallArtificialFunction2_TYPE
!macroend
!define CallArtificialFunction2 `!insertmacro CallArtificialFunction2`
!endif # !___UTIL__NSH___
!verbose pop

File diff suppressed because it is too large Load diff