Page 1 of 3 123 LastLast
Results 1 to 5 of 11

Thread: Progress bar an ticks

  1. #1
    Join Date
    Apr 2002
    Location
    Sophia Antipolis - France
    Posts
    163

    Unhappy Progress bar an ticks

    I'm trying to update the progress bar from a C++ deffered custom action with no luck. I've followed the directions found in the MSI Docs and various posts in newsgroups.

    Here are my questions :
    Where do I sequence my immediate custom action that calls the DLL to compute and return ticks to the installer in the Installation Execute Sequence ? After which CA and before which CA ? it's currently sequenced right after the ProcessComponent CA. Is it the right place ?

    Where do I sequence my deffered custom action that calls the DLL to update the progress bar ? It is currently sequenced right after WriteRegistryValues...

    My custom action is writing to the MSI log so I can trace the excution at setup time. The ticks are returned to MSI but before the deffered CA runs the progress bar is already full...

    Please help me on this.
    Thanks.

  2. #2
    Join Date
    Oct 2001
    Location
    Here and there
    Posts
    16,233
    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

  3. #3
    Join Date
    Apr 2002
    Location
    Sophia Antipolis - France
    Posts
    163
    Thanks Robert.
    In fact it was working fine, but the ticks number wasn't large enough to see the difference in the progress bar...

  4. #4
    kunals Guest
    This thread was quite informative for me as I too had this requirement.
    However I wanted help on certain things based on RobertDickau vbscript ? like

    1) what changes is required in the script posted ; i mean unitwise so as to view the difference in the progress bar.
    at present the sample code show's - 5000000 ' total ticks to add
    and it steps up by 5000


    2) What does ' action data appears only if a text control subscribes to it' - in the for loop relates to.

    3) the query is related to the first one
    the function "Function AddProgressInfo" in th script is it to be called every time after a cutom action or does the For loop takes care of it..


    awaiting in reply

  5. #5
    Join Date
    Jul 2005
    Location
    New Delhi, India
    Posts
    189

    Exclamation Vbscript not working for progressbar

    Hello Robert,

    I am new to VBscript. Can you please elaborate on this that, how can gain control on the progressbar present on SetupProgress dialog. I tried the VBscript provided by you, but it is not doing anything. I added the provided VBscript in a CA and sequenced it before InstallFiles CA, but it did'nt worked.

    My primary issue is this that progressbar jumps to 100% and stays there for a while and then setup completes. My setup is only of 8 MB. I have read threads about this, that this is a Microsoft problem and will be fixed in MSI 3.1....

    Please help and Advice.

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •