aboutsummaryrefslogtreecommitdiff
path: root/Src/installer/winamp/utils/sectionDescription.nsh
blob: f50d790964dc26119f56700bea8ba5cb60c3f6b9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
!ifndef NULLSOFT_WINAMP_INSTALLER_SECTION_DESCRIPTION_HEADER
!define NULLSOFT_WINAMP_INSTALLER_SECTION_DESCRIPTION_HEADER

!macro GetSectionDescription __sectionIndex __outputVar
	Push "${__sectionIndex}"
	!ifndef __UNINSTALL__
		Call GetSectionDescription
	!else
		Call un.GetSectionDescription
	!endif
	Pop ${__outputVar}
!macroend

!define GetSectionDescription "!insertmacro 'GetSectionDescription'"

!macro InstallSectionDescriptionBegin
	Function GetSectionDescription
		Exch $0
!macroend

!macro UninstallSectionDescriptionBegin
	Function un.GetSectionDescription
		Exch $0
!macroend

!macro SectionDescription __sectionIndex __sectionDescription
	!verbose push
	!verbose 4
	StrCmp $0 ${__sectionIndex} 0 +3
		StrCpy $0 "${__sectionDescription}"
		!ifndef __UNINSTALL__
			Goto getsectiondescription_end
		!else
			Goto ungetsectiondescription_end
		!endif
	!verbose pop
!macroend

!macro SectionDescriptionEnd
		StrCpy $0 ""
		!ifndef __UNINSTALL__
			Goto getsectiondescription_end
		!else
			Goto ungetsectiondescription_end
		!endif
		!ifndef __UNINSTALL__
			getsectiondescription_end:
		!else
			ungetsectiondescription_end:
		!endif
		Exch $0
	FunctionEnd
!macroend

!macro WALANG_DESCRIPTION LANGID NSIS_LANGID
	!ifdef "LANG_USE_${LANGID}" | LANG_USE_ALL
		!insertmacro SectionDescription ${IDX_SEC_${LANGID}} "${LANGFILE_${NSIS_LANGID}_NAME}"
	!endif
!macroend

!macro DESCRIPTION __sectionIndex __descriptionText
	!ifdef ${__sectionIndex}
		!verbose push
		!verbose 2
		!insertmacro SectionDescription ${${__sectionIndex}} "${__descriptionText}"
		!verbose pop
	!endif
!macroend

!define DESCRIPTION "!insertmacro 'DESCRIPTION'"
!define WALANG_DESCRIPTION "!insertmacro 'WALANG_DESCRIPTION'"
!define INSTALL_DESCRIPTION_TABLE_BEGIN "!insertmacro 'InstallSectionDescriptionBegin'"
!define UNINSTALL_DESCRIPTION_TABLE_BEGIN "!insertmacro 'UninstallSectionDescriptionBegin'"
!define DESCRIPTION_TABLE_END "!insertmacro 'SectionDescriptionEnd'"

!endif ;NULLSOFT_WINAMP_INSTALLER_SECTION_DESCRIPTION_HEADER