Unknwon 4 years ago
parent
commit
037a01c4e4
4 changed files with 21 additions and 3 deletions
  1. 0 1
      gogs.go
  2. 15 0
      modules/setting/miniwinsvc.go
  3. 3 2
      modules/setting/setting.go
  4. 3 0
      routers/install.go

+ 0 - 1
gogs.go

@@ -12,7 +12,6 @@ import (
12 12
 	"runtime"
13 13
 
14 14
 	"github.com/codegangsta/cli"
15
-	_ "github.com/kardianos/minwinsvc"
16 15
 
17 16
 	"github.com/gogits/gogs/cmd"
18 17
 	"github.com/gogits/gogs/modules/setting"

+ 15 - 0
modules/setting/miniwinsvc.go

@@ -0,0 +1,15 @@
1
+// +build miniwinsvc
2
+
3
+// Copyright 2015 The Gogs Authors. All rights reserved.
4
+// Use of this source code is governed by a MIT-style
5
+// license that can be found in the LICENSE file.
6
+
7
+package setting
8
+
9
+import (
10
+	_ "github.com/kardianos/minwinsvc"
11
+)
12
+
13
+func init() {
14
+	SupportMiniWinService = true
15
+}

+ 3 - 2
modules/setting/setting.go

@@ -181,8 +181,9 @@ var (
181 181
 	// Highlight settings are loaded in modules/template/hightlight.go
182 182
 
183 183
 	// Other settings
184
-	ShowFooterBranding bool
185
-	ShowFooterVersion  bool
184
+	ShowFooterBranding    bool
185
+	ShowFooterVersion     bool
186
+	SupportMiniWinService bool
186 187
 
187 188
 	// Global setting objects
188 189
 	Cfg          *ini.File

+ 3 - 0
routers/install.go

@@ -82,6 +82,9 @@ func GlobalInit() {
82 82
 	if models.EnableTidb {
83 83
 		log.Info("TiDB Supported")
84 84
 	}
85
+	if setting.SupportMiniWinService {
86
+		log.Info("Builtin Windows Service Supported")
87
+	}
85 88
 	checkRunMode()
86 89
 
87 90
 	if setting.StartSSHServer {