1

I'm using the InstallShield 2011 Automation Interface to create my installer. During the build log files are generated in the MSI_English\LogFiles folder.

Is it possible to redirect the log to the console. This would be more convenient for my build server.

Shane Gannon
  • 6,770
  • 7
  • 41
  • 64

1 Answers1

1

The simple answer may be to use iscmdbld.exe instead of the automation interface. This already sends messages to the console.

The more complex answer should be to use build status events (its VB sample is excerpted below). In particular you will want to handle the StatusMessage event. Note that you'll want to change the instances of 21 to match the version of the rest of your automation script.

Public WithEvents pISWiRelease As ISWiAuto21.ISWiRelease

Private Sub Foo()
    Dim pISWiProject As IswiAuto21.ISWiProject
    Set pISWiProject = CreateObject("IswiAuto21.ISWiProject")
    pISWiProject.OpenProject "C:\InstallShield 2014 Projects\My Project Name-1.ism", False
    Set pISWiRelease = pISWiProject21.ISWiProductConfigs("Product Configuration 1").ISWiReleases("Release 1")
    pISWiRelease.Build
    pISWiProject.CloseProject
    Set pISWiRelease = Nothing
    Set pISWiProject = Nothing
End Sub

Private Sub pISWiRelease_ProgressIncrement(ByVal lIncrement As Long, pbCancel As Boolean)
    ' Place your code here
End Sub

Private Sub pISWiRelease_ProgressMax(ByVal lMax As Long, pbCancel As Boolean)
    ' Place your code here
End Sub

Private Sub pISWiRelease_StatusMessage(ByVal sMessage As String, pbCancel As Boolean)
    ' Place your code here
End Sub
Michael Urman
  • 15,737
  • 2
  • 28
  • 44
  • Any suggestions on how this would work with JScript? Not getting where it registers as an event observer - but thats likely my lack of experience with VB. – Shane Gannon Jun 26 '14 at 17:19
  • In the VB example, it's magic involving the leading `WithEvents` line. In C++ the overall technique is called Connection Points. In C# it's events and delegates. Some searches suggest it might turn into `attachEvent` or `addEventListener` in JScript (something like `pISWiRelease.attachEvent("StatusMessage", f)`), but I'm unfamiliar with exactly how to do this. Hopefully that's at least good keywords for your searches! – Michael Urman Jun 26 '14 at 17:30