diff --git a/cmd/launcher/CAutoStart.cpp b/cmd/launcher/CAutoStart.cpp index 66fb3fd0..9a6cc4a1 100644 --- a/cmd/launcher/CAutoStart.cpp +++ b/cmd/launcher/CAutoStart.cpp @@ -199,11 +199,12 @@ CAutoStart::onInstall(bool allUsers) // clear error message m_errorMessage = ""; - // install + // install. depend on NetBT (NetBIOS over TCP/IP). try { ARCH->installDaemon(m_name.c_str(), 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), getString(allUsers ? IDS_INSTALLED_SYSTEM : diff --git a/lib/arch/CArch.cpp b/lib/arch/CArch.cpp index a0cb5d34..70b52236 100644 --- a/lib/arch/CArch.cpp +++ b/lib/arch/CArch.cpp @@ -178,9 +178,11 @@ CArch::installDaemon(const char* name, const char* description, const char* pathname, const char* commandLine, + const char* dependencies, bool allUsers) { - m_daemon->installDaemon(name, description, pathname, commandLine, allUsers); + m_daemon->installDaemon(name, description, pathname, + commandLine, dependencies, allUsers); } void diff --git a/lib/arch/CArch.h b/lib/arch/CArch.h index 07e91097..d7940955 100644 --- a/lib/arch/CArch.h +++ b/lib/arch/CArch.h @@ -80,6 +80,7 @@ public: const char* description, const char* pathname, const char* commandLine, + const char* dependencies, bool allUsers); virtual void uninstallDaemon(const char* name, bool allUsers); virtual int daemonize(const char* name, DaemonFunc func); diff --git a/lib/arch/CArchDaemonNone.cpp b/lib/arch/CArchDaemonNone.cpp index 35a58236..f4d25ae1 100644 --- a/lib/arch/CArchDaemonNone.cpp +++ b/lib/arch/CArchDaemonNone.cpp @@ -33,6 +33,7 @@ CArchDaemonNone::installDaemon(const char*, const char*, const char*, const char*, + const char*, bool) { // do nothing diff --git a/lib/arch/CArchDaemonNone.h b/lib/arch/CArchDaemonNone.h index 5b540607..1c196c5d 100644 --- a/lib/arch/CArchDaemonNone.h +++ b/lib/arch/CArchDaemonNone.h @@ -36,6 +36,7 @@ public: const char* description, const char* pathname, const char* commandLine, + const char* dependencies, bool allUsers); virtual void uninstallDaemon(const char* name, bool allUsers); virtual int daemonize(const char* name, DaemonFunc func); diff --git a/lib/arch/CArchDaemonWindows.cpp b/lib/arch/CArchDaemonWindows.cpp index 7e1d76a3..cd88659e 100644 --- a/lib/arch/CArchDaemonWindows.cpp +++ b/lib/arch/CArchDaemonWindows.cpp @@ -82,6 +82,7 @@ CArchDaemonWindows::installDaemon(const char* name, const char* description, const char* pathname, const char* commandLine, + const char* dependencies, bool allUsers) { // if not for all users then use the user's autostart registry. @@ -130,7 +131,7 @@ CArchDaemonWindows::installDaemon(const char* name, pathname, NULL, NULL, - NULL, + dependencies, NULL, NULL); if (service == NULL) { diff --git a/lib/arch/CArchDaemonWindows.h b/lib/arch/CArchDaemonWindows.h index 4fa31bc4..ed09fab9 100644 --- a/lib/arch/CArchDaemonWindows.h +++ b/lib/arch/CArchDaemonWindows.h @@ -76,6 +76,7 @@ public: const char* description, const char* pathname, const char* commandLine, + const char* dependencies, bool allUsers); virtual void uninstallDaemon(const char* name, bool allUsers); virtual int daemonize(const char* name, DaemonFunc func); diff --git a/lib/arch/IArchDaemon.h b/lib/arch/IArchDaemon.h index ce04eb43..ba6b049b 100644 --- a/lib/arch/IArchDaemon.h +++ b/lib/arch/IArchDaemon.h @@ -38,13 +38,16 @@ public: \c commandLine should \b not include the name of program as the first argument. If \c allUsers is true then the daemon will be installed to start at boot time, otherwise it will be installed to - start when the current user logs in. Throws an \c XArchDaemon - exception on failure. + start when the current user logs in. If \p dependencies is not NULL + 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, const char* description, const char* pathname, const char* commandLine, + const char* dependencies, bool allUsers) = 0; //! Uninstall daemon