ClickOnce - Setting up a staging and production versions

G

Guest

I want to be able to install a staging version and production version on my
desktop of a ClickOnce application. I have created two separate virtual
directories on a web server. I changed the product name in the Publish -
Options dialog. When I install from the staging location, it overwrites my
production version that was installed from the production virtual directory.
Is there a product guid that is maintained?

Any way to accomplish this?
 
L

Linda Liu [MSFT]

Hi,

I am sorry that I may not understand your question exactly.

Each time you publish an application using ClickOnce with different
version, the staging version will be stored in the corresponding deployment
manifest file and folder.

For example, if the current version of the application you are publishing
is 1.0.0.3, after you finish publishing the application, a file
TestProj_1_0_0_3.application and a folder TestProj_1_0_0_3 appears in the
publish path. So you needn't create virtual directories on the web server.
If you want the user to restore the program to a previous version, i.e
1.0.0.2, you may exchange the names of the files TestProj.application and
TestProj_1_0_0_2.application.
When I install from the staging location, it overwrites my production
version that was installed from the production virtual directory. Is there
a product guid that is maintained?

Yes, if we install the application of previous version, it overwrites the
current version. From the view of the application, I think we could
distinguish them by the version. You may update the About information with
the current version of the program before you publish a new version.

Hope this helps.
If you have any questions, please feel free to let me know.


Sincerely,
Linda Liu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
G

Guest

Thanks Linda for the reply,

What I need to be able to do is to have two different versions on my machine
at the same time - production and staging. If I look in Add/Remove programs
I want to see two different installs. In the start menu - I see want too see
two different versions. Because it is the same application, Add/Remove
programs maintains the current version. I need to make ClickOnce think that
the same application is two different applications with their own installs.

Web Server view:
Virtual Directory - ApplicationProduction
Virtual Directory - ApplicationStaging

Both these virtual directories essentially contain the same files, just
at different
version levels.

Client System View
Add/Remove Programs entries
Production Application
Staging Application

Start Menu entries
Production Application
Staging Application

If I update the production version then the Production Application gets
updated and the Staging Application is not removed and stays the same.

If I update the staging version then the Staging Application gets updated
and the Production Application is not removed and stays the same.

Now if I was creating a msi package, I would give create two exact same
installs with different Product guids.

How do I get ClickOnce to accomplish this?
 
T

Tigger

Hi Bruce,

I've setup our application to do just this.

I have it automated using nant so I'm reverse engineering the scripts
to find out what I did...

First you need to edit your executable project file so that the
<msbuild:AssemblyName> element is different for your Staging and
Production version.

I think the assembly name is used to determine the uniqueness of an
application in the clickonce world so this is important.

Then you can build the project/solution e.g.

msbuild.exe
MySolution.sln
/target:rebuild
/p:Configuration=Debug
/p:publisherName='My Company'
/p:productName='MyProductStaging'
/p:ApplicationVersion='1.1.0'
/p:ApplicationRevision='123'
/p:OutputPath='c:\StagingOutput'
/p:ReferencePath='c:\References'
/p:publishUrl='http://www.mysite.com/Staging'
/p:InstallUrl='http://www.mysite.com/Staging'
/p:UpdateUrl='http://www.mysite.com/Staging'
/p:SupportUrl='http://www.mysite.com/Support.htm'
/p:ManifestKeyFile='C:\MyKey.pfx'
/verbosity:normal

make sure you change the ProductName, Urls and OutputPath for each of
your Staging and Production releases.

You should be able to copy the results from the Output folder to the
PublishUrl location and they should work as if they are different
applications.

You might be able to do all this within studio, not sure.

In our case I have it release a new Staging and Production application
every night from Source Control. It also publishes the Staging version
to the server. Publishing the Production version is done manually as
required.

Combine this with clickonce and our testers automatically get their
fixes the next day :)

Tigger
 
L

Linda Liu [MSFT]

Hi,

Thanks for your reply and the detailed explaination of the question.

You could use different certificate files to sign the clickonce manifests
in order to install the clickonce application as different applications.

Right-click the project node in the Solution Explorer and select Properties
from the shortcut menu to open the Project Designer. In the Project
Designer, select Signing tab. Click the "Select from Store" button on the
right panel and you will see all available certificate files listed in the
listbox in the "Select a Certificate" dialogbox. You could select different
certificate files for the Production Application and the Staging
Application.

If there's only one certificate file in the "Select a Certificate"
dialogbox, you could add a new certificate file. On the Signing tab, click
the "Create Test Certificate" button. In the "Create Test Certificate"
dialogbox, enter a password and press OK button. Click the "Select from
Store" button, you will see the new certificate file is added in the
certificate files listbox.

When you publish a new version for the Prodution Application, you should
use the same certificate file as the previous version of the Product
Application to sign the manifests. And the same to the Staging Application
when you publish a new version for the Staging Application.

Hope this helps.
If you have anything unclear, please feel free to let me know.


Sincerely,
Linda Liu
Microsoft Online Community Support
 
G

Guest

Thanks for responding to my post. It appears I have two different choices!
You way works well. Thanks.
 
T

Tigger

That seems to be a niced way to do it.

One problem I found with renaming the assembly is that it complicates
the use of reflection to create classes, as it cannot find the assembly
if its file name doesn't match its official assembly name.

Tigger
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top