Reputation: 639
I am creating a WPF windows desktop application. I need to do some validation, while installation of the application, if the validation fails i need to stop the installation, else complete the installation.
Can this be achieved in Click Once?
I found this article: http://msdn.microsoft.com/en-us/library/dd997001.aspx for creating a custom installer. But it requires to create a seperate application and use the custom installer class to install the application. Is it possible to override the default installer?
Upvotes: 2
Views: 347
Reputation: 6477
As a workaround, you can split installation into two steps.
First make a standard installation for full application, lets call installation A.
Develop an application that read permission from DB and, if is a valid user, runs installation A, if not, run uninstall.
Make an standar installation for this new permission checker application, and make it run this aplication after install.
Upvotes: 0
Reputation: 2453
No, the only way you can do something like that with ClickOnce is using the customer installer that you have already found.
I would recommend doing any kind of validation against the authenticated user at install time because 2 users could use the same machine, one who is allowed to install and one who is not. The user who is allowed to install could do so, and the user who is not could then run it.
It's much better to authenticate users when your app is run as mclaassen suggested.
Upvotes: 1