What is the “right” way to use Chocolatey to install a Windows service?

I am looking for some recommendations on how I should package my Windows TopShelf service for distribution through Chocolatey. Currently .nuspec puts .exe and all DLLs in a folder \tools, which means they end in ProgramData\chocolatey\lib\our-service\tools. It just doesn't seem right. This is actually not a problem until I noticed that uninstallation logs all kinds of errors. All of them are associated with Chocolatey, who try to back up files, but cannot, because they are used, because the service is running. The chocolateyuninstall.ps1 function stops the service, but it does not start after a backup attempt.

The application itself uses ProgramData\MyCompany\MyAppfor all data and logging. Should I put binaries there? Or is it suitable Program Files? If one of these places is true, that is chocolateyinstall.ps1 is the logical place to put the code in xcopy for binary files? Or (and I hope you say no) is this not even the actual use of Chocolatey? The point is, how should I suck it and create an MSI for Chocolatey to work?

thanks

+4
source share
1 answer

.nuspec .exe DLL \tools, , ProgramData\chocolatey\lib\our-service\tools. . , , . Chocolatey, , , , . chocolateyuninstall.ps1 , .

chocolateyBeforeModify.ps1 script, / - https://github.com/chocolatey/choco/issues/268. 0,9.10 .

Chocolatey .

, , , Chocolatey XDT (Xml Document Transformations), , *.install.xdt xml config choco . . , - , .

ProgramData\MyCompany\MyApp . ? Program Files?

-/-. , , .

20170324. Install-ChocolateyWindowsService - Chocolatey.

, chocolateyinstall.ps1 - , xcopy ?

- , .

( , "" ) Chocolatey? , , MSI Chocolatey ?

-, , Chocolatey. MSI, . , (, ) .

+2

Source: https://habr.com/ru/post/1626607/


All Articles