方法一:
SVNService(將svn作為windows服務啟動並執行工具)
SVN Service Wrapper for Windows
This is my Win32 Service wrapper for SVN. Source is included, and its in the public domain. No need to copyright this stuff.
Usage instructions:
SVNService -? to display this list
SVNService -install <svnserve parameters> to install the service
SVNService -setup <svnserve parameters> to change command line parameters for svnserve
SVNService -remove to remove the service
SVNService -debug to run as a console app for debugging
將svnservice.exe放在subversion的bin目錄下
Example:
比如,你的所有項目都在e:\svnrepo下,你可以如下
安裝時用 SVNService -install -d -r e:\svnrepo
更改時用 SVNService -setup -d -r e:\otherplace\svnrepo
如果訪問其中的一個項目e:\svnrepo\project1,可以指定路徑
svn://localhost/project1 (註:作為url時用/)
第一次安裝完後要到服務中手動啟動它,
或者到服務中將它設為自動啟動,讓每次機器啟動時自動啟動這個服務。
方法二:
Subversion 從1.4版本開始,可以以windows系統服務的形式在開機時自動運行。但Subversion安裝程式還不能把自己安裝成windows服務,需要我們自己進行手動安裝,方法如下: 開啟一個DOS命令視窗,執行如下命令:
sc create svnserve binPath= "\"C:\Program Files\Subversion\bin\svnserve.exe\" --service --root e:\svn" displayname= "Subversion Repository" depend= Tcpip start= auto
其中,sc是windows內建的服務配置程式,參數binPath表示svnserve可執行檔的安裝路徑,由於路徑中的"Program Files"帶有空格,因此整個路徑需要用雙引號引起來。而雙引號本身是個特殊字元,需要進行轉移,因此在路徑前後的兩個雙引號都需要寫成\"
-- service參數表示以windows服務的形式運行,--root指明svn repository的位置,service參數與root參數都作為binPath的一部分,因此與svnserve.exe的路徑一起被包含在一對雙引號當中,而這對雙引號不需要進行轉義。
displayname表示在windows服務列表中顯示的名字, depend =Tcpip 表示svnserve服務的運行需要tcpip服務,start=auto表示開機後自動運行。
安裝服務後,svnserve要等下次開機時才會自動運行。
若要卸載svn服務,則執行 sc delete svnserve 即可。
---------------------------
實在忍受不了一個CMD佔一個“席位”,服務之。。。