Riri
Riri

Reputation: 11977

Create NSIS package as part of build

Is there a way to compile a NSIS package as part of a build? I use MSBuild.

Update: There is a command tool called makensis as part of the NSIS download. I just executed that from my build script and handed it my .nsi file.

Example:

<Target Name="MakeDistributable">
    <Exec command="..\Tools\NSIS\makensis.exe MyDistScript.nsi" WorkingDirectory="..\Installation" /> 
</Target>

Upvotes: 5

Views: 2529

Answers (3)

Steve Rukuts
Steve Rukuts

Reputation: 9367

I used something similar to Riri, but I think you might be interested in how I was able to make Release/Debug installers without any configuration:

Firstly, I added this to my NSI script:

!ifndef Configuration
    !define Configuration "Debug"
!endif

And then this to my msbuild target:

<Target Name="Installer" DependsOnTargets="Build">
    <Exec Command="&quot;C:\Program Files (x86)\NSIS\makensis.exe&quot; /X&quot;!define Configuration '$(Configuration)'&quot; ..\Installer\Installer.nsi" />
</Target>

This then passes in the configuration (while defaulting to Debug). I can then use it like so:

File /r /x *.xml ..\MyApp\bin\${Configuration}\*

This is very handy when sending debug builds to beta testers for example. You just need two configurations in your build server.

Upvotes: 0

Riri
Riri

Reputation: 11977

This is what I used

<Target Name="MakeDistributable">
  <Exec command="..\Tools\NSIS\makensis.exe MyDistScript.nsi" WorkingDirectory="..\Installation" /> 
</Target>

Upvotes: 4

Pete Davis
Pete Davis

Reputation: 1137

Cruise Control .NET builds itself and creates a NSIS package as part of the build process. I recommend taking a look at its build process and source package. You will find everything you need in the nant build file in one of the source zip files from CCNet live.

Upvotes: 2

Related Questions