Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fmscupd
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李定达
fmscupd
Commits
fe240ba4
Commit
fe240ba4
authored
Feb 28, 2018
by
李定达
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.添加延迟启动;2.添加开机启动失败重启服务;3.添加描述信息;4.修复update.flag文件路径拼写异常;5.添加版本信息;6.测试update.flag文件
parent
c35bf1f7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
29 additions
and
2 deletions
+29
-2
fmscupd.suo
+0
-0
fmscupd/fmkeeper.cpp
+1
-1
fmscupd/fmproxy_service.cpp
+1
-1
fmscupd/fmscupd.aps
+0
-0
fmscupd/fmscupd.rc
+0
-0
fmscupd/fmwinservice.cpp
+25
-0
fmscupd/fmwinservice.h
+2
-0
No files found.
fmscupd.suo
View file @
fe240ba4
No preview for this file type
fmscupd/fmkeeper.cpp
View file @
fe240ba4
...
...
@@ -210,7 +210,7 @@ void FMKeeper::onKeepProcess()
getimagepath
(
path
);
flagfile
=
path
;
flagfile
.
append
(
TEXT
(
"
\\
update.flag"
));
flagfile
.
append
(
TEXT
(
"update.flag"
));
std
::
cout
<<
flagfile
<<
std
::
endl
;
...
...
fmscupd/fmproxy_service.cpp
View file @
fe240ba4
...
...
@@ -16,7 +16,7 @@
#include "fmwinservice.h"
#define SVCNAME TEXT("Fmupdate")
#define SVCNAME TEXT("Fmupdate
Test
")
LPCTSTR
GetLastErrorMsg
(
DWORD
dwError
=
0
)
{
...
...
fmscupd/fmscupd.aps
View file @
fe240ba4
No preview for this file type
fmscupd/fmscupd.rc
View file @
fe240ba4
No preview for this file type
fmscupd/fmwinservice.cpp
View file @
fe240ba4
...
...
@@ -128,6 +128,31 @@ BOOL FMWinService::Install()
FMLOG
(
"CreateService failed: %d"
,
GetLastError
());
}
else
{
SERVICE_DESCRIPTION
sdesc
;
SERVICE_DELAYED_AUTO_START_INFO
delaystart
=
{
TRUE
};
SERVICE_FAILURE_ACTIONS
servFailActions
;
SC_ACTION
failActions
[
3
];
TCHAR
descr
[]
=
TEXT
(
SERVICE_DESC
);
sdesc
.
lpDescription
=
descr
;
ChangeServiceConfig2
(
m_hService
,
SERVICE_CONFIG_DESCRIPTION
,
&
sdesc
);
ChangeServiceConfig2
(
m_hService
,
SERVICE_CONFIG_DELAYED_AUTO_START_INFO
,
&
delaystart
);
failActions
[
0
].
Type
=
SC_ACTION_RESTART
;
//Failure action: Restart Service
failActions
[
0
].
Delay
=
120000
;
//number of seconds to wait before performing failure action, in milliseconds = 2minutes
failActions
[
1
].
Type
=
SC_ACTION_RESTART
;
failActions
[
1
].
Delay
=
120000
;
failActions
[
2
].
Type
=
SC_ACTION_RESTART
;
failActions
[
2
].
Delay
=
120000
;
servFailActions
.
dwResetPeriod
=
86400
;
// Reset Failures Counter, in Seconds = 1day
servFailActions
.
lpCommand
=
NULL
;
//Command to perform due to service failure, not used
servFailActions
.
lpRebootMsg
=
NULL
;
//Message during rebooting computer due to service failure, not used
servFailActions
.
cActions
=
3
;
// Number of failure action to manage
servFailActions
.
lpsaActions
=
failActions
;
ChangeServiceConfig2
(
m_hService
,
SERVICE_CONFIG_FAILURE_ACTIONS
,
&
servFailActions
);
FMLOG
(
"Service installed successfully"
);
bRet
=
TRUE
;
}
...
...
fmscupd/fmwinservice.h
View file @
fe240ba4
...
...
@@ -4,6 +4,8 @@
#include <Windows.h>
#include <tchar.h>
#define SERVICE_DESC "using freemud mcdmanager.exe guard"
class
FMWinService
{
public
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment