By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,028 Members | 1,869 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,028 IT Pros & Developers. It's quick & easy.

ClickOnce Questions

P: n/a
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
Jul 12 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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

Jul 15 '07 #2

P: n/a
Hy Robin,

Thanks for your answers!
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.
With additional files, I mean for example my log-files, stored in
(Environment.GetFolderPath(Environment.SpecialFold er.LocalApplicationData),
which I create at startup of my program...how can I manage, that the
Bootsrapper run a program, which delete this files during the uninstall?

Thanks,
Peter
Jul 17 '07 #3

P: n/a
I don't think you CAN do custom stuff in an uninstall of a ClickOnce app.
If I remember, I'll look it up in Brian Noyes' ClickOnce book. I don't
remember seeing anything like that in there though.
Robin S.
----------------
"Peter Wyss" <pe****************@timeware.chwrote in message
news:%2***************@TK2MSFTNGP06.phx.gbl...
Hy Robin,

Thanks for your answers!
>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.

With additional files, I mean for example my log-files, stored in
(Environment.GetFolderPath(Environment.SpecialFold er.LocalApplicationData),
which I create at startup of my program...how can I manage, that the
Bootsrapper run a program, which delete this files during the uninstall?

Thanks,
Peter

Jul 24 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.