Added support for daemon startup dependencies. Made synergy
dependent on NetBT, which I hope is right.
This commit is contained in:
parent
d97879b25c
commit
423dd3b718
|
@ -199,11 +199,12 @@ CAutoStart::onInstall(bool allUsers)
|
||||||
// clear error message
|
// clear error message
|
||||||
m_errorMessage = "";
|
m_errorMessage = "";
|
||||||
|
|
||||||
// install
|
// install. depend on NetBT (NetBIOS over TCP/IP).
|
||||||
try {
|
try {
|
||||||
ARCH->installDaemon(m_name.c_str(),
|
ARCH->installDaemon(m_name.c_str(),
|
||||||
m_isServer ? SERVER_DAEMON_INFO : CLIENT_DAEMON_INFO,
|
m_isServer ? SERVER_DAEMON_INFO : CLIENT_DAEMON_INFO,
|
||||||
appPath.c_str(), m_cmdLine.c_str(), allUsers);
|
appPath.c_str(), m_cmdLine.c_str(),
|
||||||
|
"NetBT\0", allUsers);
|
||||||
askOkay(m_hwnd, getString(IDS_INSTALL_TITLE),
|
askOkay(m_hwnd, getString(IDS_INSTALL_TITLE),
|
||||||
getString(allUsers ?
|
getString(allUsers ?
|
||||||
IDS_INSTALLED_SYSTEM :
|
IDS_INSTALLED_SYSTEM :
|
||||||
|
|
|
@ -178,9 +178,11 @@ CArch::installDaemon(const char* name,
|
||||||
const char* description,
|
const char* description,
|
||||||
const char* pathname,
|
const char* pathname,
|
||||||
const char* commandLine,
|
const char* commandLine,
|
||||||
|
const char* dependencies,
|
||||||
bool allUsers)
|
bool allUsers)
|
||||||
{
|
{
|
||||||
m_daemon->installDaemon(name, description, pathname, commandLine, allUsers);
|
m_daemon->installDaemon(name, description, pathname,
|
||||||
|
commandLine, dependencies, allUsers);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -80,6 +80,7 @@ public:
|
||||||
const char* description,
|
const char* description,
|
||||||
const char* pathname,
|
const char* pathname,
|
||||||
const char* commandLine,
|
const char* commandLine,
|
||||||
|
const char* dependencies,
|
||||||
bool allUsers);
|
bool allUsers);
|
||||||
virtual void uninstallDaemon(const char* name, bool allUsers);
|
virtual void uninstallDaemon(const char* name, bool allUsers);
|
||||||
virtual int daemonize(const char* name, DaemonFunc func);
|
virtual int daemonize(const char* name, DaemonFunc func);
|
||||||
|
|
|
@ -33,6 +33,7 @@ CArchDaemonNone::installDaemon(const char*,
|
||||||
const char*,
|
const char*,
|
||||||
const char*,
|
const char*,
|
||||||
const char*,
|
const char*,
|
||||||
|
const char*,
|
||||||
bool)
|
bool)
|
||||||
{
|
{
|
||||||
// do nothing
|
// do nothing
|
||||||
|
|
|
@ -36,6 +36,7 @@ public:
|
||||||
const char* description,
|
const char* description,
|
||||||
const char* pathname,
|
const char* pathname,
|
||||||
const char* commandLine,
|
const char* commandLine,
|
||||||
|
const char* dependencies,
|
||||||
bool allUsers);
|
bool allUsers);
|
||||||
virtual void uninstallDaemon(const char* name, bool allUsers);
|
virtual void uninstallDaemon(const char* name, bool allUsers);
|
||||||
virtual int daemonize(const char* name, DaemonFunc func);
|
virtual int daemonize(const char* name, DaemonFunc func);
|
||||||
|
|
|
@ -82,6 +82,7 @@ CArchDaemonWindows::installDaemon(const char* name,
|
||||||
const char* description,
|
const char* description,
|
||||||
const char* pathname,
|
const char* pathname,
|
||||||
const char* commandLine,
|
const char* commandLine,
|
||||||
|
const char* dependencies,
|
||||||
bool allUsers)
|
bool allUsers)
|
||||||
{
|
{
|
||||||
// if not for all users then use the user's autostart registry.
|
// if not for all users then use the user's autostart registry.
|
||||||
|
@ -130,7 +131,7 @@ CArchDaemonWindows::installDaemon(const char* name,
|
||||||
pathname,
|
pathname,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
dependencies,
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
if (service == NULL) {
|
if (service == NULL) {
|
||||||
|
|
|
@ -76,6 +76,7 @@ public:
|
||||||
const char* description,
|
const char* description,
|
||||||
const char* pathname,
|
const char* pathname,
|
||||||
const char* commandLine,
|
const char* commandLine,
|
||||||
|
const char* dependencies,
|
||||||
bool allUsers);
|
bool allUsers);
|
||||||
virtual void uninstallDaemon(const char* name, bool allUsers);
|
virtual void uninstallDaemon(const char* name, bool allUsers);
|
||||||
virtual int daemonize(const char* name, DaemonFunc func);
|
virtual int daemonize(const char* name, DaemonFunc func);
|
||||||
|
|
|
@ -38,13 +38,16 @@ public:
|
||||||
\c commandLine should \b not include the name of program as the
|
\c commandLine should \b not include the name of program as the
|
||||||
first argument. If \c allUsers is true then the daemon will be
|
first argument. If \c allUsers is true then the daemon will be
|
||||||
installed to start at boot time, otherwise it will be installed to
|
installed to start at boot time, otherwise it will be installed to
|
||||||
start when the current user logs in. Throws an \c XArchDaemon
|
start when the current user logs in. If \p dependencies is not NULL
|
||||||
exception on failure.
|
then it's a concatenation of NUL terminated other daemon names
|
||||||
|
followed by a NUL; the daemon will be configured to startup after
|
||||||
|
the listed daemons. Throws an \c XArchDaemon exception on failure.
|
||||||
*/
|
*/
|
||||||
virtual void installDaemon(const char* name,
|
virtual void installDaemon(const char* name,
|
||||||
const char* description,
|
const char* description,
|
||||||
const char* pathname,
|
const char* pathname,
|
||||||
const char* commandLine,
|
const char* commandLine,
|
||||||
|
const char* dependencies,
|
||||||
bool allUsers) = 0;
|
bool allUsers) = 0;
|
||||||
|
|
||||||
//! Uninstall daemon
|
//! Uninstall daemon
|
||||||
|
|
Loading…
Reference in New Issue