How to release/publish a .Net Core console application? - windows

I have a console application that I want to publish for Windows and Ubuntu so end user can install and use it easily. The intended user is not a developer but able to use a CLI.
I can generate a release build with dotnet publish and zip it.
What is the release channel then?
Should I build a --self-contained release?
How is my tool placed into the $PATH on the users machine?
Should I provide an installer for Windows and a PPA for Ubuntu?

In general, a command for publishing console app is dotnet publish -c Release -r win10-x64
You should change win10-x64 by correct rid which belongs to OS such as linux-x64, osx.10.14-x64
What is the release channel then?
It depends, if it is running on Window or Linux, it will be .exe file
Should I build a --self-contained release?
--self-contained makes you to isolate any 3rd libraries and a release package. If you aren't sure the host doesn't install any 3rd libraries, so --self-contained will help you. Thus a build will be larger than.
How is my tool placed into the $PATH on the users machine?
Once again, it depends on your target OS. Each OS has a different way to set $PATH. And if you want to custom a cli as dotnet or npm, check in the link Custom commands in windows Command Prompt
Should I provide an installer for Windows and a PPA for Ubuntu?
If you are DevOps Engineer, so you don't want it because it isn't friendly with CLI. You want only release package.

Related

Create gopls.exe for offline Windows computer on a Mac

I am trying to set up Go on my offline Windows computer, using Visual Studio Code. I have successfully installed VS Code, Go, etc., but am running into trouble installing the Go tools. Unfortunately putting my Windows computer online isn't an option.
The most important tool for me is gopls the Go Language Server tool that provides hover, autocomplete, etc., and will really boost productivity.
I have tried various things, including:
Copying the binary file from $GOROOT/bin/gopls from my Internet-connected Mac to Windows.
Cloning the gopls repo from Github and rebuilding gopls for Windows as covered here by running go build -o gopls.exe main.go.
However I get the following error:
Couldn't start client gopls
Copying the cloned repo to my offline computer and running go install does not work as there are other dependencies needed to fully build and install gopls.
Another tool, staticcheck, provides precompiled binaries for all platforms here.
I have two questions:
Is there a publicly available repo/mirror/site that provides ready-made, downloadable binaries for the main set of Go tools for Windows?
Is there a way that the Go tools can be built for a Windows OS?
The bug on this was setting the environment variable correctly.
To give exact steps:
Browse to your Go src directory: $GOPATH/src/golang.org/x/
Clone Go tools repo: git clone https://github.com/golang/tools.git
cd tools/gopls.
Run GOOS=windows GOARCH=386 go build -o gopls.exe main.go to compile a binary file for gopls that is compatible on Windows.
Repeat steps 3 and 4 for each tool you need to install.
Ref: https://github.com/golang/go/wiki/WindowsCrossCompiling

How to install applications on a windows docker container?

I'm trying to create a Docker container based on the abrarov/msvc-2019 (windows based) image and I need to install additional programs such as Conan.
In the Dockerfile, what do I need to write in it to be able to install Conan? I can't just use something like "apt install" since Windows doesn't support anything of the sort. I can't find anything online about this.
I tried downloading the .exe installer locally and copy it inside the container, and then run the .exe during the building of the image. Something like this :
COPY conan-win-32_1_33_0.exe C:\\
RUN conan-win-32_1_33_0.exe;
But the image doesn't finish building and it's just stuck in the RUN part.
The most recommended way is using pip:
pip install conan
Another official ways are listed on download page. But as you listed, Windows installer is the another way.
For Windows you still can try Chocolatey, but it's not maintained by Conan team.
In the past we tried something similar and worked, a MSVC 15 Docker image with Conan. However, due Visual Studio license, we can't build images for distribution. You could fork the project and use it for your own propose.

Unable to create dmg executable for Mac OS with .NET Core 2.1

I'm learning how to deploy .NET Core applications to multiple platforms, and I am unable to produce a .dmg executable for the Mac OS.
This is my development environment:
Windows 10 Professional 64 bit
Visual Studio 2017 Professional with latest update
Targeting .NET Core 2.1
To test the deployment process, I created a simple "hello world" .NET Core Console App. I followed the steps on the official MSDN website to deploy the application to Mac OS in Visual Studio as a Self Contained Deployment package, but I don't see a .dmg file in the published target directory. I only see .dll files and other project related files. I also tried to publish to the Mac OS as a Self Contained Deployment package via the .NET Core CLI by issuing the following commands, but that still did not produce the .dmg executable:
dotnet publish -c Release --self-contained -r osx-x64
I also tried:
dotnet publish -c Release --self-contained -r osx.10.13-x64
How do I create the .dmg executable?
Thanks.
A .dmg is not an executable, it's a disk image (as Gordon wrote, something like an .iso). It can be used for distributing software, and I wouldn't expect your tools to output a .dmg (nor do Apple's own development tools).
"Self contained deployment" package in this case means that the .NET runtime is statically linked inside your executable, so the end user does not need the .NET runtime installed (at the cost of increasing the size of your binary). See self-contained. NET core applications.
Your build should be producing an MACH binary (probably with the same name as your project, without any extension). You can distribute this binary how you like, including using a .dmg. You can use hdiutil to create and manipulate Apple disk images.

How to pack a Vala application under Windows?

On windows I use Vala via MSYS2. How do I properly package the application so that it can run on another computer(along with Gtk). What and where windows should be placed from MSYS2 dll to exe you can run from anywhere?
You are using MSYS2 so you could try a three staged approach:
Create a PKGBUILD file and use makepkg-mingw to build a MSYS2 package of your application
Install MSYS2 in a temporary directory and then your application's MSYS2 package, this will resolve the dependencies
Use a tool like msitools or NSIS to create an installer for the files in your temporary directory, msitools plays nicer with installs in a corporate environment, but is not graphical, NSIS provides a GUI interface
Some references:
Building and distributing your application - GTK Windows download page
How to build your GTK+ application on Windows - detailed instructions for building the intermediate MSYS2 package, by Ignacio Casal Quinteiro
What is major difference between MSI and EXE installation files?

How can I create Debian install packages in Windows for a Visual Studio project?

I'm developing some cross platform software targeting Mono under Visual Studio and would like to be able to build the installers for Windows and Linux (Ubuntu specifically) with a single button click. I figure I could do it by calling cygwin from a post-build event, but I was hoping for at best a Visual Studio plugin or at worst a more Windows-native way of doing it. It seems like the package format is fairly simple and this must be a common need.
edit: Re-asked question under other account due to duplicate login issue.
Debian's .deb packages are just "ar" archives containing tarballs. You can manipulate both types of files using cygwin or msys quite easily:
$ ar xv asciidoc_8.2.1-2_all.deb
x - debian-binary
x - control.tar.gz
x - data.tar.gz
$ tar -tzf control.tar.gz
./
./conffiles
./md5sums
./control
Or you can install all the "standard" Debian stuff using cygwin, I suppose, but most of that stuff won't benefit you much if you're building a .Net app anyway.
If you use the .NET Core SDK, you can use dotnet-packaging tools to create a Debian installer package from any platform that runs .NET Core.
For example, running dotnet deb -c Release -f netcoreapp2.1 -r ubuntu.16.04-x64 would then create a .deb file which you can use to install your app on Ubuntu 16.04.
The project repository has more details.
I am not aware of any plugin that does it natively, especially since Mono users seem to prefer MonoDevelop.
However, it should be possible to use Cygwin and a custom MSBuild Task or Batch file in order to achieve that by using the native .deb creation tools.
this must be a common need.
Some small percentage of software developers develop for .NET
Some very small percentage of that group develop for mono
Some small percentage of that group wants to provide .debs instead of just a zip
Some very small percentage of that group wants to build their linux apps on windows instead of natively on linux
It's just you :-)
If you don't mind using Java tools it's possible to build Debian packages with jdeb in an Ant script. That's probably lighter than relying on Cygwin.

Resources