]> code.delx.au - gnu-emacs/blobdiff - nt/addpm.c
*** empty log message ***
[gnu-emacs] / nt / addpm.c
index 40e57826e43269682ef2247bf61966dc5810a36a..b9f741bf43a7c40ad9da5aa85404d0a5f089598d 100644 (file)
@@ -54,8 +54,8 @@ static struct entry
 env_vars[] = 
 {
   {"emacs_dir", NULL},
-  {"EMACSLOADPATH", "%emacs_dir%/site-lisp;%emacs_dir%/lisp"},
-  {"SHELL", "%emacs_dir/bin/cmdproxy.exe%"},
+  {"EMACSLOADPATH", "%emacs_dir%/site-lisp;%emacs_dir%/../site-lisp;%emacs_dir%/lisp;%emacs_dir%/leim"},
+  {"SHELL", "%emacs_dir%/bin/cmdproxy.exe"},
   {"EMACSDATA", "%emacs_dir%/etc"},
   {"EMACSPATH", "%emacs_dir%/bin"},
   {"EMACSLOCKDIR", "%emacs_dir%/lock"},
@@ -116,16 +116,24 @@ main (argc, argv)
   char *prog_name;
   char *emacs_path;
   char *p;
+  int quiet = 0;
 
   /* If no args specified, use our location to set emacs_path.  */
 #if 0
   if (argc < 2 || argc > 3)
     {
-      fprintf (stderr, "usage: addpm emacs_path [icon_path]\n");
+      fprintf (stderr, "usage: addpm [/q] [emacs_path [icon_path]]\n");
       exit (1);
     }
 #endif
 
+  if (argc > 1 && argv[1][0] == '/' && argv[1][1] == 'q')
+    {
+      quiet = 1;
+      --argc;
+      ++argv;
+    }
+
   if (argc > 1)
     emacs_path = argv[1];
   else
@@ -151,18 +159,24 @@ main (argc, argv)
        }
 
       /* Tell user what we are going to do.  */
-      {
-       char msg[ MAX_PATH ];
-       sprintf (msg, "Install Emacs at %s?\n", emacs_path);
-       if (!MessageBox (NULL, msg, "Install Emacs", MB_OKCANCEL | MB_ICONQUESTION))
-         {
-           fprintf (stderr, "Install cancelled\n");
-           exit (1);
-         }
-      }
+      if (!quiet)
+       {
+         int result;
+
+         char msg[ MAX_PATH ];
+         sprintf (msg, "Install Emacs at %s?\n", emacs_path);
+         result = MessageBox (NULL, msg, "Install Emacs",
+                              MB_OKCANCEL | MB_ICONQUESTION);
+         if (result != IDOK)
+           {
+             fprintf (stderr, "Install cancelled\n");
+             exit (1);
+           }
+       }
     }
 
-  prog_name = add_registry (emacs_path) ? "runemacs.exe" : "emacs.bat";
+  add_registry (emacs_path);
+  prog_name =  "runemacs.exe";
 
   DdeInitialize (&idDde, (PFNCALLBACK)DdeCallback, APPCMD_CLIENTONLY, 0);