将InstallShield日志重定向到控制台

时间:2014-06-23 17:06:12

标签: installshield

我正在使用InstallShield 2011自动化界面来创建我的安装程序。在构建期间,日志文件在MSI_English \ LogFiles文件夹中生成。

是否可以将日志重定向到控制台。这对我的构建服务器来说会更方便。

1 个答案:

答案 0 :(得分:1)

简单的答案可能是使用iscmdbld.exe而不是自动化界面。这已经将消息发送到控制台。

更复杂的答案应该是use build status events(其VB样本摘录如下)。特别是您需要处理StatusMessage事件。请注意,您希望更改21的实例以匹配自动化脚本其余部分的版本。

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