msiexec:将网站静默部署到IIS

msiexec:将网站静默部署到IIS,iis,windows-installer,Iis,Windows Installer,我们的团队已经编写了一个包装应用程序/接口,使用msiexec以静默方式安装一系列msi 我的问题与安装针对IIS的msi有关 我一直收到以下错误 错误1314。指定的路径“默认网站/ROOT/someVirtual”为 不可用的Internet信息服务器可能未运行,或者 该路径存在并被重定向到另一台计算机。请检查一下电话号码 Internet服务管理器中此虚拟目录的状态 执行msi时,以下参数设置如下 msiexec.exe /i "D:\SOME.msi" UseShellExecute="

我们的团队已经编写了一个包装应用程序/接口,使用msiexec以静默方式安装一系列msi

我的问题与安装针对IIS的msi有关

我一直收到以下错误

错误1314。指定的路径“默认网站/ROOT/someVirtual”为 不可用的Internet信息服务器可能未运行,或者 该路径存在并被重定向到另一台计算机。请检查一下电话号码 Internet服务管理器中此虚拟目录的状态

执行msi时,以下参数设置如下

msiexec.exe /i "D:\SOME.msi" UseShellExecute="false" TARGETSITE="Default Web Site" TARGETVDIR="someVirtual" TARGETAPPPOOL="DefaultAppPool" /qn /l* D:\SOME_log.txt
我意识到这个问题与IIS密切相关,因为我可能缺少一些需要设置的设置/选项

据我所知,我的虚拟机位于“NT4334RB\Sites\Default Web Site\someVirtual”位置,因此我最好的猜测是“Default Web Site/ROOT/someVirtual”-ROOT是问题所在,需要设置,但设置为什么?怎么做

我只是在日志文件中遇到了这一行-我想这可能有用吗

正在从Url键“TARGETURL”获取批准


我的问题似乎与我没有正确指定元数据库路径有关。 最后,我在代码中添加了一个助手

找到了各种解决方案(让我朝着正确的方向思考)&我还安装了一个名为

//Added for reference purposes
//HasRequiredOption("site|s=", "The site location", c =>
//AddOrUpdateAdditionalMsiProperty("TARGETSITE", BuildMetabasePath(c)));

//apppool => TARGETAPPPOOL
//virtualdir => TARGETVDIR

/// <summary>
/// Builds the meta-base path.
/// </summary>
/// <param name="websiteName">Name of the website.</param>
/// <returns>The fully constructed meta-base path</returns>
private string BuildMetabasePath(string websiteName)
{
    return "/LM/W3SVC/" + this.GetWebSiteId(websiteName);
}

/// <summary>
/// Gets the web site id.
/// </summary>
/// <param name="websiteName">Name of the website.</param>
/// <param name="serverName">Name of the server. Defaults to: localhost if none specified</param>
/// <returns>The website id</returns>
private string GetWebSiteId(string websiteName, string serverName = "localhost")
{
    using (var entries = new DirectoryEntry(string.Format("IIS://{0}/w3svc", serverName)))
    {
        var children = entries.Children.Cast<DirectoryEntry>();
        var sites =
           (from de in children
             where
             de.SchemaClassName == "IIsWebServer" &&
             de.Properties["ServerComment"].Value.ToString() == websiteName
             select de).ToList();

       if (sites.Any())
       {
          return sites.First().Name;
       }
   }

  return "-1";
}
//添加以供参考
//HasRequiredOption(“站点| s=,“站点位置”,c=>
//AddOrUpdateAdditionalMsiProperty(“TARGETSITE”,BuildMetabasePath(c));
//apppool=>TARGETAPPPOOL
//virtualdir=>TARGETVDIR
/// 
///构建元基路径。
/// 
///网站名称。
///完全构造的元基路径
私有字符串BuildMetabasePath(字符串网站名)
{
返回“/LM/W3SVC/”+this.GetWebSiteId(websiteName);
}
/// 
///获取网站id。
/// 
///网站名称。
///服务器的名称。如果未指定,则默认为:localhost
///网站id
私有字符串GetWebSiteId(字符串websiteName,字符串serverName=“localhost”)
{
使用(var entries=newdirectoryEntry(string.Format(“IIS://{0}/w3svc”,serverName)))
{
var children=entries.children.Cast();
变异位点=
(摘自《儿童》杂志)
哪里
de.SchemaClassName==“IIsWebServer”&&
de.Properties[“ServerComment”].Value.ToString()==网站名
选择de).ToList();
if(sites.Any())
{
返回sites.First().Name;
}
}
返回“-1”;
}

您使用什么工具生成此MSI。MSI本机不支持IIS,因此此功能由自定义逻辑提供。我看到您正在无声地运行应用程序。在移动到InstallExecuteSequence之前,以交互方式运行它们并仔细检查安装程序设置\从用户收集的所有属性可能会很有用。另一方面,UseShellExecute属性大小写混合,因此是私有的。在命令行上设置它可能对静默安装没有影响。谢谢你的建议。如果您感兴趣,请参阅我接受的答案。我们正在使用本机VS2010部署项目来创建MSI。我们需要的是在构建应用程序后将其自动部署到alpha环境。当我使用GUI运行安装程序时,MSI运行良好,据我所知,它需要我问题中列出的那些参数。我需要添加UseShellExecute属性以允许设置一些参数,因为没有它安装失败。