This commit is contained in:
SpringHgui 2021-07-13 00:13:24 +08:00
commit a9a9291740
6 changed files with 31 additions and 2 deletions

View File

@ -13,6 +13,7 @@
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0-preview.4.21253.7" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0-preview.4.21253.7" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.0-preview.4.21253.7" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="5.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Log4Net.AspNetCore" Version="5.0.3" />
</ItemGroup>
@ -27,6 +28,12 @@
<None Update="log4net.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="卸载服务.bat">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="安装服务.bat">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ProjectExtensions>

View File

@ -13,6 +13,7 @@ namespace FastTunnel.Client
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.UseWindowsService()
.ConfigureServices((hostContext, services) =>
{
// -------------------FastTunnel START------------------

View File

@ -0,0 +1,10 @@
@echo off
color 0e
@echo ==================================
@echo 提醒:请右键本文件,用管理员方式打开。
@echo ==================================
@echo Start Remove FastTunnel.Client
Net stop FastTunnel.Client
sc delete FastTunnel.Client
pause

View File

@ -0,0 +1,11 @@
@echo off
color 0e
@echo ==================================
@echo 提醒:请右键本文件,用管理员方式打开。
@echo ==================================
@echo Start Install FastTunnel.Client
sc create FastTunnel.Client binPath=%~dp0\FastTunnel.Client.exe start= auto
sc description FastTunnel.Client "FastTunnel-开源内网穿透服务仓库地址https://github.com/SpringHgui/FastTunnel star项目以支持作者"
Net Start FastTunnel.Client
pause

View File

@ -3,7 +3,7 @@ color 0e
@echo ==================================
@echo 提醒:请右键本文件,用管理员方式打开。
@echo ==================================
@echo Start Remove FastTunnel.Server Service
@echo Start Remove FastTunnel.Server
Net stop FastTunnel.Server
sc delete FastTunnel.Server

View File

@ -3,7 +3,7 @@ color 0e
@echo ==================================
@echo 提醒:请右键本文件,用管理员方式打开。
@echo ==================================
@echo Start Install FastTunnel.Server Service
@echo Start Install FastTunnel.Server
sc create FastTunnel.Server binPath=%~dp0\FastTunnel.Server.exe start= auto
sc description FastTunnel.Server "FastTunnel-开源内网穿透服务仓库地址https://github.com/SpringHgui/FastTunnel star项目以支持作者"