Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
ClickOnce deployment with NAant script?

Hi!
I have a c# application for which I want to make an automated ClickOnce Deployment script.
I'm doing it with NAant together with a build file. It works fine, but I wonder if the way I've done it is the right way to go?!
Below you can see the relevant parts of the build file.
I especially wonder if it is correct to use the "New Application" and "New Deployment" switch should be used every time an update is done?!
Can anyone give me some input?

<!-- Copy all the files to the deploy folder -->
<echo message="Copying Application files from ${build.dir} to $${Deployment.dir}\${publish.version}." />
<delete dir="${Deployment.dir}\${publish.version}" failonerror="false" />
<mkdir dir="${Deployment.dir}\${publish.version}" />
<copy todir="${Deployment.dir}\${publish.version}" overwrite="true" includeemptydirs="true" >
    <fileset basedir="${build.dir}">
        <includes name="**" />
    </fileset>
</copy>
<!-- Creating Application Manifest -->
<echo message="Creating application manifest ${Deployment.dir}\${publish.version}\Application.exe.manifest." />
<exec program="mage" commandline="-New Application -t ${Deployment.dir}\${publish.version}\Application.exe.manifest -fd ${build.dir} -Name Application -Version ${publish.version}" />
<exec program="mage" commandline="-Sign ${Deployment.dir}\${publish.version}\Application.exe.manifest -CertFile Application.pfx -Password pwd_Application" />
<!-- Creating Deployment Manifest -->
<echo message="Creating deployment manifest ${Deployment.dir}\${publish.version}\Application.exe.manifest." />
<exec program="mage" commandline='-New Deployment -t ${Deployment.dir}\Application.application -pu ${publish.url}\Application.application -Name Application -i true -appm ${Deployment.dir}\${publish.version}\Application.exe.manifest -Version ${publish.version}' />
<exec program="mage" commandline="-Update ${Deployment.dir}\Application.application -MinVersion ${publish.version} -UseManifestForTrust true -Publisher MyCompany" />
<exec program="mage" commandline="-Sign ${Deployment.dir}\Application.application -CertFile Application.pfx -Password pwd_Application" />
Posted
Updated 17-Sep-10 0:19am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900