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)
Manvendra Bele
  • 157
  • 1
  • 2
  • 10

2 Answers2

1

Error 0x80070002: Site not found for create application

Maybe this is caused by the lack of quotes, so instead of:

... iisvdir /create Default Web Site ...

Try:

... iisvdir /create "Default Web Site" ...

si618
  • 16,580
  • 12
  • 67
  • 84
0

Using simple batch files is not the best way to go about configuring IIS. For system administration tasks such as this, Microsoft created PowerShell.

Check out how to configure IIS using PowerShell here: http://www.iis.net/learn/manage/powershell.

Here's an example of how to use PowerShell to create a virtual directory in IIS:

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

The code above uses the PowerShell Snap-In for Creating Applications.

Good luck!

Roy Dictus
  • 32,551
  • 8
  • 60
  • 76
  • i am not good at powershell. I got this script from somewhere. What changes do i need to do to this script if i have to include above funtionality + uninstall and installation. Can you please help. – Manvendra Bele Jan 14 '13 at 11:19
  • the script is too long to past here. can u please give me a powershell script. – Manvendra Bele Jan 14 '13 at 11:21