问题1+3部分:自动安装SQL Server数据库 
http://www.cnblogs.com/wangsaokui/articles/9769.aspx安装文件如何打包SQL数据库
http://community.csdn.net/Expert/TopicView.asp?id=3185458

解决方案 »

  1.   

    另外对于问题5,参考:如何将.net framework打包到安装程序中? 
    http://www.cnblogs.com/wangsaokui/articles/9669.aspx
      

  2.   

    5 方法一 加入到启动菜单
      方法二 加入到注册表HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
    新建字符串值并进行设置
     方法三 windows service启动后会在后台运行
    using System;
    using System.Collections;
    using System.ComponentModel;
    using System.Configuration.Install;
    using System.ServiceProcess;namespace Xiaoxiao.MHFTPServer
    {

    [RunInstaller(true)]
    public class Installer1 : System.Configuration.Install.Installer
    { private System.ComponentModel.Container components = null; private ServiceInstaller serviceInstaller;
    private ServiceProcessInstaller processInstaller;
    public Installer1()
    {

    InitializeComponent(); // TODO: Add any initialization after the InitComponent call
    processInstaller = new ServiceProcessInstaller();
    serviceInstaller = new ServiceInstaller();
     
    // The services will run under the system account.
    processInstaller.Account = ServiceAccount.LocalSystem;

    // The services will be started manually.
    serviceInstaller.StartType = ServiceStartMode.Automatic; // ServiceName must equal those on ServiceBase derived classes.            
    serviceInstaller.ServiceName = "MHFTPServer";
    serviceInstaller.DisplayName="MYHome个人主页基地FTP服务"; // Add installers to collection. Order is not important.
    Installers.Add(serviceInstaller);
    Installers.Add(processInstaller);
    } #region Component Designer generated code
    /// <summary>
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// </summary>
    private void InitializeComponent()
    {
    components = new System.ComponentModel.Container();
    }
    #endregion }
    }
      

  3.   

    在C#中使用PB的代码,不行吧。第2题恐怕没有答案。楼主可以考虑把PB的代码转为C#的代码试试,如果实在不行的话。
    余题请参考楼上各位大虾的答案。
      

  4.   

    其实中间件是C#,前台是PB,服务器需要提供PB升级程序
      

  5.   

    >>其实中间件是C#,前台是PB,服务器需要提供PB升级程序参考:
    在WinForm中使用Web Services 来实现 软件 自动升级( Auto Update ) (C#) 
    http://blogs.coder.cn/skyover/archive/2004/06/07/485.aspx
      

  6.   

    1.osql -E -n /Q "exec sp_addlogin '用户名', '密码', '数据库名' use sinofin exec sp_adduser '用户组', '这个我不知道了,呵呵', '权限'"
      

  7.   

    看样子老兄是想发布一个安装软件,为什么不试一试.net的安装程序