views:

22

answers:

1

Hi all,

I have a MSBuild script that builds my windows forms application, generates the application manifest and signs it, then generates the deployment manifest. The script also generates the publish.htm file for me.

Now I need to generate the setup.exe file and so far I have not been able to figure out how VS generates it. How can I generate the setup.exe file using a MSBuild script?

Thank you in advance for your help!

A: 

Hi.

You can use the built-in GenerateBootstrapper MSBuild task

When you do a Publish from Visual Studio, this is also what ClickOnce uses.

Check out C:\Windows\Microsoft.NET\Framework\\Microsoft.Common.Targets to see exactly what happens.

Look at the _DeploymentGenerateBootstrapper target.

Your CSharp project file contains some items and properties that this target uses to figure out:

  1. If it's going to generate a bootstrapper (BootstrapperEnabled property)
  2. The packages to generate the bootstrapper for (BootstrapperPackage item group)
  3. Where the packages will be installed from (BootstrapperComponentsLocation property)

Hopefully this makes sense. With a bit of work you can implement with your MSBuild file exactly what happens when you Publish from Visual Studio.

David Moore
Thanks, I'll have a look at it. To workaround it when I got no responses to my question I copied the file generated by visual studio in one of my deployments and reused it. It seemed to work fine, but this task may be what I was looking for. Even if it doesn't solve my problem it's still one more task learned :)
TheCee