VSTS CI CD for desktop apps
I

2

9

How can I achieve CD (Continuous Delivery) for winform applications in VSTS (Visual Studio Team Services)? Currently this is what I have in my Visual Studio Solution file

1) A winform project

2) A Windows setup and Deployment project

So every time I build a winform project, I do the following steps (and I need CI / CD for exactly these)

1) Build Setup and Deployment project, which takes Build output of Winform project and creates and EXE / MSI

2) I take this MSI file and use NSIS to embed it inside EXE

3) I run SIGNTOOL from command prompt and digital sign the EXE

4) I upload this signed EXE to my website

Now how can I use CI / CD pipeline to automate the above or is it not possible for my case? I am confused. I can't find any material for winforms, all are for web apps.

Thanks

Incorporator answered 11/9, 2017 at 11:3 Comment(0)
J
4

You will obviously need some sort of desktop deployment strategy. The easiest is to be using xcopy. Other alternatives include frameworks like ClickOnce, Windows Installer or Squirrel to name a few. I have a number of corporate apps that use Clickonce that I have deployed using vsts.

Now I am unable to understand how will VSTS help me with this?

Use VSTS to build the software first and include additional tasks to package your app. In my case, I use devenv.exe to generate ClickOnce packages, but you can include custom tasks by using powershell. The artifact of the build should now be the "packaged app". Then use the VSTS deployment to copy the "package" to some kind of hosting server from where your users can download the package. That could be either a web server or a fileserver or any location appropriate for your deployment strategy.

In this context, VSTS is an orchestration tool. It helps to trigger actions for you.

See Deploy an agent on Windows to see how to setup an on-premise agent.

Jiva answered 11/9, 2017 at 13:20 Comment(4)
Hey Dayneo, thanks for the reply. I just edited my question to make it more clearer. I don't use ClickOnce, I use Windows setup and deployment. Can you go through my edited question and tell me how to proceed? Thanks.Incorporator
The build system needs to have NSIS and SIGNTOOL installed. For this reason, I think you should setup an onpremise agent to do the build. VSTS will orchestrate the build, but the build will happen on your build server (this is how I do builds for things like Oracle DB). You should then use powershell tasks in your build sequence to run the custom steps that you need to package your app. I would say that the output artifact should be the signed EXE. Your deploy step will then be a simple copy of the EXE to the webserver.Jiva
Looks like I am getting closer all because of your help. 1) setup an onpremise agent : Does it mean I can use my local machine for this or it has to be on cloud only? Is there any setup for on Premise Agent that I can run on my local machine and VSTS will know about it? Thanks.Incorporator
VSTS Supports having an on-premise agent. That agent will run from any machine you deploy it to. It will need outbound internet access though. In VSTS you go to the settings and look for "Agent Pools". That will give you a way to download and install an Agent that will run on-premise and will communicate with VSTS in the cloud. And here is the manual: learn.microsoft.com/en-us/vsts/build-release/actions/agents/…Jiva
E
4

To build and deploy the way as you used in VSTS, you can use below steps:

  1. Create a repository (Git or TFVC) and push your solution in the repository.
  2. Add build/release definitions.

    With CI build, enable the Continuous Integration in Triggers Tab. With CD deploy, enable Continuous deployment trigger in Pipeline Tab. The process for CI build and CD deploy, you can refer CI/CD.

  3. Add related tasks in your build/release definition.

Emilyemina answered 13/9, 2017 at 8:31 Comment(3)
Thanks, I installed "Build VS Installer" from the marketplace link provided by you. I also added it to my build task list, see image url 1drv.ms/i/s!Ase2Dy0lrWBLl6Mdtbi8r9BDc-4XiA Now when I run the build it's giving devenv error, I tried changing few things but it's not working for me. I am using VS 2017 . See image url aboveIncorporator
Can you add the Build VS Installer task fully build log (set system.debug = true in variables Tab) in your question? Since the log in screen shot is not enough.Emilyemina
I was able to build it by adding a registry entry by following directions from this link kunal-chowdhury.com/2016/07/… . Now I am able to create MSI. I will try next steps as suggested by you for NSIS, etc and let you know. Thanks.Incorporator

© 2022 - 2024 — McMap. All rights reserved.