drowned
drowned

Reputation: 550

Run an update program immediately after ClickOnce install

I've got a small WPF application which is being deployed to a client soon. One of the prerequisites is Sql Express 2008, and the clickonce installer handles that part nicely. My issue is that, after installation, I need to be able to unzip a backed up SQL DB, restore it, and set some user privileges. I have the SQL and the code needed to do this, but I can't seem to figure out how to inject it into the clickonce install process, or how to force it to run some kind of "update" right after installation, before loading up the application. Is there any way to do this?

Upvotes: 2

Views: 1338

Answers (2)

Richard Brightwell
Richard Brightwell

Reputation: 3012

Consider checking IsFirstRun in your application and performing additional setup at that time. Using this method you can do just about anything you want. Here's a snippet from a webpage with more details:

Use IsFirstRun to determine whether you need to perform any one-time initialization operations the first time your application runs.

Upvotes: 2

Emond
Emond

Reputation: 50692

Did you have a look at this? You could create a custom action.

I am not sure whether or not you will have/need elevated permissions but it might be worth a try,

Upvotes: 1

Related Questions