저번편에 이어서 기본 환경을 셋팅했으면 윈도우 서비스를 패키징 해보자
1. 해당 Fragment 를 등록한다
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<!-- service registration -->
<Component Id="ProductComponent" >
<File Id="JobServiceEXE"
Name="LogAgent.exe"
DiskId="1"
Source="C:\Release\LogAgent.exe" // 서비스 설치 할 프로그램 위치
Vital="yes"
KeyPath="yes" />
<ServiceInstall Id="ServiceInstaller"
Type="ownProcess"
Vital="yes"
Name="SetupProject1"
DisplayName="LogAgent"
Description="Agent" /
Start="auto" // 시스템 시작동안 동작
Account="LocalSystem"
ErrorControl="normal" />
<ServiceControl Id="StartService"
Name="SetupProject1"
Start="install"
Wait="no" />
<ServiceControl Id="StopService"
Name="SetupProject1"
Stop="uninstall"
Remove="uninstall"
Wait="yes" />
</Component>
</ComponentGroup>
</Fragment>
2. 빌드 후 설치
'프로그래밍 > 개발일지' 카테고리의 다른 글
c# Timer 3가지 (0) | 2023.03.23 |
---|---|
현재 설치 된 프로그램 리스트 가져오기 (2) | 2023.03.22 |
C# 윈도우 폼 로그인 화면 디자인 구현하기 (0) | 2021.01.24 |
C# 첫 프로젝트 ! (0) | 2021.01.23 |
부대를 옮겼다. 새로운 업무 시작!! (0) | 2021.01.18 |