Skip to content

Creating Releases without Visual Studio

Brendan Forster edited this page Oct 26, 2013 · 6 revisions

If you want to create releases and installers without using the Visual Studio scripts which come with the NuGet packages, this is the article for you.

As I don't have a standalone way to create releases yet, the current packages ship with a Create-Release PowerShell script which you can invoke.

So you could have a simple script like this in source control, which you run after the code is compiled:

$solutionDir = "."                      # this is where my code lives
$buildOutputDir = ".\MyApp\bin\Release" # this is where the build output lives

. packages\Squirrel.0.6.17-beta\tools\Create-Release.ps1 ` 
       -SolutionDir $solutionDir `
       -BuildDir $buildOutputDir

Things that suck about this approach:

The script depends on a specific version

You can actually workaround that by just scanning for the script (yes, this will blow up if someone else has a package named "Create-Release" - you have been warned)

$solutionDir = "."                      # this is where my code lives
$buildOutputDir = ".\MyApp\bin\Release" # this is where the build output lives

$script =  Get-ChildItem "$solutionDir\packages\\" `
                -Filter "Create-Release.ps1" 
                -Recurse | Select-Object -first 1

. $script.FullName -SolutionDir $solutionDir -BuildDir $buildOutputDir

I want to specify a different Releases directory!

Now you can!

$solutionDir = "."                      # this is where my code lives
$buildOutputDir = ".\MyApp\bin\Release" # this is where the build output lives
$releasesDir = "..\..\Release"          # publish to a folder outside the repository

$script =  Get-ChildItem "$solutionDir\packages\\" `
                -Filter "Create-Release.ps1" 
                -Recurse | Select-Object -first 1

. $script.FullName -SolutionDir $solutionDir -BuildDir $buildOutputDir ` 
                   -ReleasesDir $releasesDir