Search code examples
.netwpfmsbuildclickoncenant

Publisher property via msbuild command in NANT script


I have written NANT build script to deploy my clickOnce WPF application.

What I cant figure out is, how to set publisher parameter...

This is part of the manifest that is generated after build:

<description asmv2:publisher="TestApplication" co.v1:suiteName="xOrg" asmv2:product="TestApplication" xmlns="urn:schemas-microsoft-com:asm.v1" />

I am deploying via msbuild using:

<target name="BuildTestApplication" depends="Clean" description="Build">
    <property name="publishFolderParameter" value="/p:PublishDir=${testPublishFolder}" />
    <echo message="Building..." />  
        <exec program="${msbuildExe}" workingdir="." verbose="true">
            <arg value="${projectFile}" />
            <arg value="/target:publish" />
            <arg value="${publishFolderParameter}" />
            <arg value="/property:ApplicationVersion=${version}" />
        </exec>
    <echo message="Built" />
</target>

How do I change the publisher property via msbuild arguments?

I have tried adding:

<arg value="/property:Publisher=${publisherName}" />

and

<arg value="/property:PublisherName=${publisherName}" />

with no success...

Additional question: What determines structure in start menu after the application is installed (the All programs / Some Name)?

Thank you in advance.


Solution

  • I suppose that you are missing the quotation marks. Try

    <arg value="/property:PublisherName=&quot;${publisherName}&quot;" />
    

    for the PublisherName and

    <arg value="/property:ProductName=&quot;${productName}&quot;" />
    

    for the ProductName which should set the shortcut name in the start menu.