From 037a01c4e4b394cdcd4a2094489cedbcccf34a6b Mon Sep 17 00:00:00 2001 From: Unknwon Date: Fri, 18 Dec 2015 05:49:28 -0500 Subject: [PATCH] fix #2189 --- gogs.go | 1 - modules/setting/miniwinsvc.go | 15 +++++++++++++++ modules/setting/setting.go | 5 +++-- routers/install.go | 3 +++ 4 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 modules/setting/miniwinsvc.go diff --git a/gogs.go b/gogs.go index d87a9f9d10fb..5afeb0764c34 100644 --- a/gogs.go +++ b/gogs.go @@ -12,7 +12,6 @@ import ( "runtime" "github.com/codegangsta/cli" - _ "github.com/kardianos/minwinsvc" "github.com/gogits/gogs/cmd" "github.com/gogits/gogs/modules/setting" diff --git a/modules/setting/miniwinsvc.go b/modules/setting/miniwinsvc.go new file mode 100644 index 000000000000..02e8eb91fc26 --- /dev/null +++ b/modules/setting/miniwinsvc.go @@ -0,0 +1,15 @@ +// +build miniwinsvc + +// Copyright 2015 The Gogs Authors. All rights reserved. +// Use of this source code is governed by a MIT-style +// license that can be found in the LICENSE file. + +package setting + +import ( + _ "github.com/kardianos/minwinsvc" +) + +func init() { + SupportMiniWinService = true +} diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 532d8595e93c..67f2f158b15c 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -181,8 +181,9 @@ var ( // Highlight settings are loaded in modules/template/hightlight.go // Other settings - ShowFooterBranding bool - ShowFooterVersion bool + ShowFooterBranding bool + ShowFooterVersion bool + SupportMiniWinService bool // Global setting objects Cfg *ini.File diff --git a/routers/install.go b/routers/install.go index d5472c9b3eba..120aa468513d 100644 --- a/routers/install.go +++ b/routers/install.go @@ -82,6 +82,9 @@ func GlobalInit() { if models.EnableTidb { log.Info("TiDB Supported") } + if setting.SupportMiniWinService { + log.Info("Builtin Windows Service Supported") + } checkRunMode() if setting.StartSSHServer {