在此项目中,添加对
System.EnterpriseServices
和
System.DirectoryServices
的引用,在操作
IIS
的时候,需要用到。在文件中添加:
using System;
using System.IO;
using System.DirectoryServices;
using System.Reflection;
using System.Data;
using System.Data.SqlClient;
using System.Configuration.Install;
using System.Management;
using System.Collections;
using Microsoft.Win32;
using System.Collections.Specialized;
如果编译的时候出错,请添加相关引用。
修改文件如下图:
注意要手动添加
Installer
!
将
DBSQL.txt
文件放到此项目中,在属性中设置为“嵌入的资源”
回到
MyWebSetup
项目,点击查看属性,可以设置安装文件到显示相关信息,如图
选择文件系统,如图: