Question

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.

Was it helpful?

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.

OTHER TIPS

This property is set by the <GenerateDeploymentManifest> target in Microsoft.Common.targets. It uses the PublisherName property.

This property is set in the .csproj file. The diagnostic here is that it was simply not entered. Easy mistake, there is no default. Open the .csproj file in Visual Studio, Project + Properties, Publish tab. Click the Options button and enter the "Publisher name":

enter image description here

The other fields ought to be set as well. If you want to override this property for some reason in your NANT script then you must use a hard-coded string, you cannot use ${publisherName}.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top