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

How to add ticks to progress bar


1 reply to this topic

Amol_MSI

Amol_MSI
  • Full Members
  • 26 posts

Posted 06 October 2008 - 08:21

I used following code to add progress text and ticks to progress bar, this code works to some extent. It adds progress text properly I see progress text when "for" loop gets executed to send progress text to MSI but same "for" loop does not work when it sends message to MSI to add progress ticks. It is adding progress text but progress animation is not happening here. Please have a look at following code and let me know if I need to make some changes to get it working.

'*************************** Common Custom Actions ****************************
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




luke_s

luke_s
  • Full Members
  • 532 posts

Posted 14 October 2008 - 03:36

Have a look at the MSDN site for Windows Installer. Microsoft provides a C code example on doing this.