This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Updating Progress Bar help
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 20, 2010
02:46 PM
Updating Progress Bar help
I have a Basic MSI project and I'm trying to have the progress bar reflect the progress of each of my custom actions (I have many). Right now I've added each of my custom actions to Subscriptions for the SetupProgress dialog, but during installation after the InstallFiles action the progress bar is 100% and never goes down for the rest of the installation.
I've looked at several threads:
http://community.flexerasoftware.com/showthread.php?t=161418&page=2&highlight=progress+bar+custom+action
http://community.flexerasoftware.com/showthread.php?t=164957&page=2
http://community.flexerasoftware.com/showthread.php?t=105165
But I think I am missing some fundamental concept. In all these threads people have created two CA's, a deferred action to increment ticks and an immediate action to add the total number of ticks to the progress bar.
What I don't understand is where do these get called? Would I call the deferred function itself inside my custom action that I want to update the progress bar? Do I need a separate deferred and immediate action for each of my custom actions I want to update progress for?
I'm missing some point on this and could really use an explanation. Thanks.
I've looked at several threads:
http://community.flexerasoftware.com/showthread.php?t=161418&page=2&highlight=progress+bar+custom+action
http://community.flexerasoftware.com/showthread.php?t=164957&page=2
http://community.flexerasoftware.com/showthread.php?t=105165
But I think I am missing some fundamental concept. In all these threads people have created two CA's, a deferred action to increment ticks and an immediate action to add the total number of ticks to the progress bar.
What I don't understand is where do these get called? Would I call the deferred function itself inside my custom action that I want to update the progress bar? Do I need a separate deferred and immediate action for each of my custom actions I want to update progress for?
I'm missing some point on this and could really use an explanation. Thanks.
(12) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 23, 2010
09:02 AM
can anyone help me out here?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 23, 2010
12:32 PM
well here's the code I have so far
I've seen threads saying to have this immediate CA in the execution sequence and in the UI sequence, so I'm not sure which it's supposed to be.
I call AddProgressInfo very first thing inside the deferred CA I want to add progress ticks for. I also have AddProgressInfo subscribed to the SetupProgress dialog with Progress as the attribute.
I'm still having a problem with the progress bar going to near 100% after InstallFiles and never resetting. AddTotalTicks should be resetting it, but it doesn't seem to be.
Does anyone actually know how to successfully use the progress bar?
function AddTotalTicks(hInstall) //Immediate Execution
OBJECT rec;
NUMBER iResult;
HWND hRec;
begin
set rec = MsiCreateRecord(2);
MsiRecordSetInteger(rec, 1, 3);
MsiRecordSetInteger(rec, 2, 5000000);
MsiProcessMessage(hInstall, INSTALLMESSAGE_PROGRESS, rec);
set rec = NOTHING;
// reset the progress bar
hRec = MsiCreateRecord(3);
MsiRecordSetInteger(hRec, 1, 0);
MsiRecordSetInteger(hRec, 2, 100);
MsiRecordSetInteger(hRec, 3, 0);
iResult = MsiProcessMessage(hInstall, INSTALLMESSAGE_PROGRESS, hRec);
end;
I've seen threads saying to have this immediate CA in the execution sequence and in the UI sequence, so I'm not sure which it's supposed to be.
function AddProgressInfo(hInstall) //Deferred Execution
HWND hProgRec, hRec;
NUMBER i;
begin
hRec = MsiCreateRecord(3);
MsiRecordSetInteger(hRec, 1, 1);
MsiRecordSetInteger(hRec, 2, 1);
MsiRecordSetInteger(hRec, 3, 0);
MsiProcessMessage(hInstall, INSTALLMESSAGE_PROGRESS, hRec);
hProgRec = MsiCreateRecord(3);
MsiRecordSetInteger(hProgRec, 1, 2);
MsiRecordSetInteger(hProgRec, 2, 500000);
MsiRecordSetInteger(hProgRec, 3, 0);
MsiRecordSetInteger(hRec, 2, 5000000);
for i=0 to 5000000 step 500000
MsiRecordSetInteger(hRec, 1, i);
MsiProcessMessage(hInstall, INSTALLMESSAGE_ACTIONDATA, hRec);
MsiProcessMessage(hInstall, INSTALLMESSAGE_PROGRESS, hProgRec);
//Delay(1);
endfor;
MsiCloseHandle(hRec);
MsiCloseHandle(hProgRec);
end;
I call AddProgressInfo very first thing inside the deferred CA I want to add progress ticks for. I also have AddProgressInfo subscribed to the SetupProgress dialog with Progress as the attribute.
I'm still having a problem with the progress bar going to near 100% after InstallFiles and never resetting. AddTotalTicks should be resetting it, but it doesn't seem to be.
Does anyone actually know how to successfully use the progress bar?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 25, 2010
06:24 PM
The immediate action that adds the total extra ticks should go in the Execute sequence; and the deferred action adds ticks as it makes system changes. (There's also an example in the Windows Installer help library that might be of use, and our advanced MSI training course talks about this subject a bit.)
I'm not sure I follow the comments about resetting; are you trying to get the progress bar back to zero, or add your action's ticks to the overall flow? Does the example [thread=105165]here[/thread], for example, match what you're looking for?
I'm not sure I follow the comments about resetting; are you trying to get the progress bar back to zero, or add your action's ticks to the overall flow? Does the example [thread=105165]here[/thread], for example, match what you're looking for?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 26, 2010
12:16 AM
Well, ideally, you should follow Rob's advice, and implement these 2 custom actions.
But depending on what InstallShield features you are using, you might realize that some of the IS custom actions (like ISXmlInstall, if you are using XML file changes, see this other thread: http://community.flexerasoftware.com/showthread.php?t=191440) actually reset the progress bar in the middle of the sequence.
I reckon it is another bug in InstallShield. So, forewarned is forearmed!
But depending on what InstallShield features you are using, you might realize that some of the IS custom actions (like ISXmlInstall, if you are using XML file changes, see this other thread: http://community.flexerasoftware.com/showthread.php?t=191440) actually reset the progress bar in the middle of the sequence.
I reckon it is another bug in InstallShield. So, forewarned is forearmed!
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 26, 2010
09:16 AM
Thanks for the responses. Okay. So I only have to call the add total ticks immediate action once in the Execute sequence? And I need to call the deferred action whenever I need to update the progress bar (i.e. everytime I have one of my own custom actions execute). I assume that means calling the deferred function within my other functions.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 26, 2010
11:37 AM
Correct; if you haven't, please see the help topic "Adding Custom Actions to the ProgressBar" for an explanation.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 26, 2010
12:54 PM
After messing around a bit I can actually see it doing something. I'm also trying to reset the progress bar after the InstallFiles action, since it moves it to 100%. I have my immediate action that adds the total number of ticks scheduled right after InstallFiles. I have my deferred action that increments the progress bar scheduled directly after that.
I have the code to Reset the progress bar, and it works if I include it in the deferred action at the beginning, before it tries to increment the progress bar. The reset works, but then the bar doesn't update for the rest of the installation. I tried sticking the Reset code into the immediate action before setting the total number of ticks, but that doesn't seem to have any effect. The progress bar doesn't get reset after executing InstallFiles.
I have the code to Reset the progress bar, and it works if I include it in the deferred action at the beginning, before it tries to increment the progress bar. The reset works, but then the bar doesn't update for the rest of the installation. I tried sticking the Reset code into the immediate action before setting the total number of ticks, but that doesn't seem to have any effect. The progress bar doesn't get reset after executing InstallFiles.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 31, 2010
11:19 AM
I still can't figure out how to get this working correctly. If I have my custom action that resets the progress bar and sets the total number of ticks execute as an immediate action, the progress bar doesn't get reset. If I have it set as a deferred action, the progress bar does reset, but then it never increases again. I even see the status messages being displayed from my deferred message that is supposed to increment the bar, but nothing happens.
I'm really stuck trying to figure this out.
I'm really stuck trying to figure this out.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 03, 2010
02:52 PM
To simplify things a bit (as in [post=459224]this earlier follow-up[/post]), perhaps skip the reset and see if you can incorporate the tick count in the total count? If the progress bar goes to 100%, it generally means the add-ticks action is in the wrong place or the tick count being added is too small...
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 03, 2010
04:32 PM
Okay, I believe I finally got it working. Thanks!
Still seems a bit crude to me, since I'm manually adding ticks to the progress bar, but it works well enough.
Still seems a bit crude to me, since I'm manually adding ticks to the progress bar, but it works well enough.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 03, 2010
04:42 PM
Agreed that it takes some hand-tuning, which makes sense since a custom action is outside the scope of what MSI can keep track of... Thanks for posting the update!
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 07, 2010
12:11 AM
Rob,
as we are discussing the progress bar, am I right in thinking that some of the IS custom actions (like ISXmlInstall) actually reset the progress bar?
I managed to get the progress bar working fine, until the InstallExecuteSequence reaches ISXmlInstall.
So, it looks like another bug to me. Any chance you can confirm that please?
Regards
as we are discussing the progress bar, am I right in thinking that some of the IS custom actions (like ISXmlInstall) actually reset the progress bar?
I managed to get the progress bar working fine, until the InstallExecuteSequence reaches ISXmlInstall.
So, it looks like another bug to me. Any chance you can confirm that please?
Regards