1

I have a WPF (Clickonce) app. I want to find out which users are installing or re-installing the app, and probably write those info in a database for audit.

How can I do that?

2 Answers 2

1

The current ClickOnce deployment doesn't provide any server-side hooks for monitoring whatsoever (in fact, the "website" generated by ClickOnce publishing is just a very simple, plain HTML page providing a link/button for downloading and executing the .application or setup.exe, respectively, on the client machine. Everything else is taking place locally).

Now, depending on what you want to log (initial installations, or updates, or both) you have the following options:

  • Create your own website where user will register before getting access to the install/launch for the app (or maybe you just identify them by IP - depends on your needs) - this allows you to log who first installs the app, but not the automatic updates.
  • In your application, use the classes in the System.Deployment namespace (notably ApplicationDeployment) to access information about updates etc. whenever your application is run. You can then have your app make calls to a web service that you provide, where you can log any installation / launch action (or even other runtime information, like usage of certain features, exceptions etc).
Sign up to request clarification or add additional context in comments.

Comments

0

If you are targeting .NET 4, you can have the log files go to a specific folder. Then when the user runs the application, you can have it copy it to your server and delete it, or write it to a database and delete it. Here's an article explaining how to specify where to put the log from a ClickOnce deployment. Note that it runs when you install, update, or uninstall the application.

The registry settings are in HKCU, so you could have your C/O app actually set the info when it first installs. You'll miss the first install log, but it will write the logs to disk after that.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.