How to publish a ClickOnce Build to a CD with MSBuild

clickonce

Does anyone know how to create a ClickOnce publication for a CD with the publish task in MSBuild?

VS2008 has a 'publish wizard' with a publish to CD radio button choice. It publishes a click once install to a local folder that is suitable for burning to a CD.

We are following a scheduled MSBuild with post processing steps in which we configure it and install it to a given environment, and we'd like to have a scriptable way of producing a CD of the ClickOnce output.

I have been able to make this process work for a web install, and a file share install, but it seems as though the 'publish wizard' does some hidden step that I can't discover.

I'm going out of my mind trying to correlate the various properties in the publish dialogs, the publish wizard, msbuild publish target, mage.exe and mageui.exe. Some items have the same name, some differ between dialogs and properties, some can be set in one area, but not in another.

I can see that automating ClickOnce can be done, but overall, it seems to be a GUI technology, and scripting it seems to go against its grain.

Bill

Best Answer

Just to add to this, it seems to have something to do with running MageUi on the output of the publish step.

If I publish with MSBuild from the commandline, that looks like:

msbuild  C:\myapp.vbproj /target:publish `
/property:PublishDir=c:\ClickOnce\ `
/property:SolutionDir=C:\trunk\myapp\ `
/property:TargetZone=LocalIntranet `
/property:MapFileExtensions=True `
/property:PublisherName='my publisher' `
/property:ProductName='myProduct' `
/property:BootstrapperEnabled=True `
/property:IsWebBootstrapper=False `
/property:GenerateManifests=True `
/property:ApplicationVersion=1.2.3.4 `
/property:Configuration=Debug `
/property:UpdateUrl=http://localhost/ClickOnce/ `
/property:UpdateEnabled=True `
/property:Install=True 

Then I create a folder that is installable from a CD.

When I manipulate the config file, and add additional output from another process to the publish folder, and then use MageUI to regenerate the application and deployment manifests, I create a filebased install that actually installs from the updateURL. If I disconnect from the internet, I get a 'Unable to connect to the remote server' exception, so rather than just checking for updates,it is insisting on installing from the web server as well.

Related Topic