1" Vim syntax file
2" Language:             Inno Setup File (iss file) and My InnoSetup extension
3" Maintainer:           Jason Mills (jmills@cs.mun.ca)
4" Previous Maintainer:  Dominique St�phan (dominique@mggen.com)
5" Last Change:          2004 Dec 14
6"
7" Todo:
8"  - The paramter String: is matched as flag string (because of case ignore).
9"  - Pascal scripting syntax is not recognized.
10"  - Embedded double quotes confuse string matches. e.g. "asfd""asfa"
11
12" For version 5.x: Clear all syntax items
13" For version 6.x: Quit when a syntax file was already loaded
14if version < 600
15  syntax clear
16elseif exists("b:current_syntax")
17  finish
18endif
19
20" shut case off
21syn case ignore
22
23" Preprocessor
24syn region issPreProc start="^\s*#" end="$"
25
26" Section
27syn region issSection	start="\[" end="\]"
28
29" Label in the [Setup] Section
30syn match  issDirective	"^[^=]\+="
31
32" URL
33syn match  issURL	"http[s]\=:\/\/.*$"
34
35" Parameters used for any section.
36" syn match  issParam"[^: ]\+:"
37syn match  issParam	"Name:"
38syn match  issParam	"MinVersion:\|OnlyBelowVersion:\|Languages:"
39syn match  issParam	"Source:\|DestDir:\|DestName:\|CopyMode:"
40syn match  issParam	"Attribs:\|Permissions:\|FontInstall:\|Flags:"
41syn match  issParam	"FileName:\|Parameters:\|WorkingDir:\|HotKey:\|Comment:"
42syn match  issParam	"IconFilename:\|IconIndex:"
43syn match  issParam	"Section:\|Key:\|String:"
44syn match  issParam	"Root:\|SubKey:\|ValueType:\|ValueName:\|ValueData:"
45syn match  issParam	"RunOnceId:"
46syn match  issParam	"Type:\|Excludes:"
47syn match  issParam	"Components:\|Description:\|GroupDescription:\|Types:\|ExtraDiskSpaceRequired:"
48syn match  issParam	"StatusMsg:\|RunOnceId:\|Tasks:"
49syn match  issParam	"MessagesFile:\|LicenseFile:\|InfoBeforeFile:\|InfoAfterFile:"
50
51syn match  issComment	"^\s*;.*$"
52
53" folder constant
54syn match  issFolder	"{[^{]*}"
55
56" string
57syn region issString	start=+"+ end=+"+ contains=issFolder
58
59" [Dirs]
60syn keyword issDirsFlags deleteafterinstall uninsalwaysuninstall uninsneveruninstall
61
62" [Files]
63syn keyword issFilesCopyMode normal onlyifdoesntexist alwaysoverwrite alwaysskipifsameorolder dontcopy
64syn keyword issFilesAttribs readonly hidden system
65syn keyword issFilesPermissions full modify readexec
66syn keyword issFilesFlags allowunsafefiles comparetimestampalso confirmoverwrite deleteafterinstall
67syn keyword issFilesFlags dontcopy dontverifychecksum external fontisnttruetype ignoreversion 
68syn keyword issFilesFlags isreadme onlyifdestfileexists onlyifdoesntexist overwritereadonly 
69syn keyword issFilesFlags promptifolder recursesubdirs regserver regtypelib restartreplace
70syn keyword issFilesFlags sharedfile skipifsourcedoesntexist sortfilesbyextension touch 
71syn keyword issFilesFlags uninsremovereadonly uninsrestartdelete uninsneveruninstall
72syn keyword issFilesFlags replacesameversion nocompression noencryption noregerror
73
74
75" [Icons]
76syn keyword issIconsFlags closeonexit createonlyiffileexists dontcloseonexit 
77syn keyword issIconsFlags runmaximized runminimized uninsneveruninstall useapppaths
78
79" [INI]
80syn keyword issINIFlags createkeyifdoesntexist uninsdeleteentry uninsdeletesection uninsdeletesectionifempty
81
82" [Registry]
83syn keyword issRegRootKey   HKCR HKCU HKLM HKU HKCC
84syn keyword issRegValueType none string expandsz multisz dword binary
85syn keyword issRegFlags createvalueifdoesntexist deletekey deletevalue dontcreatekey 
86syn keyword issRegFlags preservestringtype noerror uninsclearvalue 
87syn keyword issRegFlags uninsdeletekey uninsdeletekeyifempty uninsdeletevalue
88
89" [Run] and [UninstallRun]
90syn keyword issRunFlags hidewizard nowait postinstall runhidden runmaximized
91syn keyword issRunFlags runminimized shellexec skipifdoesntexist skipifnotsilent 
92syn keyword issRunFlags skipifsilent unchecked waituntilidle
93
94" [Types]
95syn keyword issTypesFlags iscustom
96
97" [Components]
98syn keyword issComponentsFlags dontinheritcheck exclusive fixed restart disablenouninstallwarning
99
100" [UninstallDelete] and [InstallDelete]
101syn keyword issInstallDeleteType files filesandordirs dirifempty
102
103" [Tasks]
104syn keyword issTasksFlags checkedonce dontinheritcheck exclusive restart unchecked 
105
106
107" Define the default highlighting.
108" For version 5.7 and earlier: only when not done already
109" For version 5.8 and later: only when an item doesn't have highlighting yet
110if version >= 508 || !exists("did_iss_syntax_inits")
111  if version < 508
112    let did_iss_syntax_inits = 1
113    command -nargs=+ HiLink hi link <args>
114  else
115    command -nargs=+ HiLink hi def link <args>
116  endif
117
118   " The default methods for highlighting.  Can be overridden later
119   HiLink issSection	Special
120   HiLink issComment	Comment
121   HiLink issDirective	Type
122   HiLink issParam	Type
123   HiLink issFolder	Special
124   HiLink issString	String
125   HiLink issURL	Include
126   HiLink issPreProc	PreProc 
127
128   HiLink issDirsFlags		Keyword
129   HiLink issFilesCopyMode	Keyword
130   HiLink issFilesAttribs	Keyword
131   HiLink issFilesPermissions	Keyword
132   HiLink issFilesFlags		Keyword
133   HiLink issIconsFlags		Keyword
134   HiLink issINIFlags		Keyword
135   HiLink issRegRootKey		Keyword
136   HiLink issRegValueType	Keyword
137   HiLink issRegFlags		Keyword
138   HiLink issRunFlags		Keyword
139   HiLink issTypesFlags		Keyword
140   HiLink issComponentsFlags	Keyword
141   HiLink issInstallDeleteType	Keyword
142   HiLink issTasksFlags		Keyword
143
144  delcommand HiLink
145endif
146
147let b:current_syntax = "iss"
148
149" vim:ts=8
150