C#Installer,安装文件 [英] C# Installer , Setup file

查看:112
本文介绍了C#Installer,安装文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有使用Sql Server 2008 R2作为数据库的AC#2010 Windows应用程序和

.Net Framework 4.0

和设置自动将.mdf文件附加到sqlserver

...........

我的意思是我不想让客户自己附上.mdf文件

并希望所有先决条件都包含在我的应用程序中:.Net Framework和Crystal report等等

........

一般情况下,我希望我的应用程序的安装文件在没有客户帮助的情况下自行完成所有配置

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

推荐答案

看起来您想要在解决方案中添加另一个项目。它将是一个类库。在该项目中,从 System.Configuration.Install.Installer [ ^ ]。使用 RunInstaller属性 [ ^ ]并覆盖 OnBeforeInstall() [ ^ ], OnBeforeRollback() [ ^ ], ONA fterRollback() [ ^ ], OnAfterInstall() [ ^ ], OnBeforeUninstall() [ ^ ]和 OnAfterUninstall() [ ^ ]您需要的方法。



您触发它们就像描述在其中 [ ^ ]。该链接还告诉您如何将参数传递给自定义操作方法。
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.


这篇关于C#Installer,安装文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆