ClickOnce question

K

king kikapu

Hi, i have the following scenario and i am struggled to fidn a
solution.

I have made an app that i want to distribute with ClickOnce. That app
enables the use to change some settings and these settings are saved
in a file. The app when loads, it loads that .xml file and updates
some data structures in the program so the use has back his personal
settings.
If the program does not find this file, it initializes these
structures with some default values and thus, i do not distribute
initialy any file with my app.

So i publish my app to a software repository and users happily get it.
They run it for the first time, program see that settings file does
not exist and does what i said above.
But at next update that i make, i figured out that ClickOnce makes
another directory in C:\Documents and Settings\..., copies the files
form the repository and hence, no settings file again!
So program starts and user settings are lost!

Has anybody an idea how i can overcome this ?? I have seen several
problems with ClickOnce and i am sceptical about using it or i roll-up
my own (more simpler of cource) distrib. solution.


Thanks for any help!
 
T

Tim Jarvis

king said:
Has anybody an idea how i can overcome this ?? I have seen several
problems with ClickOnce and i am sceptical about using it or i roll-up
my own (more simpler of cource) distrib. solution.


Thanks for any help!

Ok, I guess I need to make an assumption here, my assumption is that
you save the configuration file into the same directory as the
application, quite rightly you see that each time you update the
application the install directory is also changed.

The mechanism that click-once uses for data files that need to remain
after an update is to put them into a Data Directory for your app that
doesn't change, the good news is this is built in, you can get that
programatically from the ApplicationDeployment class i.e.
ApplicationDeployment.CurrentDeployment.DataDirectory

Cheers Tim.

--
 
K

king kikapu

Thank you both. Yesterday, i split this data file to be written (and
readn from) MyDocuments so i avoid the problem. But i will look at you
solutions as they seem interesting.

Thanks again!
 

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