First, please don't multi-post. If you want to ask the same question in
multiple groups, post to all of them at once, so if someone answers the
question, it's displayed in all groups.
1) XML files
If you include those with a Build Action of Data and mark them as "Copy
always" or "Copy if newer", they get put in the Data directory on the
client machine, accessible through code using
ApplicationDeployment.CurrentDeployment.DataDirect ory.
If they don't change with subsequent versions, they get copied from the
previous version's DataDirectory to the new version's DataDirectory.
If they do change on the server (in any way, even just the time stamp), the
new ones get copied from the server to the new version's DataDirectory on
the client machine, but the old ones are copied from the old version's
DataDirectory to a subfolder in the new version's DataDirectory, called
\.pre . You can access that through code. I believe that the fact that it
exists is reason enough to know you have an upgraded version.
If this is user settings, and you are creating it the first time the user
runs the application, try storing it in the Vista-approved location of
(Environment.GetFolderPath(Environment.SpecialFold er.LocalApplicationData)
That's what we do; we create a folder there with the name of our product,
and store our user config files there, so we don't have to worry about them
being moved in a ClickOnce installation.
This goes to the LocalSettings under the user's profile.
2) "Delete additional files" -- what does this mean? What additional files?
CLickOnce can't do this for you, but you can write a program to do this and
have the Bootstrapper run it.
3) "log file" -- what log file? Is it a log file that you are creating? You
need to put anything like this in the LocalSettings under the user's
profile. Unless you ask the user for the location, there is nowhere you can
put it that you are guaranteed access to, especially with the advent of
Windows Vista. The safest place is the one mentioned above, and give the
user a button that will open and display the log file.
There is a great book on ClickOnce by Brian Noyes that anyone using it
should check out. It helped me immensely.
Robin S.
-----------------------------------------------
"Peter Wyss" <pe****************@timeware.chwrote in message
news:uv**************@TK2MSFTNGP04.phx.gbl...
Hello!
I've a few questions about ClickOnce in VisualStudio 2005. The
installation of my application works fine, I published the files on a
webserver and installed the app on a winxp client, updates works also
fine. But here's my first question:
- Our app produces xml-files on startup, which stores several
informations like gui-settings etc...now when I publish a new version and
my app updates, this xml-files rested in the old folder and weren't
copied to the new one -so my app lost this settings...the same problem
with the logfiles? Any suggestions on this issue? How can I copy the
xml-files to the new folder during an update?
An additional question on this first one:
- How can I delete this additional files during an uninstall?
- How can I handle it, that our supporters find the log-file easy,
because the location changes from machine to machine?
Thanks,
Peter