summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
author无闻 <u@gogs.io>2015-10-29 13:20:27 -0400
committer无闻 <u@gogs.io>2015-10-29 13:20:27 -0400
commit31b375782b55972b4ac7719d9bd1f3fadf1874f9 (patch)
tree000e8ce3d369e5862d478a78165a86fc249d3935 /scripts
parent4f0e31e96d747265105abb7cadfcb757780886fc (diff)
parent0252629956b99834fc4182279e6e9edf3c1c5a05 (diff)
downloadgitea-31b375782b55972b4ac7719d9bd1f3fadf1874f9.tar.gz
gitea-31b375782b55972b4ac7719d9bd1f3fadf1874f9.zip
Merge pull request #1853 from andreynering/windows-service
Adding simple script to install Gogs as a Windows service.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/windows/install-as-service.bat25
1 files changed, 25 insertions, 0 deletions
diff --git a/scripts/windows/install-as-service.bat b/scripts/windows/install-as-service.bat
new file mode 100644
index 0000000000..e5d598265c
--- /dev/null
+++ b/scripts/windows/install-as-service.bat
@@ -0,0 +1,25 @@
+@ECHO off
+
+:: This script relies on nssm.exe to work.
+:: Please, download it and make it available on the system path,
+:: or copy it to the gogs path.
+:: https://nssm.cc/download
+:: This script itself should run in the gogs path, too.
+:: In case of startup failure, please read carefully the log file.
+:: Make sure Gogs work running manually with "gogs web" before running
+:: this script.
+:: And, please, read carefully the installation docs first:
+:: http://gogs.io/docs/installation
+:: To unistall the service, run "nssm remove gogs" and restart Windows.
+
+:: Set the folder where you extracted Gogs. Omit the last slash.
+SET gogspath=C:\gogs
+
+nssm install gogs "%gogspath%\gogs.exe"
+nssm set gogs AppParameters "web"
+nssm set gogs Description "A painless self-hosted Git service."
+nssm set gogs DisplayName "Gogs - Go Git Service"
+nssm set gogs Start SERVICE_DELAYED_AUTO_START
+nssm set gogs AppStdout "%gogspath%\gogs.log"
+nssm start gogs
+pause