Windows安装程序用exe文件,Lunix安装程序使用deb文件。下面演示如果在Windows上打包deb文件。
1. 安装dotnet-deb打包工具
如果已经安装过deb打包工具可省略这步。快捷键Win+R 输入cmd,打开命令窗口,输入dotnet tool install --global dotnet-deb
2. 在项目的根目录下打开cmd窗口
3. 在cmd窗口运行以下命令
- dotnet deb install
- dotnet restore -r linux-x64
- dotnet msbuild <项目名称>.csproj /t:CreateDeb /p:TargetFramework=net6.0 /p:RuntimeIdentifier=linux-x64 /p:Configuration=Release
最后在bin文件下面就可以找到生成的deb文件。