0

I am trying to install application using a script. This application creates a virtual directory under Default Web Site in IIS. I have written this script. Is this right script or i am missing some thing.

cd C:\Users\Administrator\Desktop
msiexec /qb /i ZFPSetup.msi INSTALLLOCATION="C:\Program Files (x86)\Application" TARGETVDIR="ZFP" WIXUI_EXITDIALOGOPTIONALCHECKBOX=1 /l*v "C:\log.txt"
iisvdir /create Default Web Site ZFP C:\Program Files (x86)\Application\ZFP 
call "C:\Program Files (x86)\Application\StartKaraf.bat" echo error

I am getting below error:

MSI (s) (28:D0) [04:25:58:897]: Invoking remote custom action. DLL: C:\Windows\Installer\MSIF886.tmp, Entrypoint: WriteIIS7ConfigChanges
WriteIIS7ConfigChanges:  Error 0x80070002: Site not found for create application
WriteIIS7ConfigChanges:  Error 0x80070002: Failed to configure IIS application.
WriteIIS7ConfigChanges:  Error 0x80070002: WriteIIS7ConfigChanges Failed.
CustomAction WriteIIS7ConfigChanges returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
4

2 回答 2

1

错误 0x80070002:找不到创建应用程序的站点

也许这是由于缺少引号引起的,所以不是:

... iisvdir /create 默认网站 ...

尝试:

... iisvdir /create "默认网站" ...

于 2013-02-07T00:45:30.957 回答
0

使用简单的批处理文件并不是配置 IIS 的最佳方式。对于诸如此类的系统管理任务,Microsoft 创建了PowerShell

在此处查看如何使用 PowerShell 配置 IIS:http ://www.iis.net/learn/manage/powershell 。

下面是一个如何使用 PowerShell 在 IIS 中创建虚拟目录的示例:

PS IIS:\> New-Item 'IIS:\Sites\Default Web Site\DemoVirtualDir1' -type VirtualDirectory -physicalPath c:\test\virtualDirectory1

上面的代码使用PowerShell 管理单元来创建应用程序

祝你好运!

于 2013-01-14T10:42:25.050 回答