You should be able to schedule the actions anywhere in the Execute sequence between InstallInitialize and InstallFinalize; for example, the VBScript below defines the two actions --- the immediate one to add the total ticks during script generation, and the deferred one to add individual ticks during script execution --- where both actions are placed just before InstallFiles:
Code:
Const INSTALLMESSAGE_ACTIONSTART = &H08000000
Const INSTALLMESSAGE_ACTIONDATA = &H09000000
Const INSTALLMESSAGE_PROGRESS = &H0A000000
' ----------
' deferred action to increment ticks while action is taking place
'
Function AddProgressInfo( )
Set rec = Installer.CreateRecord(3)
rec.StringData(1) = "callAddProgressInfo"
rec.StringData(2) = "Incrementing the progress bar..."
rec.StringData(3) = "Incrementing tick [1] of [2]"
Message INSTALLMESSAGE_ACTIONSTART, rec
rec.IntegerData(1) = 1
rec.IntegerData(2) = 1
rec.IntegerData(3) = 0
Message INSTALLMESSAGE_PROGRESS, rec
Set progrec = Installer.CreateRecord(3)
progrec.IntegerData(1) = 2
progrec.IntegerData(2) = 5000
progrec.IntegerData(3) = 0
rec.IntegerData(2) = 5000000
For i = 0 To 5000000 Step 5000
rec.IntegerData(1) = i
' action data appears only if a text control subscribes to it
Message INSTALLMESSAGE_ACTIONDATA, rec
Message INSTALLMESSAGE_PROGRESS, progrec
Next ' i
' return success to MSI
AddProgressInfo = 0
End Function
' ----------
' immediate action that adds a number of "ticks" to the progress bar
'
Function AddTotalTicks( )
Set rec = Installer.CreateRecord(3)
rec.IntegerData(1) = 3
rec.IntegerData(2) = 5000000 ' total ticks to add
rec.IntegerData(3) = 0
Message INSTALLMESSAGE_PROGRESS, rec
Set rec = Nothing
' return success to MSI
AddTotalTicks = 0
End Function