Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Custom action dependant on component


2 replies to this topic

tbrinkm

tbrinkm
  • Members
  • 10 posts

Posted 11 September 2001 - 21:51

I have some code to create a Virtual Directory, and I think I've kind of figured out how to make it work as a custom action.  Unfortunately, I'm new to this and I can't figure out what I need in the condition to make sure it is only created when necessary.  I also need some help on sending a component's destination path in as a parameter.

Here's the code:

- - - - -

Option Explicit

CreateVirtualFolder([APP_NAME], [INSTALLDIR] & "Web\")

function CreateVirtualFolder(sName,sPath)
Dim oIIS, oDir

Set oIIS = GetObject("IIS://localhost/W3SVC/1/Root")
On Error Resume Next
Set oDir = oIIS.GetObject("IISWebVirtualDir", sName)
' This will return error -2147024893 if it doesn't exist

If Err.Number <> 0 Then Set oDir = oIIS.Create("IISWebVirtualDir", sName)
Err.Clear
oDir.AccessScript = True
oDir.Path = sPath

' Workaround for bug in II4
oDir.KeyType = "IIsWebVirtualDir"

oDir.SetInfo
oDir.AppCreate True
oDir.SetInfo
Set oDir = Nothing
Set oIIS = Nothing
end function

- - - - -

I only want to run this custom action if the web site feature is being installed, and I need to send the install path in.  What do I need to change to get this working.
    Thanks
    - Theo


Joe Fegan

Joe Fegan
  • Members
  • 38 posts

Posted 18 September 2001 - 17:18

Use a condition that refers to the action being taken on some component. For example "$MyComponent>2" is true if the component MyComponent is in the process of being installed.