summaryrefslogtreecommitdiff
path: root/nt
diff options
context:
space:
mode:
authorAndrew Innes <andrewi@gnu.org>2000-08-22 21:43:12 +0000
committerAndrew Innes <andrewi@gnu.org>2000-08-22 21:43:12 +0000
commit5205d900d6011278d4dedaee60e155580614b2ed (patch)
tree1c342df8b3adc6fd1bbe14c64da8fe8557d6641c /nt
parentda179dd049809145b746ad00f4e3fc666ab6ba59 (diff)
downloademacs-5205d900d6011278d4dedaee60e155580614b2ed.tar.gz
(main): Accept /q to mean install based on addpm's
location without asking. Remove reference to emacs.bat which is now obsolete.
Diffstat (limited to 'nt')
-rw-r--r--nt/addpm.c39
1 files changed, 25 insertions, 14 deletions
diff --git a/nt/addpm.c b/nt/addpm.c
index 5a899fd625d..ef375ee1613 100644
--- a/nt/addpm.c
+++ b/nt/addpm.c
@@ -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,21 +159,24 @@ main (argc, argv)
}
/* Tell user what we are going to do. */
- {
- 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);
- }
- }
+ 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);