NSIS installer script with TFS Build Tool - visual-studio-2010

is it possible to utilize my NSIS installer script to make an automated build (daily) for my program in TFS 2010? The program isnt C#, it's actually small talk, so the installer being designed in NSIS was prior to our group being required to migrate source control into TFS.
Essentially the installer just copy/pastes the directory and shortcuts onto destination PC, and runs a regedit for the new parameters. I noted in the TFS build tool (which I'm extremely unfamiliar with) that it constantly wants me to point at a .proj file.. Does this mean I've got to convert our NSIS scripts into some .NET equivalent (if so how?) or is there a plugin of some sort to allow these guys to play nice together?

If your project support MSBuild to build it, you can use TFS Team Build directly. If your project doesn’t support MSBuild to build it, you need to provide a compiler which can build your project, and this compiler support run the command line to invoke it, so we can add the InvokeProcess activity(execute the command line) to invoke that compiler to build your project in build process template.
Here are useful blogs for your reference:
http://donovanbrown.com/post/I-need-to-build-a-project-that-is-not-supported-by-MSBuild
http://blogs.objectsharp.com/post/2011/03/31/TFS-Build-Invoke-Process-Activity.aspx

Related

Developing in Visual Studio but using custom, non-msbuild build scripts

I'd like to start exploring options outside of msbuild for scripting my builds, like CAKE or FAKE.
What's the best practice for developing .NET Core in Visual Studio but using external build scripts? Like, how does this actually work in practice?
I'd like to continue to take full advantage of the VS environment, including Intellisense, package management, IDE features like Go To Definition, etc.
Do people somehow customize/override the VS F5 and/or Ctrl-Shift-B behaviors? Or do they use .csproj files and let VS and msbuild do its own thing until it's time to generate a "real" build, and then run their own scripts at that time?
Locally on your development machine you usually run build scripts from command line. You don't write build script to help you while developing. You write them that your code is verified by an automated build and that you automate processes like creating deployment packages, publishing nuget packages...
Most common practice is contionous integration approach. This means that when you or someone in your team commits/pushes code to the version control system(like git svn...) your selected continuous integration tool (like jenkins, team city...) pulls source code from version control system and runs your build script which for example compiles your code, run tests, creates deployment package.
I would also suggest that you take a look at flubu. Flubu is a cross platform build automation tool for building projects and executing deployment scripts using C# code. It's easy to learn beacuse you write your build script entirely in c#.
More about flubu can be readed here: https://stackoverflow.com/a/46776658/3118784

Can I add a Golang Compiler to Visual Studio Team Services

We are going to use Visual Studio Team Services for a project. We are using VSTS Git as our repository. A portion of this project is written in Golang. We want to enable CI and build/test all code at check in. I have been learning more about extensions, the build agents and build process within VSTS. I see in the marketplace there are options for Android, iOS and other platforms (but not GoLang). Can anyone start me on the path to creating a custom extension or build definition for Golang? How can I create a custom extension to enable automated builds at check-in of GoLang code? Thanks!
Yes but I would look at it a bit differently. There is no need to add anything to VSTS, you just need golang/the go compiler installed on your build agent and then you can set up a job using MSBuild like any other MSFT supported language which invokes the Go compiler with your sources. Basically, write an msbuild script who's sole job is to invoke the go compiler with the target sources.
Here are MSBuild docs on the Exec task which is what you'd use to kick off your build; https://msdn.microsoft.com/en-us/library/x8zx72cd.aspx
As far as I know in order to add the Go compiler you need to setup a private agent or install it on the fly using a build task like the tool installer

NSIS Installer and Visual Studio 2015 community Edition

We had a developer leave and I'm trying to make myself familiar with his deployment process. The past developer would create two versions of his install. One was a update and the other was an install.
I see in the src code he has a .NSIS folder with the scripts already written.
How do I use those scripts to build our NSIS installers? I've looked at Visual Installer, but I don't see how to implement those scripts for the build process.
Edit
"He" is the old developer that left. I'm trying to push out a new build of the ACInstall.exe and ACPatch.exe. I've looked at NSIS online tutorials and they mostly talk about creating the script. I have the script but I'm not familiar with how to use it. ie what tool to run to build the ACInstall.exe.
Here are the files he created and how the project's explorer looks.
.nsi files are plain text files and the NSIS compiler (makensis.exe) will produce a .exe from a .nsi.
You need to install NSIS to get the NSIS compiler, Visual Installer just provides Visual Studio integration (syntax highlighting etc).
Anders, you can use a number of NSIS script editors, not sure if this is your requirement. You can use HM NIS, I think it's the better free, but it's a bit 'ole' (more than 8 years for sure). I hope this answer can be of help to anybody looking for the same answer.

Using install shield from CLI ,is it possible?

I have some existing install shield 2009 projects and every time i want to create a newer version of them i perform some specific tasks that i want to automate with a script.
This are the operations that i have to perform manually
Change GUID
Point to the updated packages
Build single_exec_image
Is it possible to make this operations from CLI on installShield 2009?
Thank you in advance
InstallShield has an Automation Interface (32bit COM based). You can use this API to make programmatic changes to your installer project. InstallShield also supports command line builds using ISCmdBld.exe.
Typically you do all of this in the realm of build automation using MSBuild or NAnt. Both allow you to write custom tasks in c# that can interop to the COM automation interface.
For example I use TFS which uses MSbuild (which InstallShield has native support for via .isproj files ) to build my installer. In this scenario I can use dynamic properties in MSBuild to generate a GUID and I can use path variable overrides to point to your source. The build target then builds the installer.
A bunch of ways to skin this cat depending on your environment.

Integrating MSBuild into Visual Studio

I'm a solo developer running Visual Studio 2008 and looking into MSBuild to improve my build process.
Almost all of the tutorials I've found so far have plenty of information about writing a build file. However I'm having a lot of trouble finding out how to integrate MSBuild into Visual Studio. Maybe MSBuild is only used with something like CruiseControl but that's overkill for me as a single developer.
Where should the build file live in a Visual Studio project and how can I run it from within the IDE?
Visual Studio executes MSBuild automatically for projects it supports.
If you right click on a project and unload it, you can then edit it in Visual Studio. Reload (right click on project again), force a (re)build to test your changes. An alternative is to edit the project file in an external editor and Visual Studio will detect saves and offer to reload the project for you.
Sounds like you're on the right track, and if you are considering writing Targets or custom MSBuild Tasks, take the time to separate them from your current project so that you can re-use them. Don't re-invent the wheel though, the two main complementary MSBuild projects are MSBuild Community Tasks and MSBuild Extension Pack.
Update: Judging from your comment on Mitch's answer, you might also want to consider adding a new Configuration element or custom properties to a project. A new MSBuild Configuration (something other than the default Debug/Release) could run unit tests, build documentation, or whatever you want automated. A custom MSBuild property would allow you to use normal Debug/Release Configuration and extend it to automate more of your build process, just depends on what you want. Either approach could also be driven from the command line.
As others have noted, MSBuild is already available when you install Visual Studio.
If you want to integrate into VS2008: Running MSBuild from Visual Studio
MSBuild is the build engine used by Visual Studio to process the files included in a project.The Visual Studio project files themselves (**.csproj* for C#, and .vbproj for VB, for example) are in fact MSBuild scripts that are run every time you build a project.
Your .csproj file is a MSBuild file. So you are actually using it already.
You may of course wish to create a separate build file to have more control, especially within a continuous integration or nightly build say.
If you simply wish to edit your project build file then you can use the IDE to edit some settings such as pre and post build actions or edit the Xml itself by unloading project and right click and editing.
You can use your current .vcproj files to build your project with MSBuild. However, as MSBuild is not directly supported (at least for vc++) vcbuild is used instead (internally).
In VS2010 all project files are MSBuild based...
This is an older article about some simple extension points from the msbuild team
How To: Insert Custom Process at Specific Points During Build
Also, don't forget you can use the MSBuild SideKick for developing and debugging your (local) msbuilds, available for free at http://www.attrice.info/msbuild/
I'd suggest you call msbuild as a post build step. Then you can put your build script somewhere in your solution and call it.
<windowsdir>\Microsoft.NET\Framework\v3.5\MSBuild.exe c:\temp\MyProject\mybuildfile.proj
The easiest way is probably to invoke your custom build script using a post-build step. Right click project, choose "Build Events" and call msbuild with your custom msbuild file from there.
I use the msbuild template to intergrate with visual studio
http://msbuildtemplate.codeplex.com/

Resources