Mercurial > vim
annotate nsis/gvim.nsi @ 7456:2c5e813e8852 v7.4.1031
commit https://github.com/vim/vim/commit/3c6f92e52ef15df4aa248ce00eacd65928044210
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jan 2 20:26:36 2016 +0100
patch 7.4.1031
Problem: Can't build with Python interface using MingW.
Solution: Update the Makefile. (Yasuhiro Matsumoto)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 02 Jan 2016 20:30:04 +0100 |
parents | 357b7bd8d612 |
children | 4456fa2d22e8 |
rev | line source |
---|---|
7 | 1 # NSIS file to create a self-installing exe for Vim. |
2 # It requires NSIS version 2.0 or later. | |
6343 | 3 # Last Change: 2014 Nov 5 |
7 | 4 |
5 # WARNING: if you make changes to this script, look out for $0 to be valid, | |
6 # because uninstall deletes most files in $0. | |
7 | |
5128
3dafc80e781b
updated for version 7.3.1307
Bram Moolenaar <bram@vim.org>
parents:
2577
diff
changeset
|
8 # Location of gvim_ole.exe, vimw32.exe, GvimExt/*, etc. |
7 | 9 !define VIMSRC "..\src" |
10 | |
11 # Location of runtime files | |
12 !define VIMRT ".." | |
13 | |
14 # Location of extra tools: diff.exe | |
15 !define VIMTOOLS ..\.. | |
16 | |
17 # Comment the next line if you don't have UPX. | |
18 # Get it at http://upx.sourceforge.net | |
19 !define HAVE_UPX | |
20 | |
21 # comment the next line if you do not want to add Native Language Support | |
22 !define HAVE_NLS | |
23 | |
7443
357b7bd8d612
commit https://github.com/vim/vim/commit/6c7b44472f7055c78d996e1b626bd2932502212f
Christian Brabandt <cb@256bit.org>
parents:
6343
diff
changeset
|
24 !include gvim_version.nsh # for version number |
7 | 25 |
26 # ----------- No configurable settings below this line ----------- | |
27 | |
28 !include UpgradeDLL.nsh # for VisVim.dll | |
2217
120502692d82
Improve the MS-Windows installer.
Bram Moolenaar <bram@vim.org>
parents:
2154
diff
changeset
|
29 !include LogicLib.nsh |
120502692d82
Improve the MS-Windows installer.
Bram Moolenaar <bram@vim.org>
parents:
2154
diff
changeset
|
30 !include x64.nsh |
7 | 31 |
32 Name "Vim ${VER_MAJOR}.${VER_MINOR}" | |
33 OutFile gvim${VER_MAJOR}${VER_MINOR}.exe | |
34 CRCCheck force | |
35 SetCompressor lzma | |
36 SetDatablockOptimize on | |
2217
120502692d82
Improve the MS-Windows installer.
Bram Moolenaar <bram@vim.org>
parents:
2154
diff
changeset
|
37 RequestExecutionLevel highest |
7 | 38 |
39 ComponentText "This will install Vim ${VER_MAJOR}.${VER_MINOR} on your computer." | |
6343 | 40 DirText "Choose a directory to install Vim (should contain 'vim')" |
7 | 41 Icon icons\vim_16c.ico |
5134
b49784c49d53
updated for version 7.3.1310
Bram Moolenaar <bram@vim.org>
parents:
5128
diff
changeset
|
42 # NSIS2 uses a different strategy with six different images in a strip... |
7 | 43 #EnabledBitmap icons\enabled.bmp |
44 #DisabledBitmap icons\disabled.bmp | |
45 UninstallText "This will uninstall Vim ${VER_MAJOR}.${VER_MINOR} from your system." | |
46 UninstallIcon icons\vim_uninst_16c.ico | |
47 | |
48 # On NSIS 2 using the BGGradient causes trouble on Windows 98, in combination | |
49 # with the BringToFront. | |
50 # BGGradient 004000 008200 FFFFFF | |
51 LicenseText "You should read the following before installing:" | |
52 LicenseData ${VIMRT}\doc\uganda.nsis.txt | |
53 | |
54 !ifdef HAVE_UPX | |
55 !packhdr temp.dat "upx --best --compress-icons=1 temp.dat" | |
56 !endif | |
57 | |
5134
b49784c49d53
updated for version 7.3.1310
Bram Moolenaar <bram@vim.org>
parents:
5128
diff
changeset
|
58 SetCompressor /SOLID lzma |
b49784c49d53
updated for version 7.3.1310
Bram Moolenaar <bram@vim.org>
parents:
5128
diff
changeset
|
59 XPStyle on |
b49784c49d53
updated for version 7.3.1310
Bram Moolenaar <bram@vim.org>
parents:
5128
diff
changeset
|
60 |
7 | 61 # This adds '\vim' to the user choice automagically. The actual value is |
62 # obtained below with ReadINIStr. | |
63 InstallDir "$PROGRAMFILES\Vim" | |
64 | |
65 # Types of installs we can perform: | |
66 InstType Typical | |
67 InstType Minimal | |
68 InstType Full | |
69 | |
70 SilentInstall normal | |
71 | |
72 # These are the pages we use | |
73 Page license | |
74 Page components | |
75 Page directory "" "" CheckInstallDir | |
76 Page instfiles | |
77 UninstPage uninstConfirm | |
78 UninstPage instfiles | |
79 | |
80 ########################################################## | |
81 # Functions | |
82 | |
83 Function .onInit | |
84 MessageBox MB_YESNO|MB_ICONQUESTION \ | |
85 "This will install Vim ${VER_MAJOR}.${VER_MINOR} on your computer.$\n Continue?" \ | |
86 IDYES NoAbort | |
87 Abort ; causes installer to quit. | |
88 NoAbort: | |
89 | |
90 # run the install program to check for already installed versions | |
91 SetOutPath $TEMP | |
92 File /oname=install.exe ${VIMSRC}\installw32.exe | |
93 ExecWait "$TEMP\install.exe -uninstall-check" | |
94 Delete $TEMP\install.exe | |
95 | |
96 # We may have been put to the background when uninstall did something. | |
97 BringToFront | |
98 | |
99 # Install will have created a file for us that contains the directory where | |
100 # we should install. This is $VIM if it's set. This appears to be the only | |
101 # way to get the value of $VIM here!? | |
102 ReadINIStr $INSTDIR $TEMP\vimini.ini vimini dir | |
103 Delete $TEMP\vimini.ini | |
104 | |
105 # If ReadINIStr failed or did not find a path: use the default dir. | |
106 StrCmp $INSTDIR "" 0 IniOK | |
107 StrCpy $INSTDIR "$PROGRAMFILES\Vim" | |
108 IniOK: | |
109 | |
110 # Should check for the value of $VIM and use it. Unfortunately I don't know | |
111 # how to obtain the value of $VIM | |
112 # IfFileExists "$VIM" 0 No_Vim | |
113 # StrCpy $INSTDIR "$VIM" | |
114 # No_Vim: | |
115 | |
116 # User variables: | |
117 # $0 - holds the directory the executables are installed to | |
118 # $1 - holds the parameters to be passed to install.exe. Starts with OLE | |
119 # registration (since a non-OLE gvim will not complain, and we want to | |
120 # always register an OLE gvim). | |
121 # $2 - holds the names to create batch files for | |
122 StrCpy $0 "$INSTDIR\vim${VER_MAJOR}${VER_MINOR}" | |
123 StrCpy $1 "-register-OLE" | |
801 | 124 StrCpy $2 "gvim evim gview gvimdiff vimtutor" |
7 | 125 |
126 FunctionEnd | |
127 | |
128 Function .onUserAbort | |
129 MessageBox MB_YESNO|MB_ICONQUESTION "Abort install?" IDYES NoCancelAbort | |
130 Abort ; causes installer to not quit. | |
131 NoCancelAbort: | |
132 FunctionEnd | |
133 | |
134 # We only accept the directory if it ends in "vim". Using .onVerifyInstDir has | |
135 # the disadvantage that the browse dialog is difficult to use. | |
136 Function CheckInstallDir | |
137 FunctionEnd | |
138 | |
139 Function .onInstSuccess | |
140 WriteUninstaller vim${VER_MAJOR}${VER_MINOR}\uninstall-gui.exe | |
141 MessageBox MB_YESNO|MB_ICONQUESTION \ | |
1618 | 142 "The installation process has been successful. Happy Vimming! \ |
7 | 143 $\n$\n Do you want to see the README file now?" IDNO NoReadme |
144 Exec '$0\gvim.exe -R "$0\README.txt"' | |
145 NoReadme: | |
146 FunctionEnd | |
147 | |
148 Function .onInstFailed | |
149 MessageBox MB_OK|MB_ICONEXCLAMATION "Installation failed. Better luck next time." | |
150 FunctionEnd | |
151 | |
152 Function un.onUnInstSuccess | |
153 MessageBox MB_OK|MB_ICONINFORMATION \ | |
154 "Vim ${VER_MAJOR}.${VER_MINOR} has been (partly) removed from your system" | |
155 FunctionEnd | |
156 | |
157 Function un.GetParent | |
158 Exch $0 ; old $0 is on top of stack | |
159 Push $1 | |
160 Push $2 | |
161 StrCpy $1 -1 | |
162 loop: | |
163 StrCpy $2 $0 1 $1 | |
164 StrCmp $2 "" exit | |
165 StrCmp $2 "\" exit | |
166 IntOp $1 $1 - 1 | |
167 Goto loop | |
168 exit: | |
169 StrCpy $0 $0 $1 | |
170 Pop $2 | |
171 Pop $1 | |
172 Exch $0 ; put $0 on top of stack, restore $0 to original value | |
173 FunctionEnd | |
174 | |
175 ########################################################## | |
176 Section "Vim executables and runtime files" | |
177 SectionIn 1 2 3 | |
178 | |
179 # we need also this here if the user changes the instdir | |
180 StrCpy $0 "$INSTDIR\vim${VER_MAJOR}${VER_MINOR}" | |
181 | |
182 SetOutPath $0 | |
183 File /oname=gvim.exe ${VIMSRC}\gvim_ole.exe | |
184 File /oname=install.exe ${VIMSRC}\installw32.exe | |
185 File /oname=uninstal.exe ${VIMSRC}\uninstalw32.exe | |
186 File ${VIMSRC}\vimrun.exe | |
187 File /oname=xxd.exe ${VIMSRC}\xxdw32.exe | |
188 File ${VIMTOOLS}\diff.exe | |
189 File ${VIMRT}\vimtutor.bat | |
190 File ${VIMRT}\README.txt | |
191 File ..\uninstal.txt | |
192 File ${VIMRT}\*.vim | |
193 File ${VIMRT}\rgb.txt | |
194 | |
195 SetOutPath $0\colors | |
196 File ${VIMRT}\colors\*.* | |
197 | |
198 SetOutPath $0\compiler | |
199 File ${VIMRT}\compiler\*.* | |
200 | |
201 SetOutPath $0\doc | |
202 File ${VIMRT}\doc\*.txt | |
203 File ${VIMRT}\doc\tags | |
204 | |
205 SetOutPath $0\ftplugin | |
206 File ${VIMRT}\ftplugin\*.* | |
207 | |
208 SetOutPath $0\indent | |
209 File ${VIMRT}\indent\*.* | |
210 | |
211 SetOutPath $0\macros | |
212 File ${VIMRT}\macros\*.* | |
213 | |
214 SetOutPath $0\plugin | |
215 File ${VIMRT}\plugin\*.* | |
216 | |
801 | 217 SetOutPath $0\autoload |
218 File ${VIMRT}\autoload\*.* | |
219 | |
827 | 220 SetOutPath $0\autoload\xml |
221 File ${VIMRT}\autoload\xml\*.* | |
222 | |
7 | 223 SetOutPath $0\syntax |
224 File ${VIMRT}\syntax\*.* | |
225 | |
799 | 226 SetOutPath $0\spell |
227 File ${VIMRT}\spell\*.txt | |
228 File ${VIMRT}\spell\*.vim | |
229 File ${VIMRT}\spell\*.spl | |
230 File ${VIMRT}\spell\*.sug | |
231 | |
7 | 232 SetOutPath $0\tools |
233 File ${VIMRT}\tools\*.* | |
234 | |
235 SetOutPath $0\tutor | |
236 File ${VIMRT}\tutor\*.* | |
237 SectionEnd | |
238 | |
239 ########################################################## | |
240 Section "Vim console program (vim.exe)" | |
241 SectionIn 1 3 | |
242 | |
243 SetOutPath $0 | |
244 ReadRegStr $R0 HKLM \ | |
245 "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion | |
246 IfErrors 0 lbl_winnt | |
5128
3dafc80e781b
updated for version 7.3.1307
Bram Moolenaar <bram@vim.org>
parents:
2577
diff
changeset
|
247 # Windows 95/98/ME: not supported |
7 | 248 Goto lbl_done |
249 lbl_winnt: | |
5134
b49784c49d53
updated for version 7.3.1310
Bram Moolenaar <bram@vim.org>
parents:
5128
diff
changeset
|
250 # Windows NT/2000/XP and later |
7 | 251 File /oname=vim.exe ${VIMSRC}\vimw32.exe |
252 lbl_done: | |
253 StrCpy $2 "$2 vim view vimdiff" | |
254 SectionEnd | |
255 | |
256 ########################################################## | |
257 Section "Create .bat files for command line use" | |
258 SectionIn 3 | |
259 | |
260 StrCpy $1 "$1 -create-batfiles $2" | |
261 SectionEnd | |
262 | |
263 ########################################################## | |
264 Section "Create icons on the Desktop" | |
265 SectionIn 1 3 | |
266 | |
267 StrCpy $1 "$1 -install-icons" | |
268 SectionEnd | |
269 | |
270 ########################################################## | |
271 Section "Add Vim to the Start Menu" | |
272 SectionIn 1 3 | |
273 | |
274 StrCpy $1 "$1 -add-start-menu" | |
275 SectionEnd | |
276 | |
277 ########################################################## | |
278 Section "Add an Edit-with-Vim context menu entry" | |
279 SectionIn 1 3 | |
280 | |
281 # Be aware of this sequence of events: | |
282 # - user uninstalls Vim, gvimext.dll can't be removed (it's in use) and | |
283 # is scheduled to be removed at next reboot. | |
284 # - user installs Vim in same directory, gvimext.dll still exists. | |
285 # If we now skip installing gvimext.dll, it will disappear at the next | |
286 # reboot. Thus when copying gvimext.dll fails always schedule it to be | |
287 # installed at the next reboot. Can't use UpgradeDLL! | |
288 # We don't ask the user to reboot, the old dll will keep on working. | |
289 SetOutPath $0 | |
290 ClearErrors | |
291 SetOverwrite try | |
2217
120502692d82
Improve the MS-Windows installer.
Bram Moolenaar <bram@vim.org>
parents:
2154
diff
changeset
|
292 ${If} ${RunningX64} |
120502692d82
Improve the MS-Windows installer.
Bram Moolenaar <bram@vim.org>
parents:
2154
diff
changeset
|
293 File /oname=gvimext.dll ${VIMSRC}\GvimExt\gvimext64.dll |
120502692d82
Improve the MS-Windows installer.
Bram Moolenaar <bram@vim.org>
parents:
2154
diff
changeset
|
294 ${Else} |
120502692d82
Improve the MS-Windows installer.
Bram Moolenaar <bram@vim.org>
parents:
2154
diff
changeset
|
295 File /oname=gvimext.dll ${VIMSRC}\GvimExt\gvimext.dll |
120502692d82
Improve the MS-Windows installer.
Bram Moolenaar <bram@vim.org>
parents:
2154
diff
changeset
|
296 ${EndIf} |
7 | 297 IfErrors 0 GvimExtDone |
298 | |
299 # Can't copy gvimext.dll, create it under another name and rename it on | |
300 # next reboot. | |
301 GetTempFileName $3 $0 | |
2217
120502692d82
Improve the MS-Windows installer.
Bram Moolenaar <bram@vim.org>
parents:
2154
diff
changeset
|
302 ${If} ${RunningX64} |
120502692d82
Improve the MS-Windows installer.
Bram Moolenaar <bram@vim.org>
parents:
2154
diff
changeset
|
303 File /oname=$3 ${VIMSRC}\GvimExt\gvimext64.dll |
120502692d82
Improve the MS-Windows installer.
Bram Moolenaar <bram@vim.org>
parents:
2154
diff
changeset
|
304 ${Else} |
120502692d82
Improve the MS-Windows installer.
Bram Moolenaar <bram@vim.org>
parents:
2154
diff
changeset
|
305 File /oname=$3 ${VIMSRC}\GvimExt\gvimext.dll |
120502692d82
Improve the MS-Windows installer.
Bram Moolenaar <bram@vim.org>
parents:
2154
diff
changeset
|
306 ${EndIf} |
7 | 307 Rename /REBOOTOK $3 $0\gvimext.dll |
308 | |
309 GvimExtDone: | |
310 SetOverwrite lastused | |
311 | |
312 # We don't have a separate entry for the "Open With..." menu, assume | |
313 # the user wants either both or none. | |
314 StrCpy $1 "$1 -install-popup -install-openwith" | |
315 SectionEnd | |
316 | |
317 ########################################################## | |
318 Section "Create a _vimrc if it doesn't exist" | |
319 SectionIn 1 3 | |
320 | |
321 StrCpy $1 "$1 -create-vimrc" | |
322 SectionEnd | |
323 | |
324 ########################################################## | |
325 Section "Create plugin directories in HOME or VIM" | |
326 SectionIn 1 3 | |
327 | |
328 StrCpy $1 "$1 -create-directories home" | |
329 SectionEnd | |
330 | |
331 ########################################################## | |
332 Section "Create plugin directories in VIM" | |
333 SectionIn 3 | |
334 | |
335 StrCpy $1 "$1 -create-directories vim" | |
336 SectionEnd | |
337 | |
338 ########################################################## | |
339 Section "VisVim Extension for MS Visual Studio" | |
340 SectionIn 3 | |
341 | |
342 SetOutPath $0 | |
343 !insertmacro UpgradeDLL "${VIMSRC}\VisVim\VisVim.dll" "$0\VisVim.dll" "$0" | |
344 File ${VIMSRC}\VisVim\README_VisVim.txt | |
345 SectionEnd | |
346 | |
347 ########################################################## | |
348 !ifdef HAVE_NLS | |
349 Section "Native Language Support" | |
350 SectionIn 1 3 | |
351 | |
352 SetOutPath $0\lang | |
353 File /r ${VIMRT}\lang\*.* | |
354 SetOutPath $0\keymap | |
355 File ${VIMRT}\keymap\README.txt | |
356 File ${VIMRT}\keymap\*.vim | |
357 SetOutPath $0 | |
358 File ${VIMRT}\libintl.dll | |
359 SectionEnd | |
360 !endif | |
361 | |
362 ########################################################## | |
363 Section -call_install_exe | |
364 SetOutPath $0 | |
365 ExecWait "$0\install.exe $1" | |
366 SectionEnd | |
367 | |
368 ########################################################## | |
369 Section -post | |
370 BringToFront | |
371 SectionEnd | |
372 | |
373 ########################################################## | |
374 Section Uninstall | |
375 # Apparently $INSTDIR is set to the directory where the uninstaller is | |
376 # created. Thus the "vim61" directory is included in it. | |
377 StrCpy $0 "$INSTDIR" | |
378 | |
379 # If VisVim was installed, unregister the DLL. | |
380 IfFileExists "$0\VisVim.dll" Has_VisVim No_VisVim | |
381 Has_VisVim: | |
382 ExecWait "regsvr32.exe /u /s $0\VisVim.dll" | |
383 | |
384 No_VisVim: | |
385 | |
386 # delete the context menu entry and batch files | |
387 ExecWait "$0\uninstal.exe -nsis" | |
388 | |
389 # We may have been put to the background when uninstall did something. | |
390 BringToFront | |
391 | |
392 # ask the user if the Vim version dir must be removed | |
393 MessageBox MB_YESNO|MB_ICONQUESTION \ | |
394 "Would you like to delete $0?$\n \ | |
395 $\nIt contains the Vim executables and runtime files." IDNO NoRemoveExes | |
396 | |
397 Delete /REBOOTOK $0\*.dll | |
398 ClearErrors | |
399 # Remove everything but *.dll files. Avoids that | |
400 # a lot remains when gvimext.dll cannot be deleted. | |
879 | 401 RMDir /r $0\autoload |
7 | 402 RMDir /r $0\colors |
403 RMDir /r $0\compiler | |
404 RMDir /r $0\doc | |
405 RMDir /r $0\ftplugin | |
406 RMDir /r $0\indent | |
407 RMDir /r $0\macros | |
408 RMDir /r $0\plugin | |
879 | 409 RMDir /r $0\spell |
7 | 410 RMDir /r $0\syntax |
411 RMDir /r $0\tools | |
412 RMDir /r $0\tutor | |
413 RMDir /r $0\VisVim | |
414 RMDir /r $0\lang | |
415 RMDir /r $0\keymap | |
416 Delete $0\*.exe | |
417 Delete $0\*.bat | |
418 Delete $0\*.vim | |
419 Delete $0\*.txt | |
420 | |
421 IfErrors ErrorMess NoErrorMess | |
422 ErrorMess: | |
423 MessageBox MB_OK|MB_ICONEXCLAMATION \ | |
424 "Some files in $0 have not been deleted!$\nYou must do it manually." | |
425 NoErrorMess: | |
426 | |
427 # No error message if the "vim62" directory can't be removed, the | |
428 # gvimext.dll may still be there. | |
429 RMDir $0 | |
430 | |
431 NoRemoveExes: | |
432 # get the parent dir of the installation | |
433 Push $INSTDIR | |
434 Call un.GetParent | |
435 Pop $0 | |
436 StrCpy $1 $0 | |
437 | |
438 # if a plugin dir was created at installation ask the user to remove it | |
439 # first look in the root of the installation then in HOME | |
440 IfFileExists $1\vimfiles AskRemove 0 | |
441 ReadEnvStr $1 "HOME" | |
442 StrCmp $1 "" NoRemove 0 | |
443 | |
444 IfFileExists $1\vimfiles 0 NoRemove | |
445 | |
446 AskRemove: | |
447 MessageBox MB_YESNO|MB_ICONQUESTION \ | |
2468
7f578da7edb2
Update version.h for 7.3c -> 7.3d.
Bram Moolenaar <bram@vim.org>
parents:
2465
diff
changeset
|
448 "Remove all files in your $1\vimfiles directory?$\n \ |
2449
943280505f72
Fix that uninstaller isn't found on 64-bit Windows.
Bram Moolenaar <bram@vim.org>
parents:
2439
diff
changeset
|
449 $\nCAREFUL: If you have created something there that you want to keep, click No" IDNO Fin |
7 | 450 RMDir /r $1\vimfiles |
451 NoRemove: | |
452 | |
453 # ask the user if the Vim root dir must be removed | |
454 MessageBox MB_YESNO|MB_ICONQUESTION \ | |
455 "Would you like to remove $0?$\n \ | |
456 $\nIt contains your Vim configuration files!" IDNO NoDelete | |
457 RMDir /r $0 ; skipped if no | |
458 NoDelete: | |
459 | |
460 Fin: | |
461 Call un.onUnInstSuccess | |
462 | |
463 SectionEnd |