Wise WSE script for Trace32.EXE logging

Author Message
blaird

  • Total Posts : 46
  • Scores: 4
  • Reward points : 9320
  • Joined: 3/13/2006
  • Status: offline
Wise WSE script for Trace32.EXE logging Saturday, July 17, 2010 6:09 PM (permalink)
0
 
I seem to write a lot of installers within WSE scripts in my current environment.  I tend to do a lot of logging to help me assist the desktop technicians if an error occurs during the installation.  We have SMS/SCCM clients and have the Trace32.EXE tool for reviewing LOG files on the workstations.  Traditionally I would just use my own formatting for the log files and it was useful and well formated for Notepad (ok, so I'm old).  But this looked messy when opening the LOG with the Trace32.EXE tool.  So I decided to write a standard little sample script that can be used to write logging information from a WSE script into a Trace32.EXE format.
 
Just figured I'd share if anyone else was interested.  If there are any questions, let me know!
 
Brian
 

 
Trace32Test.wse
Document Type: WSE
item: Global
  Version=9.0
  Flags=00000100
  Languages=65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
  Copy Default=1
  Japanese Font Name=MS Gothic
  Japanese Font Size=9
  Start Gradient=0 0 255
  End Gradient=0 0 0
  Windows Flags=00000100000000000010110000001010
  Message Font=MS Sans Serif
  Font Size=8
  Pages Modified=00001000011000000000000000000000
  Extra Pages=00000000000000000000000000010000
  Disk Label=Default
  Disk Filename=SETUP
  Patch Flags=0000000000000001
  Patch Threshold=85
  Patch Memory=4000
  MIF PDF Version=1.0
  MIF SMS Version=2.0
  FTP Cluster Size=20
  Per-User Version ID=1
  Dialogs Version=7
  Crystal Format=10111100101100000010001001001001
  Variable Name1=_INIT_WINDOW_
  Variable Default1=HIDE
  Variable Flags1=00001000
  Variable Name2=_SYS_
  Variable Default2=C:\WINDOWS\System32
  Variable Flags2=00001000
  Variable Name3=_WIN_
  Variable Default3=C:\WINDOWS
  Variable Flags3=00001000
  Variable Name4=_WISE_
  Variable Default4=C:\Program Files\Wise Installation System
  Variable Flags4=00001000
end
item: Remark
end
item: Get Registry Key Value
  Variable=TZ-BIASA
  Key=SYSTEM\CurrentControlSet\Control\TimeZoneInformation
  Default=0
  Value Name=ActiveTimeBias
  Flags=00000100
end
item: Set Variable
  Variable=TLOG
  Value=%INST%\Trace32LogTesting.log
end
item: Remark
end
item: Set Variable
  Variable=COUNT
  Value=0
end
item: If/While Statement
  Variable=COUNT
  Value=10
  Flags=00011000
end
item: Custom Script Item
  Filename=Pause.wse
  Variable Name1=_PAUSE_TIME_
  Variable Value1=3000
  Variable Name2=HELPFILE
  Variable Value2=C:\Program Files\Wise Installation System\Help\Wise.hlp
end
item: Set Variable
  Variable=COUNT
  Value=%COUNT%
  Flags=00000100
end
item: Set Variable
  Variable=TMESSAGE
  Value=This is loop #%COUNT%
end
item: Set Variable
  Variable=TCOMPONENT
  Value=MyScript%COUNT%
end
item: Include Script
  Pathname=.\TRACE32LOG.WSE
end
item: End Block
end
item: Custom Script Item
  Filename=Pause.wse
  Variable Name1=_PAUSE_TIME_
  Variable Value1=5000
  Variable Name2=HELPFILE
  Variable Value2=C:\Program Files\Wise Installation System\Help\Wise.hlp
end
item: Set Variable
  Variable=TMESSAGE
  Value=This is the end of my sample script!
end
item: Set Variable
  Variable=TCOMPONENT
  Value=ExitComponent
end
item: Include Script
  Pathname=.\TRACE32LOG.WSE
end
item: Exit Installation
end
item: Remark
end
Trace32Log.wse
Document Type: WSE
item: Global
  Version=9.0
  Title=DateTimeNew
  Flags=00000100
  Languages=65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
  Copy Default=1
  Japanese Font Name=MS Gothic
  Japanese Font Size=9
  Start Gradient=0 0 255
  End Gradient=0 0 0
  Windows Flags=00000100000000000010110000001010
  Message Font=MS Sans Serif
  Font Size=8
  Pages Modified=00001000011000000000000000000000
  Extra Pages=00000000000000000000000000010000
  Disk Label=Default
  Disk Filename=SETUP
  Patch Flags=0000000000000001
  Patch Threshold=85
  Patch Memory=4000
  MIF PDF Version=1.0
  MIF SMS Version=2.0
  FTP Cluster Size=20
  Per-User Version ID=1
  Dialogs Version=7
  Crystal Format=10111100101100000010001001001001
  Variable Name1=_INIT_WINDOW_
  Variable Default1=HIDE
  Variable Flags1=00001000
  Variable Name2=_SYS_
  Variable Default2=C:\WINDOWS\System32
  Variable Flags2=00001000
  Variable Name3=_WIN_
  Variable Default3=C:\WINDOWS
  Variable Flags3=00001000
  Variable Name4=_WISE_
  Variable Default4=C:\Program Files\Wise Installation System
  Variable Flags4=00001000
end
item: Remark
end
item: Set Variable
  Variable=TLOG
  Value=%TLOG%
end
item: Set Variable
  Variable=TMESSAGE
  Value=%TMESSAGE%
end
item: Set Variable
  Variable=TCOMPONENT
  Value=%TCOMPONENT%
end
item: Set Variable
  Variable=TTHREAD
  Value=666
end
item: Set Variable
  Variable=TSOURCE
  Value=DummySource
end
item: Remark
end
item: Set Variable
  Variable=TRACEDATE
end
item: Set Variable
  Variable=TRACETIME
end
item: Remark
end
item: Set Variable
  Variable=SYSDATE
end
item: Set Variable
  Variable=SYSDATEYEAR
end
item: Set Variable
  Variable=SYSDATEMONTH
end
item: Set Variable
  Variable=SYSDATEDAY
end
item: Remark
end
item: Set Variable
  Variable=SYSTIME
end
item: Set Variable
  Variable=SYSTIMEHOUR
end
item: Set Variable
  Variable=SYSTIMEMINUTE
end
item: Set Variable
  Variable=SYSTIMESECOND
end
item: Remark
end
item: Get System Information
  Variable=SYSDATE
  Flags=00010011
end
item: Set Variable
  Variable=SYSTIME
  Value=%SYSDATE%
end
item: Remark
end
item: Parse String
  Source=%SYSDATE%
  Pattern=/
  Variable1=SYSDATEMONTH
  Variable2=SYSDATE
end
item: Parse String
  Source=%SYSDATE%
  Pattern=/
  Variable1=SYSDATEDAY
  Variable2=SYSDATE
end
item: Parse String
  Source=%SYSDATE%
  Pattern=/
  Variable1=SYSDATEYEAR
end
item: Parse String
  Source=%SYSDATE%
  Pattern=
  Variable1=SYSDATEYEAR
end
item: Remark
end
item: Parse String
  Source=%SYSTIME%
  Pattern=
  Variable2=SYSTIME
  Flags=00000100
end
item: Parse String
  Source=%SYSTIME%
  Pattern=:
  Variable1=SYSTIMEHOUR
  Variable2=SYSTIME
end
item: Parse String
  Source=%SYSTIME%
  Pattern=:
  Variable1=SYSTIMEMINUTE
  Variable2=SYSTIME
end
item: Parse String
  Source=%SYSTIME%
  Pattern=:
  Variable1=SYSTIMESECOND
  Variable2=SYSTIME
end
item: Remark
end
item: Remark
  Text=Allow for HOUR stamp 09 and before
end
item: If/While Statement
  Variable=SYSTIMEHOUR
  Value=10
  Flags=00001000
end
item: Set Variable
  Variable=SYSTIMEHOUR
  Value=0%SYSTIMEHOUR%
end
item: End Block
end
item: Remark
end
item: Set Variable
  Variable=TRACEDATE
  Value=%SYSDATEMONTH%-%SYSDATEDAY%-%SYSDATEYEAR%
end
item: Set Variable
  Variable=TRACETIME
  Value=%SYSTIMEHOUR%:%SYSTIMEMINUTE%:%SYSTIMESECOND%.000+%TZ-BIASA%
end
item: Remark
end
item: Insert Line into Text File
  Pathname=%TLOG%
  New Text=<![LOG[%TMESSAGE%]LOG]!><time="%TRACETIME%" date="%TRACEDATE%" component="%TCOMPONENT%" context="" type="1" thread="%TTHREAD%" file="%TSOURCE%">
  Line Number=0
end
item: Remark
end
item: Set Variable
  Variable=TMESSAGE
end
item: Set Variable
  Variable=TCOMPONENT
end
item: Set Variable
  Variable=TTHREAD
end
item: Set Variable
  Variable=TSOURCE
end
item: Remark
end
 
Attached Image(s)
Brian

If anything I say makes sense, please rate my post. If it doesn't make sense, then <Connection Lost>... ;-)
 
#1
    blaird

    • Total Posts : 46
    • Scores: 4
    • Reward points : 9320
    • Joined: 3/13/2006
    • Status: offline
    Re:Wise WSE script for Trace32.EXE logging Sunday, June 12, 2011 1:13 PM (permalink)
    0
    Does anyone have a vbs function that will format output from the script so Trace32.exe looks good?  Similar to what I did within a WSE in the above post.

    I sould spend a couple minutes on it this week, but I'm feeling lazy and figure it someone already has it that would be great.

    Thanks,
    Brian
    Brian

    If anything I say makes sense, please rate my post. If it doesn't make sense, then <Connection Lost>... ;-)
     
    #2
      blaird

      • Total Posts : 46
      • Scores: 4
      • Reward points : 9320
      • Joined: 3/13/2006
      • Status: offline
      Re:Wise WSE script for Trace32.EXE logging Monday, January 30, 2012 6:42 PM (permalink)
      0
      Christjan has a cool little set of functions that may handle this:
       
      http://blog.itminutes.net/?p=490
       
       
      Brian

      If anything I say makes sense, please rate my post. If it doesn't make sense, then <Connection Lost>... ;-)
       
      #3
        Online Bookmarks Sharing: Share/Bookmark

        Jump to:

        Current active users

        There are 0 members and 1 guests.

        Icon Legend and Permission

        • New Messages
        • No New Messages
        • Hot Topic w/ New Messages
        • Hot Topic w/o New Messages
        • Locked w/ New Messages
        • Locked w/o New Messages
        • Read Message
        • Post New Thread
        • Reply to message
        • Post New Poll
        • Submit Vote
        • Post reward post
        • Delete my own posts
        • Delete my own threads
        • Rate post

        2000-2012 ASPPlayground.NET Forum Version 3.9