]> granicus.if.org Git - vim/commitdiff
Found a way to make the MS-Windows installer wait for the uninstaller to
authorBram Moolenaar <Bram@vim.org>
Tue, 25 May 2010 19:02:00 +0000 (21:02 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 25 May 2010 19:02:00 +0000 (21:02 +0200)
finish, no need for the user to press Enter.

runtime/doc/options.txt
runtime/doc/quotes.txt
runtime/doc/todo.txt
runtime/evim.vim
src/Make_ivc.mak
src/Make_mvc.mak
src/dosinst.c

index 1b8bea73e81c31f590e690ef59729e6421c60490..8c8006c8d0f324c45b22b041d50814f2122eec5e 100644 (file)
@@ -7226,7 +7226,7 @@ A jump table for the options with a short description can be found at |Q_op|.
                        {not in Vi}
                        {only when compiled with the +persistent_undo feature}
        List of directory names for undo files, separated with commas.
-       See |'backupdir'| for the format.
+       See |'backupdir'| for details of the format.
        "." means using the directory of the file.  The undo file name for
        "file.txt" is ".file.txt.un~".
        For other directories the file name is the full path of the edited
@@ -7246,9 +7246,9 @@ A jump table for the options with a short description can be found at |Q_op|.
        When on, Vim automatically saves undo history to an undo file when
        writing a buffer to a file, and restores undo history from the same
        file on buffer read.
-       The name of the undo file is specified by 'undodir'.
-       See |undo-persistence|.
-       WARNING: this is a very new feature.  Use at your own risc!
+       The directory where the undo file is stored is specified by 'undodir'.
+       For more information about this feature see |undo-persistence|.
+       WARNING: this is a very new feature.  Use at your own risk!
 
                                                *'undolevels'* *'ul'*
 'undolevels' 'ul'      number  (default 100, 1000 for Unix, VMS,
index 67ea2b042b9cebfb8f3ca5afe24926d6f3bb1bc8..92085eb4ea3a84dd3ffc8dc1420eb07ff01bd715 100644 (file)
@@ -211,7 +211,7 @@ I cannot believe how great it is to use VIM.  I think the guys at work are
 getting tired of hearing me bragging about it.  Others eyes are lighting up.
 (Rick Croote)
 
-Emacs takes way too much time to start up and run, it is to big and bulky for
+Emacs takes way too much time to start up and run, it is too big and bulky for
 effective use and the interface is more confusing than it is of any help.  VIM
 however is short, it is fast, it is powerful, it has a good interface and it
 is all purpose.  (Paal Ditlefsen Ekran)
index cb808e5ea2a3629e18ac188376de6d1ccbe55a7f..ba5a50348f6da05d5f9a82c966235076afd05bd4 100644 (file)
@@ -1085,14 +1085,17 @@ restored. (Luc St-Louis)
 
 Vim 7.3:
 - Win32 DOS and Win32 console version: test69 fails.
+- Win32 binary: vim -r fails. (Antonio Colombo)  Also on Unix.
 - using NSIS 2.46: install on Windows 7 works, but no "Edit with Vim" menu.
    Ron's version: http://dev.ronware.org/p/vim/finfo?name=gvim.nsi
 - When running uninstall program from NSIS via install.exe, still need to
-  ask confirmation in console window, uninstaller doesn't wait.  Is there an
-  NSIS option to wait?
+  ask confirmation in console window, uninstaller doesn't wait.
+  Wait until the uninstaller is deleted -> doesn't work when cancelling
+  Wait until window is gone with EnumWindows (see os_win32.c).
 Patches to include:
 - Persistent undo bugs / fixes:
     - Add undofile(name): get undo file name for buffer "name".
+    - When there is no undo info (undolevels negative), delete the undo file.
 - Extend test62 for gettabvar() and settabvar(). (Yegappan Lakshmanan, 2010
   May 23)
 - Also crypt the undo file.
@@ -1163,6 +1166,7 @@ Needs some work:
   Includes changes for omnicompletion.
   Needs some more testing.
   Update 2010 Apr 20, patch by Andy Kittner, May 16
+  Build the MS-Windows version with Python 2.6.5 and 3.1.2?
 -   Easier/standard way to disable default plugins.
 -   ":{range}source": source the lines from the current file.
        You can already yank lines and use :@" to execute them.
index 754729048ebc595bf3cbd77237fc9c309339f28f..650ce428d630fbd041c26b36677eabb5d834cf67 100644 (file)
@@ -15,15 +15,15 @@ set insertmode
 set hidden
 
 " Make cursor keys ignore wrapping
-inoremap <Down> <C-R>=pumvisible() ? "\<lt>Down>" : "\<lt>C-O>gj"<CR>
-inoremap <Up> <C-R>=pumvisible() ? "\<lt>Up>" : "\<lt>C-O>gk"<CR>
+inoremap <silent> <Down> <C-R>=pumvisible() ? "\<lt>Down>" : "\<lt>C-O>gj"<CR>
+inoremap <silent> <Up> <C-R>=pumvisible() ? "\<lt>Up>" : "\<lt>C-O>gk"<CR>
 
 " CTRL-F does Find dialog instead of page forward
-noremap <C-F> :promptfind<CR>
-vnoremap <C-F> y:promptfind <C-R>"<CR>
-onoremap <C-F> <C-C>:promptfind<CR>
-inoremap <C-F> <C-O>:promptfind<CR>
-cnoremap <C-F> <C-C>:promptfind<CR>
+noremap <silent> <C-F> :promptfind<CR>
+vnoremap <silent> <C-F> y:promptfind <C-R>"<CR>
+onoremap <silent> <C-F> <C-C>:promptfind<CR>
+inoremap <silent> <C-F> <C-O>:promptfind<CR>
+cnoremap <silent> <C-F> <C-C>:promptfind<CR>
 
 
 set backspace=2                " allow backspacing over everything in insert mode
index 1b06affae3bae7ae71201a916ed94063761c9c1d..c2979d5cf125394444541b82017f5891aa8fee5b 100644 (file)
@@ -288,7 +288,7 @@ CLEAN :
 
 
 install.exe: dosinst.c
-       $(CPP) /Fe$@ /nologo /W3 -DNDEBUG -DWIN32 dosinst.c kernel32.lib shell32.lib ole32.lib advapi32.lib uuid.lib
+       $(CPP) /Fe$@ /nologo /W3 -DNDEBUG -DWIN32 dosinst.c kernel32.lib shell32.lib user32.lib ole32.lib advapi32.lib uuid.lib
 
 uninstal.exe: uninstal.c
        $(CPP) /nologo /W3 -DNDEBUG -DWIN32 uninstal.c shell32.lib advapi32.lib
index 8a4e5adc0e93a3d9153b9bb8bfe5dd465e95720a..695d352e7347ccebadf4cffd81b2a6d582720412 100644 (file)
@@ -830,7 +830,7 @@ $(OUTDIR):
 
 install.exe: dosinst.c
        $(CC) /nologo -DNDEBUG -DWIN32 dosinst.c kernel32.lib shell32.lib \
-               ole32.lib advapi32.lib uuid.lib
+               user32.lib ole32.lib advapi32.lib uuid.lib
        - if exist install.exe del install.exe
        ren dosinst.exe install.exe
 
index 4c09f9617f0cafa195fa8e4c7c373327ebde5324..54944a55198d09d9115d534705f656c4cbc171b2 100644 (file)
@@ -446,6 +446,25 @@ get_vim_env(void)
     }
 }
 
+static int num_windows;
+
+/*
+ * Callback used for EnumWindows():
+ * Count the window if the title looks like it is for the uninstaller.
+ */
+/*ARGSUSED*/
+    static BOOL CALLBACK
+window_cb(HWND hwnd, LPARAM lparam)
+{
+    char title[256];
+
+    title[0] = 0;
+    GetWindowText(hwnd, title, 256);
+    if (strstr(title, "Vim ") != NULL && strstr(title, "Uninstall:") != NULL)
+       ++num_windows;
+    return TRUE;
+}
+
 /*
  * Check for already installed Vims.
  * Return non-zero when found one.
@@ -543,26 +562,51 @@ uninstall_check(int skip_question)
                                             &orig_num_keys, NULL, NULL, NULL,
                                                      NULL, NULL, NULL, NULL);
 
-#if 0 /* let the uninstall program delete the key */
-                       /* Delete the uninstall key.  It has no subkeys, so
-                        * this is easy.  Do this before uninstalling, that
-                        * may try to delete the key as well. */
-                       RegDeleteKey(key_handle, subkey_name_buff);
-#endif
-
                        /* Find existing .bat files before deleting them. */
                        find_bat_exe(TRUE);
 
                        /* Execute the uninstall program.  Put it in double
                         * quotes if there is an embedded space. */
-                       if (strchr(temp_string_buffer, ' ') != NULL)
                        {
                            char buf[BUFSIZE];
 
-                           strcpy(buf, temp_string_buffer);
-                           sprintf(temp_string_buffer, "\"%s\"", buf);
+                           if (strchr(temp_string_buffer, ' ') != NULL)
+                               sprintf(buf, "\"%s\"", temp_string_buffer);
+                           else
+                               strcpy(buf, temp_string_buffer);
+                           run_command(buf);
                        }
-                       run_command(temp_string_buffer);
+
+                       /* Count the number of windows with a title that match
+                        * the installer, so that we can check when it's done.
+                        * The uninstaller copies itself, executes the copy
+                        * and exits, thus we can't wait for the process to
+                        * finish. */
+                       Sleep(1000);  /* wait for uninstaller to start up */
+                       num_windows = 0;
+                       EnumWindows(window_cb, 0);
+                       Sleep(1000);  /* wait for windows to be counted */
+                       if (num_windows == 0)
+                       {
+                           /* Did not find the uninstaller, ask user to press
+                            * Enter when done. Just in case. */
+                           printf("Press Enter when the uninstaller is finished\n");
+                           rewind(stdin);
+                           (void)getchar();
+                       }
+                       else
+                       {
+                           printf("Waiting for the uninstaller to finish (press CTRL-C to abort).");
+                           do
+                           {
+                               printf(".");
+                               fflush(stdout);
+                               num_windows = 0;
+                               EnumWindows(window_cb, 0);
+                               Sleep(1000);  /* wait for windows to be counted */
+                           } while (num_windows > 0);
+                       }
+                       printf("\nDone!\n");
 
                        /* Check if an uninstall reg key was deleted.
                         * if it was, we want to decrement key_index.
@@ -2393,16 +2437,9 @@ main(int argc, char **argv)
        get_vim_env();
 
        /* When nothing found exit quietly.  If something found wait for
-        * hitting Enter.
-        * We would like to exit without hitting Enter, but the uninstaller
-        * detaches itself, thus we get here before it's finished. */
+        * a little while, so that the user can read the messages. */
        if (i)
-       {
-           printf("\n");
-           printf("When the uninstall program is finished, press Enter to continue\n");
-           rewind(stdin);
-           (void)getchar();
-       }
+           Sleep(3000);
        exit(0);
     }
 #endif