Solved

.NET ClickOnce publishing question

Posted on 2011-09-10
8
556 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
 

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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

757 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now