Commit 5205d900 authored by Andrew Innes's avatar Andrew Innes
Browse files

(main): Accept /q to mean install based on addpm's

location without asking.  Remove reference to emacs.bat which is
now obsolete.
parent da179dd0
...@@ -116,16 +116,24 @@ main (argc, argv) ...@@ -116,16 +116,24 @@ main (argc, argv)
char *prog_name; char *prog_name;
char *emacs_path; char *emacs_path;
char *p; char *p;
int quiet = 0;
/* If no args specified, use our location to set emacs_path. */ /* If no args specified, use our location to set emacs_path. */
#if 0 #if 0
if (argc < 2 || argc > 3) 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); exit (1);
} }
#endif #endif
if (argc > 1 && argv[1][0] == '/' && argv[1][1] == 'q')
{
quiet = 1;
--argc;
++argv;
}
if (argc > 1) if (argc > 1)
emacs_path = argv[1]; emacs_path = argv[1];
else else
...@@ -151,21 +159,24 @@ main (argc, argv) ...@@ -151,21 +159,24 @@ main (argc, argv)
} }
/* Tell user what we are going to do. */ /* Tell user what we are going to do. */
{ if (!quiet)
int result; {
int result;
char msg[ MAX_PATH ];
sprintf (msg, "Install Emacs at %s?\n", emacs_path); char msg[ MAX_PATH ];
result = MessageBox (NULL, msg, "Install Emacs", MB_OKCANCEL | MB_ICONQUESTION); sprintf (msg, "Install Emacs at %s?\n", emacs_path);
if (result != IDOK) result = MessageBox (NULL, msg, "Install Emacs",
{ MB_OKCANCEL | MB_ICONQUESTION);
fprintf (stderr, "Install cancelled\n"); if (result != IDOK)
exit (1); {
} 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); DdeInitialize (&idDde, (PFNCALLBACK)DdeCallback, APPCMD_CLIENTONLY, 0);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment