Solved

.NET ClickOnce publishing question

Posted on 2011-09-10
8
560 Views
Last Modified: 2012-06-21
I'm building an application that loads some configuration data from a remote database. Depending on the data that has been loaded, this application will perform different tasks. It will also output log files to the directory it has been installed in.

The configuration id (that tell the database what to settings to pull) is located in Properties.Settings.Default.XXX

I'm looking to use clickonce so that I can easily push updates to the application.

The tricky part here is that, because the application performs differently based on configuration data, there will be multiple instances of this application running on the same machine.

Is it possible to install (and run) the same clickonce application multiple times on the same machine so that the Properties.Settings.Default.XXX settings are able to stay unique? This way once an application is updated it is able to resume operating with these saved settings and pull the appropriate configuration data from my database?

I'd like to, for example, be able to install these applications in directories like:

c:\app1
c:\app2
c:\app3
etc.

Is this possible?
0
Comment
Question by:mcainc
  • 4
  • 4
8 Comments
 
LVL 40
ID: 36518559
Click once installation does not let you choose an install directory.

When you say that settings are "able to stay unique", do you mean unique for each instance of the application, or unique (shared) for all the instances?

There are 2 kinds of settings. Application settings are shared by all users on the computer but are readonly. User settings are independant for each user, but are read and write. There is no way to have different configurations for different instances of the same application running under the same user name.

If you want to have different settings for different instances of the same application, you need to compile and install the application under 3 different names, or use something else than the standard application settings used in .NET.
0
 

Author Comment

by:mcainc
ID: 36518586
I meant unique for each instance of the application.

Currently (without clickonce) I can run multiple instances of the same .exe and preserve application settings as long as the exes are in separate directories. It's just a pain to manually update each .exe when I've a new version.
0
 
LVL 40
ID: 36519059
They you will have either to forget about ClickOnce or implement your own configuration system.

Could this settings be readonly, or do they have to be modified by the application?
0
Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

 

Author Comment

by:mcainc
ID: 36520148
They don't necessarily need to be modified by the application. The setting is actually used to load specific configuration data from a database (i.e., .... WHERE config_id = XX). All I need to figure out is a way to be able to run multiple instances of the same application, yet, have them able to use separate config ids.

I suppose clickonce won't let me do this?
0
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 500 total points
ID: 36520591
No, ClickOnce won't let you do this.

You have to implement something of your own if you want to use ClickOnce as a deployment system for such needs.

One idea.

Deploy the application along with a launcher application.

You do not start the application itself, you start the launcher. The launcher starts as many instances of the application as you need (look for Process.Start in the documentation), passing each of then the ID as a command parameter (look for CommandLine in the documentation). No need for configuration files.
0
 

Author Comment

by:mcainc
ID: 36520649
Thanks James,

It is definitely looking like ClickOnce is out. I've found something that looks like it should work perfect for what I'm after http://netsparkle.codeplex.com/

Thanks again for your help!
0
 

Author Closing Comment

by:mcainc
ID: 36520650
thanks again!
0
 
LVL 40
ID: 36520996
Good luck.

Keep up posted when you have tried it. I would be interested in knowing if it works well.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Visual Studio npm 1 29
Why use this lambda? 12 64
Asp.Net Session Question 2 36
parsing question on dynamic concatenation 3 34
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question