Click here to Skip to main content
15,890,882 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I have A C# 2010 Windows application that uses Sql Server 2008 R2 as Database and
.Net Framework 4.0
Now I wanna Make an installer / Make setup file for my App which including my database file
and the setup attaches the .mdf file to sqlserver automatically
...........
I mean i don't wanna the customer attach the .mdf file by him self
and wanna all prerequisites be included in my app like : .Net Framework and Crystal report and so on
........
In General i wanna my setup file of my app do all the configurations by it self without any help from the customer
Posted

1 solution

Looks like you want to add another project to your solution. It will be a class library. Within that project, derive a custom class from System.Configuration.Install.Installer[^]. Decorate it with the RunInstaller Attribute[^] and override those of the OnBeforeInstall()[^], OnBeforeRollback()[^], OnAfterRollback()[^], OnAfterInstall()[^], OnBeforeUninstall()[^] and OnAfterUninstall()[^] methods that you need.

You trigger them like described here[^]. The link also tells you how to pass parameters to your custom action methods.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900