home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 6.0.064 < prev    next >
Encoding:
Internet Message Format  |  2001-10-31  |  10.6 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.0.064
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=ISO-8859-1
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 6.0.064 (extra)
  11. Problem:    The NSIS install script doesn't work with newer versions of NSIS.
  12.         The diff feature doesn't work when there isn't a good diff.exe on
  13.         the system.
  14. Solution:   Replace the GetParentDir instruction by a user function.
  15.         Fix a few cosmetic problems.  Use defined constants for the
  16.         version number, so that it's defined in one place only.
  17.         Only accept the install directory when it ends in "vim".
  18.         (Eduardo Fernandez)
  19.         Add a diff.exe and use it from the default _vimrc.
  20. Files:        nsis/gvim.nsi, nsis/README.txt, src/dosinst.c
  21.  
  22.  
  23. *** ../vim60.63/nsis/gvim.nsi    Tue Sep 25 21:40:44 2001
  24. --- nsis/gvim.nsi    Thu Nov  1 22:20:59 2001
  25. ***************
  26. *** 1,5 ****
  27.   # NSIS file to create a self-installing exe for Vim.
  28. ! # Last modification:    2001 Jul 21
  29.   
  30.   # WARNING: if you make changes to this script, look out for $0 to be valid,
  31.   # because this line is very dangerous:        RMDir /r $0
  32. --- 1,6 ----
  33.   # NSIS file to create a self-installing exe for Vim.
  34. ! # It needs NSIS version 1.59 or later.
  35. ! # Last modification:    2001 Oct 31
  36.   
  37.   # WARNING: if you make changes to this script, look out for $0 to be valid,
  38.   # because this line is very dangerous:        RMDir /r $0
  39. ***************
  40. *** 11,25 ****
  41.   # comment the next line if you do not want to add Native Language Support
  42.   !define HAVE_NLS
  43.   
  44. ! Name "Vim 6.0"
  45. ! OutFile gVim60.exe
  46.   CRCCheck on
  47. ! ComponentText "This will install Vim 6.0 on your computer."
  48. ! DirText "Choose a directory to install Vim (should end in 'vim')"
  49.   SetDatablockOptimize on
  50.   Icon icons\vim_16c.ico
  51. ! UninstallText "This will uninstall Vim 6.0 from your system."
  52. ! UninstallExeName vim60\uninstall-gui.exe
  53.   UninstallIcon icons\vim_uninst_16c.ico
  54.   BGGradient 004000 008200 ffffff
  55.   LicenseText "You should read the following before installing:"
  56. --- 12,29 ----
  57.   # comment the next line if you do not want to add Native Language Support
  58.   !define HAVE_NLS
  59.   
  60. ! !define VER_MINOR 0
  61. ! !define VER_MAJOR 6
  62. ! Name "Vim ${VER_MAJOR}.${VER_MINOR}"
  63. ! OutFile gvim${VER_MAJOR}${VER_MINOR}.exe
  64.   CRCCheck on
  65. ! ComponentText "This will install Vim ${VER_MAJOR}.${VER_MINOR} on your computer."
  66. ! DirText "Choose a directory to install Vim (must end in 'vim')"
  67.   SetDatablockOptimize on
  68.   Icon icons\vim_16c.ico
  69. ! UninstallText "This will uninstall Vim ${VER_MAJOR}.${VER_MINOR} from your system."
  70. ! UninstallExeName vim${VER_MAJOR}${VER_MINOR}\uninstall-gui.exe
  71.   UninstallIcon icons\vim_uninst_16c.ico
  72.   BGGradient 004000 008200 ffffff
  73.   LicenseText "You should read the following before installing:"
  74. ***************
  75. *** 28,33 ****
  76. --- 32,39 ----
  77.   !ifdef HAVE_UPX
  78.     !packhdr temp.dat "upx --best --compress-icons=1 temp.dat"
  79.   !endif
  80. + # This add '\vim' to the user choice automagically.
  81. + InstallDir "C:\vim"
  82.   
  83.   # Types of installs we can perform:
  84.   InstType Typical
  85. ***************
  86. *** 41,47 ****
  87.   
  88.   Function .onInit
  89.     MessageBox MB_YESNO|MB_ICONQUESTION \
  90. !     "This will install Vim 6.0 on your computer.$\n Continue?" IDYES NoAbort
  91.   
  92.     Abort ; causes installer to quit.
  93.     NoAbort:
  94. --- 47,54 ----
  95.   
  96.   Function .onInit
  97.     MessageBox MB_YESNO|MB_ICONQUESTION \
  98. !     "This will install Vim ${VER_MAJOR}.${VER_MINOR} on your computer.$\n Continue?" \
  99. !     IDYES NoAbort
  100.   
  101.     Abort ; causes installer to quit.
  102.     NoAbort:
  103. ***************
  104. *** 77,83 ****
  105.   # $1 - holds the parameters to be passed to install.exe.  Starts with OLE
  106.   #      registration (since a non-OLE gvim will not complain, and we want to
  107.   #      always register an OLE gvim).
  108. !   StrCpy $0 "$INSTDIR\vim60"
  109.     StrCpy $1 "-register-OLE"
  110.   
  111.   FunctionEnd
  112. --- 84,90 ----
  113.   # $1 - holds the parameters to be passed to install.exe.  Starts with OLE
  114.   #      registration (since a non-OLE gvim will not complain, and we want to
  115.   #      always register an OLE gvim).
  116. !   StrCpy $0 "$INSTDIR\vim${VER_MAJOR}${VER_MINOR}"
  117.     StrCpy $1 "-register-OLE"
  118.   
  119.   FunctionEnd
  120. ***************
  121. *** 88,98 ****
  122.     NoCancelAbort:
  123.   FunctionEnd
  124.   
  125. ! # Only enable the "Next" button if the install directory is OK.
  126.   Function .onVerifyInstDir
  127. !   StrCmp $INSTDIR $PROGRAMFILES PathBad 0
  128. !   StrCmp $INSTDIR $WINDIR PathBad PathGood
  129. !     PathBad:
  130.       Abort
  131.   
  132.     PathGood:
  133. --- 95,104 ----
  134.     NoCancelAbort:
  135.   FunctionEnd
  136.   
  137. ! # Only enable the "Install" button if the install directory ends in "vim".
  138.   Function .onVerifyInstDir
  139. !   StrCpy $0 $INSTDIR 3 -3
  140. !   StrCmp $0 "vim" PathGood
  141.       Abort
  142.   
  143.     PathGood:
  144. ***************
  145. *** 111,117 ****
  146.   FunctionEnd
  147.   
  148.   Function un.onUnInstSuccess
  149. !   MessageBox MB_OK|MB_ICONINFORMATION "Vim 6.0 has been (partly) removed from your system"
  150.   FunctionEnd
  151.   
  152.   ##########################################################
  153. --- 117,142 ----
  154.   FunctionEnd
  155.   
  156.   Function un.onUnInstSuccess
  157. !   MessageBox MB_OK|MB_ICONINFORMATION \
  158. !   "Vim ${VER_MAJOR}.${VER_MINOR} has been (partly) removed from your system"
  159. ! FunctionEnd
  160. ! Function un.GetParent 
  161. !   Exch $0 ; old $0 is on top of stack
  162. !   Push $1
  163. !   Push $2
  164. !   StrCpy $1 -1
  165. !   loop:
  166. !     StrCpy $2 $0 1 $1
  167. !     StrCmp $2 "" exit
  168. !     StrCmp $2 "\" exit
  169. !     IntOp $1 $1 - 1
  170. !   Goto loop
  171. !   exit:
  172. !     StrCpy $0 $0 $1
  173. !     Pop $2
  174. !     Pop $1
  175. !     Exch $0 ; put $0 on top of stack, restore $0 to original value
  176.   FunctionEnd
  177.   
  178.   ##########################################################
  179. ***************
  180. *** 119,125 ****
  181.   SectionIn 1,2,3
  182.   
  183.   # we need also this here if the user changes the instdir
  184. ! StrCpy $0 "$INSTDIR\vim60"
  185.   
  186.   SetOutPath $0
  187.   File ..\src\gvim.exe
  188. --- 144,150 ----
  189.   SectionIn 1,2,3
  190.   
  191.   # we need also this here if the user changes the instdir
  192. ! StrCpy $0 "$INSTDIR\vim${VER_MAJOR}${VER_MINOR}"
  193.   
  194.   SetOutPath $0
  195.   File ..\src\gvim.exe
  196. ***************
  197. *** 127,132 ****
  198. --- 152,158 ----
  199.   File ..\src\uninstal.exe
  200.   File ..\src\vimrun.exe
  201.   File ..\src\xxd\xxd.exe
  202. + File ..\..\diff.exe
  203.   File ..\vimtutor.bat
  204.   File ..\README.txt
  205.   File ..\uninstal.txt
  206. ***************
  207. *** 295,313 ****
  208.   IfErrors ErrorMess NoErrorMess
  209.     ErrorMess:
  210.       MessageBox MB_OK|MB_ICONEXCLAMATION \
  211. !       "Some files in $0 have not been deleted! You must do it manually."
  212.     NoErrorMess:
  213.   
  214.   NoRemoveExes:
  215.   
  216. ! GetParentDir $0 $INSTDIR
  217.   
  218.   # if a plugin dir was created at installation ask the user to remove it
  219. ! IfFileExists $0\vimfiles 0 NoRemove
  220.       MessageBox MB_YESNO|MB_ICONQUESTION \
  221. !       "Remove all files in your $0\vimfiles directory? \
  222.         $\nIf you have created something there that you want to keep, click No" IDNO Fin
  223. !     RMDir /r $0\vimfiles
  224.     NoRemove:
  225.   
  226.   # ask the user if the Vim root dir must be removed
  227. --- 321,351 ----
  228.   IfErrors ErrorMess NoErrorMess
  229.     ErrorMess:
  230.       MessageBox MB_OK|MB_ICONEXCLAMATION \
  231. !       "Some files in $0 have not been deleted!$\nYou must do it manually."
  232.     NoErrorMess:
  233.   
  234.   NoRemoveExes:
  235.   
  236. ! # get the parent dir of the installation
  237. ! Push $INSTDIR
  238. ! Call un.GetParent
  239. ! Pop $0
  240. ! StrCpy $1 $0
  241.   
  242.   # if a plugin dir was created at installation ask the user to remove it
  243. ! # first look in the root of the installation then in HOME
  244. ! IfFileExists $1\vimfiles AskRemove 0
  245. !     ReadEnvStr $1 "HOME"
  246. !     StrCmp $1 "" NoRemove 0
  247. !   
  248. !     IfFileExists $1\vimfiles 0 NoRemove
  249. !   
  250. !   AskRemove:
  251.       MessageBox MB_YESNO|MB_ICONQUESTION \
  252. !       "Remove all files in your $1\vimfiles directory? \
  253.         $\nIf you have created something there that you want to keep, click No" IDNO Fin
  254. !     RMDir /r $1\vimfiles
  255.     NoRemove:
  256.   
  257.   # ask the user if the Vim root dir must be removed
  258. *** ../vim60.63/nsis/README.txt    Sat Sep 15 23:34:07 2001
  259. --- nsis/README.txt    Thu Nov  1 22:23:45 2001
  260. ***************
  261. *** 26,32 ****
  262.   5.  Go to the OleVim directory and build OpenWithVim.exe and SendToVim.exe (or
  263.       get them from a binary archive).
  264.   
  265. ! 6.  Do "make uganda.nsis.txt" in runtime/doc.  This requires sed, you may have
  266.       to do this on Unix.  Make sure the file is in DOS file format!
  267.   
  268.   Install NSIS if you didn't do that already.
  269. --- 26,37 ----
  270.   5.  Go to the OleVim directory and build OpenWithVim.exe and SendToVim.exe (or
  271.       get them from a binary archive).
  272.   
  273. ! 6.  Get a "diff.exe" program and put it in the "../.." directory (above the
  274. !     "vim60" directory, it's the same for all Vim versions).
  275. !     You can find one in previous Vim versions or in this archive:
  276. !         http://www.mossbayeng.com/~ron/vim/diffutils.tar.gz
  277. ! 7.  Do "make uganda.nsis.txt" in runtime/doc.  This requires sed, you may have
  278.       to do this on Unix.  Make sure the file is in DOS file format!
  279.   
  280.   Install NSIS if you didn't do that already.
  281. *** ../vim60.63/src/dosinst.c    Mon Aug 27 17:16:45 2001
  282. --- src/dosinst.c    Thu Nov  1 22:41:43 2001
  283. ***************
  284. *** 1047,1053 ****
  285.       static void
  286.   install_vimrc(int idx)
  287.   {
  288. !     FILE    *fd;
  289.       char    *fname;
  290.   
  291.       /* If an old vimrc file exists, overwrite it.
  292. --- 1047,1053 ----
  293.       static void
  294.   install_vimrc(int idx)
  295.   {
  296. !     FILE    *fd, *tfd;
  297.       char    *fname;
  298.   
  299.       /* If an old vimrc file exists, overwrite it.
  300. ***************
  301. *** 1092,1097 ****
  302. --- 1092,1111 ----
  303.       case mouse_mswin:
  304.               fprintf(fd, "behave mswin\n");
  305.               break;
  306. +     }
  307. +     if ((tfd = fopen("diff.exe", "r")) != NULL)
  308. +     {
  309. +     /* Use the diff.exe that comes with the self-extracting gvim.exe. */
  310. +     fclose(tfd);
  311. +     fprintf(fd, "\n");
  312. +     fprintf(fd, "set diffexpr=MyDiff()\n");
  313. +     fprintf(fd, "function MyDiff()\n");
  314. +     fprintf(fd, "  let opt = ''\n");
  315. +     fprintf(fd, "  if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif\n");
  316. +     fprintf(fd, "  if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif\n");
  317. +     fprintf(fd, "  silent execute '!%s\\diff -a ' . opt . v:fname_in . ' ' . v:fname_new . ' > ' . v:fname_out\n", installdir);
  318. +     fprintf(fd, "endfunction\n");
  319. +     fprintf(fd, "\n");
  320.       }
  321.       fclose(fd);
  322.       printf("%s has been written\n", fname);
  323. *** ../vim60.63/src/version.c    Thu Nov  1 21:26:45 2001
  324. --- src/version.c    Thu Nov  1 22:47:02 2001
  325. ***************
  326. *** 608,609 ****
  327. --- 608,611 ----
  328.   {   /* Add new patch number below this line */
  329. + /**/
  330. +     64,
  331.   /**/
  332.  
  333. -- 
  334. OLD WOMAN: Well, how did you become king, then?
  335. ARTHUR: The Lady of the Lake, her arm clad in the purest shimmering samite,
  336.         held Excalibur aloft from the bosom of the water to signify by Divine
  337.         Providence ...  that I, Arthur, was to carry Excalibur ...  That is
  338.         why I am your king!
  339.                  "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
  340.  
  341.  ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
  342. (((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
  343.  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///
  344.