Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > How can I overwrite the previous clickOnce deployment (rather than piling on new ones)?
 

How can I overwrite the previous clickOnce deployment (rather than piling on new ones)?

I "ClickOnce deployed" my app to be accessed over the network by deploying it to my shared directory:

C:\SharedApps\Application Files\WPFShowcaseApp_1_0_0_0

and then updated it, and "ClickedOnce" again (I clicked twice, I guess). This created the dir:

C:\SharedApps\Application Files\WPFShowcaseApp_1_0_0_1

How can I get it to overwrite version 1.0.0.0, rather than create a separate version 1.0.0.1?

I want users on the network who are runningapps from the server to automatically get the updated version, which I don't think they will if they are in a different directory altogether.

Delphi ancient/C# newbie
Clay Shannon  Friday, June 19, 2009 6:58 PM

What is the publish location of the files, and the installation url? The installation URL needs to be what your users will use to install the application.

In the case of putting the deployment on a network share, this will point to the folder above the \application files\ folder you are referring to. In the folder above, it will have a setup.exe, a .application file, and a publish.htm file if you asked for one. These are the files used by the user to install the application. The .application file and setup.exe know to use the folder under the \application files\ folder to pick up the right version.

You must deploy subsesquent versions with higher version numbers, or the users will not get an update. You should NOT be pointing them to the application file under the \application files\ folder, but to the one in the folder above that.

RobinDotNet


Click here to visit my ClickOnce blog!
RobinDotNet  Saturday, June 20, 2009 1:43 AM

Yes. In fact, I think it works smoother if hosted from a website.

You can create it on pretty much any web server, even Apache (doesn't have to be Windows Server). A couple of things to note:

1) If you want to deploy to a Windows Server using http, you have to install the Front Page Extensions on it. If you use FTP, you don't.

2) You need these MIME types defined on the web server:

.application --> application/x-ms-application
.manifest --> application/x-ms-application
.deploy --> application/octet stream

If you are deploying .Net 3.5 as a prerequisite, you need these as well:

.msp --> application/microsoftpatch
.msu --> application/microsoftupdate

If you have vsto apps, you need this one:

.vsto --> application/x-ms-vsto

RobinDotNet


Click here to visit my ClickOnce blog!
RobinDotNet  Friday, July 31, 2009 8:36 AM

What is the publish location of the files, and the installation url? The installation URL needs to be what your users will use to install the application.

In the case of putting the deployment on a network share, this will point to the folder above the \application files\ folder you are referring to. In the folder above, it will have a setup.exe, a .application file, and a publish.htm file if you asked for one. These are the files used by the user to install the application. The .application file and setup.exe know to use the folder under the \application files\ folder to pick up the right version.

You must deploy subsesquent versions with higher version numbers, or the users will not get an update. You should NOT be pointing them to the application file under the \application files\ folder, but to the one in the folder above that.

RobinDotNet


Click here to visit my ClickOnce blog!
RobinDotNet  Saturday, June 20, 2009 1:43 AM

What is the publish location of the files, and the installation url? The installation URL needs to be what your users will use to install the application.

In the case of putting the deployment on a network share, this will point to the folder above the \application files\ folder you are referring to. In the folder above, it will have a setup.exe, a .application file, and a publish.htm file if you asked for one. These are the files used by the user to install the application. The .application file and setup.exe know to use the folder under the \application files\ folder to pick up the right version.

You must deploy subsesquent versions with higher version numbers, or the users will not get an update. You should NOT be pointing them to the application file under the \application files\ folder, but to the one in the folder above that.

RobinDotNet


Click here to visit my ClickOnce blog!

I don't understand all that you said, but I'm publishing the files to a shared directory ("SharedApps") on my machine. When I create the ClickOnce deployment, it creates a subdirectory off of that, namely"C:\SharedApps\Application Files\WPFApp_1_0_0_0" which contains the following files (no setup.exe):

WPFApp.application
WPFApp.exe.deploy
WPFApp.exe.manifest

To install the app, users simplymap a drive to my shared directory, navigateto C:\SharedApps\Application Files\WPFApp_1_0_0_0, and run the WPFApp.application file.
Delphi ancient/C# newbie
Clay Shannon  Monday, June 22, 2009 3:03 PM

To put it bluntly, if you have your users install and run the application by clicking on the ApplicationFiles\WPFApp_1_0_0_0\WPFApp.application file, you will be s.o.l. if you ever want to push an update.

What is your Publishing Folder Location in Visual Studio, and the Installation Folder URL?

Are you using VS2005 or VS2008? Is your application online-only or online/offline?

Go into Options under the Publish tab, and find where you can specify the deployment web page, put in "publish.htm", then check the box that says "automatically generate deployment web page after every publish", and the one that says "open deployment web page after publish". This will force VS to push a publish.htm page that can be used to install your application.

Now go find where it put it. If you are using VS2005, it is probably in C:\SharedApp\, along with the setup.exe and WPFApp.Application file.

You can not publish a clickonce application without getting the setup.exe file and the yourappname.application file.

RobinDotNet


Click here to visit my ClickOnce blog!
RobinDotNet  Tuesday, June 23, 2009 12:37 AM

Hi Clay,

> To install the app, users simplymap a drive to my shared directory, navigateto C:\SharedApps\Application Files\WPFApp_1_0_0_0, and run the WPFApp.application file.

Why not navigate to C:\SharedApps and run the WPFApp.application file there?

The WPFApp.application which resides parallel with the Application Files folder is the copy of the latest version of deployment manifest.

That's to say,if the latest version is 1.0.0.0, the C:\SharedApps\WPFApp.application is the copy of the
C:\SharedApps\Application Files\WPFApp_1_0_0_0\WPFApp.application;
if the latest version is 1.0.0.1, it's the copy of the
C:\SharedApps\Application Files\WPFApp_1_0_0_1\WPFApp.application.

So if the user runs the C:\SharedApps\WPFApp.application, he/she will always get the latest version of the application.

Sincerely,
Linda Liu


Please remember to mark the replies as answers if they help and unmark them if they provide no help. end us any feedback you have about the help from MSFT at fbmsdn@microsoft.com.
Linda Liu  Tuesday, June 23, 2009 7:28 AM

Hi Clay,

> To install the app, users simplymap a drive to my shared directory, navigateto C:\SharedApps\Application Files\WPFApp_1_0_0_0, and run the WPFApp.application file.

Why not navigate to C:\SharedApps and run the WPFApp.application file there?

The WPFApp.application which resides parallel with the Application Files folder is the copy of the latest version of deployment manifest.

That's to say,if the latest version is 1.0.0.0, the C:\SharedApps\WPFApp.application is the copy of the
C:\SharedApps\Application Files\WPFApp_1_0_0_0\WPFApp.application;
if the latest version is 1.0.0.1, it's the copy of the
C:\SharedApps\Application Files\WPFApp_1_0_0_1\WPFApp.application.

So if the user runs the C:\SharedApps\WPFApp.application, he/she will always get the latest version of the application.

Sincerely,
Linda Liu


Please remember to mark the replies as answers if they help and unmark them if they provide no help. end us any feedback you have about the help from MSFT at fbmsdn@microsoft.com.

<<Why not navigate to C:\SharedApps and run the WPFApp.application file there? >>

Yes, that seems to work; but I was confused because an earlier comment said there should be a setup.exe file there, and there isn't - no such animal was created.
Delphi ancient/C# newbie
Clay Shannon  Tuesday, June 23, 2009 2:12 PM

To put it bluntly, if you have your users install and run the application by clicking on the ApplicationFiles\WPFApp_1_0_0_0\WPFApp.application file, you will be s.o.l. if you ever want to push an update.

What is your Publishing Folder Location in Visual Studio, and the Installation Folder URL?

Are you using VS2005 or VS2008? Is your application online-only or online/offline?

Go into Options under the Publish tab, and find where you can specify the deployment web page, put in "publish.htm", then check the box that says "automatically generate deployment web page after every publish", and the one that says "open deployment web page after publish". This will force VS to push a publish.htm page that can be used to install your application.

Now go find where it put it. If you are using VS2005, it is probably in C:\SharedApp\, along with the setup.exe and WPFApp.Application file.

You can not publish a clickonce application without getting the setup.exe file and the yourappname.application file.

RobinDotNet


Click here to visit my ClickOnce blog!

<<What is your Publishing Folder Location in Visual Studio, and the Installation Folder URL?>>

Publishing folder is what I mentioned: C:\SharedApp\<AppName>
Installation Folder URL? I have no idea; as far as I know, there isn't one.
After running the ClickOnce wizard, I found the files beneath C:\SharedApp\<AppName>, but no indication of an installation URL.

<<Are you using VS2005 or VS2008? Is your application online-only or online/offline?>>

VS2008. Online/Offline.

<<Go into Options under the Publish tab, >>

I don't see a Publish tab; I have a Publish menu item beneath the Build top-level menu, which starts the Wizard, but no such tab.
Delphi ancient/C# newbie
Clay Shannon  Tuesday, June 23, 2009 2:17 PM
Hi Clay,

> there should be a setup.exe file there, and there isn't - no such animal was created.

Right click the project in Solution Explorer and choose Properties in the shortcut menu. In the Project Designer, switch to the Publish tab. Click the Prerequisites button on the right hand. In the Prerequisites dialog, there's an option of "Create setup program to install prerequisites components". If you select the checkbox before this option, the setup.exe will be created when the application is published; otherwise, the setup.exe won't be created when publishing.

> Installation Folder URL? I have no idea

In the Project Designer, switch to the Publish tab. There's an Installation URL textbox under the Publish Location section. If you input a file path, e.g. C:\SharedApps in the Publishing Location, you can input a URL, UNC path or file share in the Installation URL.

Sincerely,
Linda Liu
Please remember to mark the replies as answers if they help and unmark them if they provide no help. end us any feedback you have about the help from MSFT at fbmsdn@microsoft.com.
Linda Liu  Wednesday, June 24, 2009 3:47 AM
Hi Clay,

> there should be a setup.exe file there, and there isn't - no such animal was created.

Right click the project in Solution Explorer and choose Properties in the shortcut menu. In the Project Designer, switch to the Publish tab. Click the Prerequisites button on the right hand. In the Prerequisites dialog, there's an option of "Create setup program to install prerequisites components". If you select the checkbox before this option, the setup.exe will be created when the application is published; otherwise, the setup.exe won't be created when publishing.

> Installation Folder URL? I have no idea

In the Project Designer, switch to the Publish tab. There's an Installation URL textbox under the Publish Location section. If you input a file path, e.g. C:\SharedApps in the Publishing Location, you can input a URL, UNC path or file share in the Installation URL.

Sincerely,
Linda Liu
Please remember to mark the replies as answers if they help and unmark them if they provide no help. end us any feedback you have about the help from MSFT at fbmsdn@microsoft.com.


<<Right click the project in Solution Explorer and choose Properties in the shortcut menu. In the Project Designer, switch to the Publish tab. Click the Prerequisites button on the right hand. In the Prerequisites dialog, there's an option of "Create setup program to install prerequisites components". If you select the checkbox before this option, the setup.exe will be created when the application is published; otherwise, the setup.exe won't be created when publishing.>>

That checkbox ("Create setup program to install prerequisites components") was already selected, yet no setup.exe was produced - at least not where the other files were located. The items in the CheckListBox below that checkbox are: "Windows Installer 3.1" and ".NET Framework 3.5 SP1"

<<In the Project Designer, switch to the Publish tab. There's an Installation URL textbox under the Publish Location section. If you input a file path, e.g. C:\SharedApps in the Publishing Location, you can input a URL, UNC path or file share in the Installation URL.>>

The value there for my project is: "\\BCSHANP41\SharedApps\" (my machine name + my shared directory)
As you mention this can be a UNC path, I guess I'm OK there; I was just thrown off by the URL business - what could I enter here if I wanted to give users an URL/link they could browse to in order to download and install my app? Just anything, or does it have to be an URL I can somehow deduce? IOW, could I enter here: http://www.ThisGreatApp.com and have that be the valid URL for them to use? Or...?


Delphi ancient/C# newbie
Clay Shannon  Wednesday, June 24, 2009 3:16 PM
Hi Clay,

> no setup.exe was produced - at least not where the other files were located.

The setup.exe will be created in the publish location you specified.

If you specify the installation location as \\BCSHANP41\SharedApps, the user can install/run the application via this UNC.

> could I enter here: http://www.ThisGreatApp.com and have that be the valid URL for them to use? Or...?

Yes, you can. But the URL you input should exist before you publish the application.

Sincerely,
Linda Liu

Please remember to mark the replies as answers if they help and unmark them if they provide no help. end us any feedback you have about the help from MSFT at fbmsdn@microsoft.com.
Linda Liu  Thursday, June 25, 2009 4:19 AM
Hi Clay,

> no setup.exe was produced - at least not where the other files were located.

The setup.exe will be created in the publish location you specified.

If you specify the installation location as \\BCSHANP41\SharedApps, the user can install/run the application via this UNC.

> could I enter here: http://www.ThisGreatApp.com and have that be the valid URL for them to use? Or...?

Yes, you can. But the URL you input should exist before you publish the application.

Sincerely,
Linda Liu

Please remember to mark the replies as answers if they help and unmark them if they provide no help. end us any feedback you have about the help from MSFT at fbmsdn@microsoft.com.

<< > could I enter here: http://www.ThisGreatApp.com and have that be the valid URL for them to use? Or...?

Yes, you can. But the URL you input should exist before you publish the application. >>

So I have to create a web site (with asp.net or something) first, OK.
Delphi ancient/C# newbie
Clay Shannon  Thursday, June 25, 2009 2:29 PM
Hi Clay,

> no setup.exe was produced - at least not where the other files were located.

The setup.exe will be created in the publish location you specified.

If you specify the installation location as \\BCSHANP41\SharedApps, the user can install/run the application via this UNC.

> could I enter here: http://www.ThisGreatApp.com and have that be the valid URL for them to use? Or...?

Yes, you can. But the URL you input should exist before you publish the application.

Sincerely,
Linda Liu

Please remember to mark the replies as answers if they help and unmark them if they provide no help. end us any feedback you have about the help from MSFT at fbmsdn@microsoft.com.

<<The setup.exe will be created in the publish location you specified.>>

Oh, I see now - the setup.exe is placed in C:\SharedApps, rather than in C:\SharedApps\Application Files\WPFShowcaseApp_1_0_0_0 with the other generated files. I don't like this, because what if I want to put several different apps in C:\SharedApps? The latest setup.exe will overwrite the previous one[s]?

Delphi ancient/C# newbie
Clay Shannon  Thursday, June 25, 2009 2:33 PM
You don't have to push it to a web server and have a URL to it if you prefer to host it from a shared drive.

As I stated above, this is the structure of the ClickOnce deployment folders. It uses the setup.exe and the .application file to install the appropriate version. You can't change this, or it won't work.

Setup.exe is the bootstrapper -- it runs the prerequisites installations (if needed), then calls the .application file to install the ClickOnce application.

And you are right, it will overwrite the previous one. You need a different folder for each application, so you should have

c:\SharedApps\MyFirstApp\
c:\SharedApps\MySecondApp\
and so on

and under each My*App folder, it will have the setup.exe and .application file for the latest version, and the Application Files folder there as well, that contains all of the versions of the deployments.

RobinDotNet


Click here to visit my ClickOnce blog!
RobinDotNet  Thursday, June 25, 2009 7:03 PM
You don't have to push it to a web server and have a URL to it if you prefer to host it from a shared drive.

As I stated above, this is the structure of the ClickOnce deployment folders. It uses the setup.exe and the .application file to install the appropriate version. You can't change this, or it won't work.

Setup.exe is the bootstrapper -- it runs the prerequisites installations (if needed), then calls the .application file to install the ClickOnce application.

And you are right, it will overwrite the previous one. You need a different folder for each application, so you should have

c:\SharedApps\MyFirstApp\
c:\SharedApps\MySecondApp\
and so on

and under each My*App folder, it will have the setup.exe and .application file for the latest version, and the Application Files folder there as well, that contains all of the versions of the deployments.

RobinDotNet


Click here to visit my ClickOnce blog!
<<You don't have to push it to a web server and have a URL to it if you prefer to host it from a shared drive. >>

OK, but if I WANT to expose it via an URL (this WOULD be the most convenient for users), I must first create a web site at the URL I provide, right? Or...?

Delphi ancient/C# newbie
Clay Shannon  Thursday, June 25, 2009 8:42 PM

Yes. In fact, I think it works smoother if hosted from a website.

You can create it on pretty much any web server, even Apache (doesn't have to be Windows Server). A couple of things to note:

1) If you want to deploy to a Windows Server using http, you have to install the Front Page Extensions on it. If you use FTP, you don't.

2) You need these MIME types defined on the web server:

.application --> application/x-ms-application
.manifest --> application/x-ms-application
.deploy --> application/octet stream

If you are deploying .Net 3.5 as a prerequisite, you need these as well:

.msp --> application/microsoftpatch
.msu --> application/microsoftupdate

If you have vsto apps, you need this one:

.vsto --> application/x-ms-vsto

RobinDotNet


Click here to visit my ClickOnce blog!
RobinDotNet  Friday, July 31, 2009 8:36 AM

You can use google to search for other answers

Custom Search

More Threads

• VS6 Package and Deployment Wizard hangs on "Loading Package Types..."
• One ClickOnce application using a second ClickOnce application as a prerequisite
• Set isolated property for .NET assembly?
• SQLXML as a custom prerequisite
• positioning of messageboxes
• Visual Studio Installer and empty working dir in Desktop shortcut
• c# Publish Problem
• Unable to create test certificate
• Parameter passing without a web server
• deploy a populated table along with the connection to it from a WPF app.