views:

413

answers:

6

I want to automate the process of building the installer by running a batch file. The batch file should first sign the assemblies and than start the building of the installer. After the installer is created the batch file should sign the .msi file too. Is this possible? I'm using Visual Studio 2008

A: 

You might find this article useful if you want to automate the entire build process, starting with extracting the code from version control.

Automated Extract and Build from Team System using PowerShell

John D. Cook
A: 

from command line can be done?

A: 

Yes it can be done from a batch file. To sign the assemblies you will need to get a copy of signtool.exe from Microsoft Platform SDK. The built-in help will give you a good overview of how to use that tool. Next Visual Studio 2008 takes command line parameters, but you must make sure to call the appropriate vcvars32.bat script before trying to run devenv.exe from the command line. Finally you can use signtool.exe to sign your MSI file.

LanceSc
A: 

MSBUILD is all you need. Msbild works with .proj and .target files in xml format. Here you can find Microsoft's documentation for it. I warn you it is not easy but I warmly suggest you to spend some time on it. Every second you spend on it will return to you multiplied by 100. We use it for nigtly and partial builds and it does everything: code build, database setups, config files, unit test execution.

A: 

As enba mentioned, all you need is msbuild. This is especially true if you use WiX to generate your msi which means you can just invoke your WiX solution file. You just need to setup a build.xml that looks something like this:

<Project>
    <Target Name="Install">
        <Exec Command="signcode.exe -spc mycert.cer -v mykey.pvk myproj\release\myassy.dll"/>
        <MSBuild Projects="WixInstall.sln" Properties="Configuration=Release"/>
    </Target>
</Project>

Assuming signcode.exe is in your path all you have to do is "msbuild build.xml".

Jared
A: 

FinalBuilder has some support for this.

Sean Kearon