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

What the heck am I doing wrong here?


4 replies to this topic

tbrinkm

tbrinkm
  • Members
  • 10 posts

Posted 25 September 2001 - 15:34

I've got a custom action, running on commit, which runs the following bit of VBScript.  If I tell it to ignore the return code, I either get a message box with 'Web\', or absolutely nothing.  It used to work, (and still does, if I edit it so DirPath is a constant string, and run it outside of the install), but it doesn't seem to be able to get the value of INSTALLDIR.  What am I missing?

- - - - -
Option Explicit

Dim DirPath
Dim WebPath
Dim defaultDocName
Dim www
Dim app

DirPath = Session.Property("INSTALLDIR") & "Web\"
MsgBox DirPath
WebPath = "TRS"
defaultDocName = "default.asp"

Set www = GetObject("IIS://LOCALHOST/W3SVC/1/Root")
If Err.Number <> 0 Then
MsgBox "An error occured while creating the website." & vbCrLf & Err.Number & vbCrLf & Err.Source & vbCrLf & Err.Description, 16
else
Set app = www.Create("IISWebVirtualDir", WebPath)
If Err.Number <> 0 Then
MsgBox "An error occured while creating the website." & vbCrLf & Err.Number & vbCrLf & Err.Source & vbCrLf & Err.Description, 16
else
app.AppRoot = "/LM/W3SVC/1/Root/" + WebPath
app.AppFriendlyName = WebPath
app.AppAllowDebugging = False
app.AccessExecute = True
app.AspBufferingOn = True
app.AspScriptTimeout = 900
app.AccessScript = True
app.Path = dirPath
app.Defaultdoc = defaultDocName
app.SetInfo
MsgBox "The TRS web site has been created.", 64
End If
End If

Set app = Nothing
Set www = Nothing


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 25 September 2001 - 18:32

Commit is one sort of deferred execution custom actions. Most properties are not available there.
Read my article in the InstallShield Newsletter for information about custom action scheduling.
http://www.installsh...L-NL....article


tbrinkm

tbrinkm
  • Members
  • 10 posts

Posted 25 September 2001 - 18:37

Ok.  I need to run this action AFTER the files have been installed, or it will fail because the directory does not exist.  How should it be scheduled so that I can still access INSTALLDIR?

Also, I have a pair of CAs after this one that execute an EXE, and include [INSTALLDIR] in the command-line arguments.  They work OK.  Is it just the difference between the two CA Types, or is it something else?

(Edited by tbrinkm at 1:44 pm on Sep. 25, 2001)


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 26 September 2001 - 07:44

[INSTALLDIR] in the command line will be resolved when the script is built.
You have two options:

a) use a deferred (not commit) custom action, scheduled after InstallFiles. This would require that you store INSTALLDIR in CustomActionData (that is described in MSI help). You also want a corresponding rollback action in this case, to undo the changes your CA makes in case the installation is cancelled.

b) Use an immediate CA scheduled after InstallFinalize. This will have access to INSTALLDIR, but it will not roll back if setup is cancelled.