views:

1106

answers:

3

What is the proper way to set the Company Name and Application Name in a ClickOnce Application?

I have a set of projects in a solution called RecordNavigator.
The GUI project is called RecordNavigator.Gui

When I publish the app - I want the Start menu to have a folder called Tyndall Software and the application shortcut to be called Record Navigator

Right now the folder says Organization and the shortcut says RecordNavigator.Gui The AssemblyInfo.cs file seems to have no effect. Is that normal?

+3  A: 

You need to change the ClickOnce manifest, not the assemblyinfo.cs...

There is an msbuild task for this: GenerateDeploymentManifest

 <GenerateDeploymentManifest
  AssemblyName="$(ApplicationIdentity)"
  AssemblyVersion="$(PublishVersion)"
  Description="$(ApplicationDescription)"
  EntryPoint="@(ApplicationManifest)"
  DeploymentUrl="$(PublishURL)/$(App).application"
  MapFileExtensions="true"
  OutputManifest="$(App).application"
  Product="$(ApplicationDescription)"
  Publisher="$(Publisher)"
  SupportUrl="$(SupportURL)" >
  <Output ItemName="DeploymentManifest" TaskParameter="OutputManifest" />
 </GenerateDeploymentManifest>

Set your $(Description) to the Application Name you want, $(Publisher) value to the Company Name, and the $(SupportURL) to the url you want to publish.

John Weldon
+1 great info. thanks.
tyndall
+6  A: 

If you open your project's properties in Visual Studio and click on the 'Publish' tab, there should be an 'Options...' button under 'Install Mode and Settings'. There you can define the Publisher name ('Tyndall Software'), Product name ('Record Navigator'), and other such options.

Andy Mikula
That did it. Awesome.
tyndall
I wonder where that gets stored?... not in the AssemblyInfo.cs. weird
tyndall
Um, in the deployment manifest.
John Weldon
A: 

Hi,

Just as Andy Mikula said - it's on the Publish section in the app's properties, but in my VS2008 it's under the Options button and the Description section, the properties are called Publisher Name and Product Name.

You'll find all the ClickOnce settings in the .csproj file for the application. E.g. the fields you want to update exist as:

<ProductName>...</ProductName>
<PublisherName>...</PublisherName>

Side note, these values are not part of the application's ClickOnce identity - so you can change them for an application and the next time your customers update the name of the app will change - I'm not sure about the start menu folder though.

andyhammar
They are NOT part of the ClickOnce identity, but they will update the name of the app? is that right? confusing.
tyndall
Is right? Yep. Confusing? Yep.I just did a test, published once with product name "A". Published again with new product name "B". Outcome: When clicking on the "A" app in the start menu, I got the question "there is an update available for A...". Click OK and the progress window showed "downloading update for B...". Directly after the install finished the start menu shortcut changed name to "B".
andyhammar