11

(Disclaimer: I use the Japanese version of Visual Studio 2005, and while I'm literally translating the menu names of my Visual Studio into English, it's likely to be different than how they're actually on the original edition)

Anyways, I'm trying to publish a ClickOnce app on the server, but the generated manifest file (.application) has a value in the deploymentProvider codebase attribute that I can't change at all.

<deploymentProvider codebase="http://foo.jp/foo/ClickOnce/fooApp.application" />

I expected the value would be changed by putting a path into the box where we could specify the location path (I mean, Solution Explore -> Property -> Publish tub -> Publish Location), but do I overlook something else?

Of course, I can manually change it on my NotePad, but I don't think it's the normal behavior!

John Saunders
  • 160,644
  • 26
  • 247
  • 397
Quv
  • 2,958
  • 4
  • 33
  • 51
  • 1
    is this along the lines of what you are trying to accomplish? http://stackoverflow.com/questions/174764/how-to-move-a-clickonce-deployment-package – Glenn Ferrie Jul 24 '12 at 02:09
  • @GlennFerrieLive Hey, I think I should sort out my issues. I'll definitely refer to the thread. – Quv Jul 24 '12 at 02:52

6 Answers6

4

I'm using VS 2017.

  • Go to Project Properties

  • Select the Publish page

  • Select the Updates... button

  • Change the Update Location at the bottom of the page to match your new location

EllieK
  • 259
  • 4
  • 14
2

There is a utility called Mage or MageUI that Microsoft provides to edit and managing the manifest for clickonce deployments. I've primarily used it to change and re-sign apps that I needed to deploy in a remote location.

link: http://msdn.microsoft.com/en-us/library/xhctdw55(v=vs.80).aspx

Glenn Ferrie
  • 10,290
  • 3
  • 42
  • 73
  • Thanks, I just noticed and used it. My last issue is, I think using Mage.exe/MageUI.exe is essentially the same as tweaking .application file (Deployment manifest) on Notepad. Every time I publish a ClickOnce app on my Visual Studio 2005, there is a wrong URL in the DeloymentProvider codebase attribute, which should be corrected before the app is published, in the first place. – Quv Jul 24 '12 at 02:46
  • Its in the "Publish area" of the Project Properties. I will post an image from VS 2010, but it should be in approximately the sample place in 2005. – Glenn Ferrie Jul 24 '12 at 04:17
2

enter image description here

Navigate to the Project Properties (dbl-click on 'Properties' in the Solution Explorer).

Go to 'Publish' tab. Edit Configuration.

(see screenshot)

Glenn Ferrie
  • 10,290
  • 3
  • 42
  • 73
  • Yeah, I did so, on My Visual Studio 2005, and even after filling both fields, my deploymentProvider attribute had a wrong URL... – Quv Jul 25 '12 at 07:51
  • 2
    You should consider opening the vsproj file in a text editor and find it there and replace it. – Glenn Ferrie Jul 25 '12 at 14:31
  • 4
    Editing the project worked. I found out you can do this by clicking the "Updates..." button in the screen shot posted. – heringer Sep 12 '14 at 16:58
0

After doing some test I found this is InstallURL property. With MSBuild you can use

/p:InstallURL=http://www.http://foo.jp/foo/ClickOnce/

or you can open your csproj file and add the InstallURL in the correct section. I cannot really help on this part because I use the command line feature.

And here is the full command line I use to build my application for ClickOnce deployment with Azure DevOps.

/target:publish 
/p:ApplicationVersion=$(Build.BuildNumber) 
/p:InstallURL=http://install-staging.newsprintgroup.com/ 
#/p:PublishURL=http://install-staging.newsprintgroup.com/ #This one is not working for me
/p:UpdateEnabled=true 
/p:UpdateMode=Foreground  
/p:ProductName="App Staging" 
/p:OutputPath="$(build.ArtifactStagingDirectory)\Publish\\" #With the double backslash
Bastien Vandamme
  • 17,659
  • 30
  • 118
  • 200
  • 1
    An important detail: leave the slash or backslash at the end of the `InstallURL`! There is no check when creating `deploymentProvider`, just concatenation. – Mike Mar 25 '21 at 07:12
  • @Mike missing the slash created some url with the manifset name repeated at the end, so thanks for pointing that out – Matthias Herrmann Feb 18 '22 at 10:14
0

you need to pass both /property:InstallURL and /property:UpdateEnabled=true to set the deploymentProvider

0

I thought it might be worth adding the approach we used to accomplish this through DevOps. The process still utilizes mage as Glenn Ferrie referenced above.

If you are signing the application this process must be done prior signing.

You will add a Command Line task to your Agent Job. Name the task as you see fit, and set the script as follows (updating any paths or variables as needed):

$(Mage)\mage.exe -Update $(app.publish)\fooApp.application -pu http://foo.jp/foo/ClickOnce/fooApp.application

I will note that we also had to update the bootstrapper for our needs as well. That is outside the scope of the question here, but for those that need to update the bootsrapper URL we used the following procedure in DevOps.

We added a separate Command Line task with the following script (again, update your names and paths/variables as needed):

$(app.publish)\setup.exe -url="http://foo.jp/foo/ClickOnce/"
Kevin Piatt
  • 61
  • 1
  • 2