cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Daniel_Dority
Level 6

Progress Bar

Hey there,

I've tried searching but nobody is doing what I need.

Basically I want to use the progress bar within Installshield but I don't care about text. I just want to update the progress bar based off of a dynamic number.

I've seen several examples but none of them explain anything well nor use a text-less approach.


function CA_Progress(hInstall) // increment the progress bar
NUMBER iResult;
HWND hRec, hProgressRec;
NUMBER nvBufferSize;
begin
hRec = MsiCreateRecord(3);
hProgressRec = MsiCreateRecord(3);
// Tell the installer to use explicit progress messages.
MsiRecordSetInteger(hRec, 1, 1);
MsiRecordSetInteger(hRec, 2, 1);
MsiRecordSetInteger(hRec, 3, 0);
iResult = MsiProcessMessage(hInstall, INSTALLMESSAGE_PROGRESS, hRec);

//Specify that an update of the progress bar's position in
//this case means to move it forward by one increment.
MsiRecordSetInteger(hProgressRec, 1, 2);
MsiRecordSetInteger(hProgressRec, 2, szSizeTickIncrement);
MsiRecordSetInteger(hProgressRec, 3, 0);

// The following tells the installer to send a message to update
// the progress bar.

iResult = MsiProcessMessage(hInstall, INSTALLMESSAGE_PROGRESS, hProgressRec);

MsiCloseHandle(hRec);
MsiCloseHandle(hProgressRec);

end;




For the above example. What the heck is "hInstall"?

If I plan to only use the progress bar can I reduce the code to this?


function CA_Progress(hInstall) // increment the progress bar
NUMBER iResult;
HWND hProgressRec;

begin

hProgressRec = MsiCreateRecord(3);

//Specify that an update of the progress bar's position in
//this case means to move it forward by one increment.
MsiRecordSetInteger(hProgressRec, 1, 2);
MsiRecordSetInteger(hProgressRec, 2, szSizeTickIncrement);
MsiRecordSetInteger(hProgressRec, 3, 0);

// The following tells the installer to send a message to update
// the progress bar.

iResult = MsiProcessMessage(hInstall, INSTALLMESSAGE_PROGRESS, hProgressRec);

MsiCloseHandle(hProgressRec);

end;



Don't I need to pass the control ID for the progress bar somewhere? This whole thing to use a progress bar seems whack. There aren't any straight answers anywhere.

I'm looking for exact steps please. Thanks.
Labels (1)
0 Kudos
(4) Replies
Daniel_Dority
Level 6

So I assume nobody in this forum has ever used the progress bar. Yay me.
0 Kudos
ITI_Randy
Level 6

Daniel,

Sorry for all the woes with this one. If it is any consolation, I am having to work with this too. In my case, I am launching an inner setup (basic msi) and trying to capture the output and feed it to the outer parent msi to show progress. This is really a chore!

In your case, I don't think you are too far away. You have the sample code. The hInstall refers to the handle for the current msi. There are some notes out there that may be of help. Here is one I found earlier:
http://community.macrovision.com/showthread.php?t=161418&page=2
0 Kudos
Daniel_Dority
Level 6

From the research that I have been going through, I've concluded that using the progress bar inside of InstallShield is not able to work with my requirement. From what I've read, there is a window at which the progress bar can be called and that is only during an install. I need a progress bar to interact with "progress" of a different type instead of just files.

So I've chosen to use a text approach which will look somewhat similar to other installs.

Round 1

Steps Description
Step 1: Doing Task1 Task 1 Details
Step 2: Doing Task2 Task 1 Details
Step 3: Doing Task3 Task 1 Details


Round 2
[CODE]
Steps Description
Step 1: Doing Task1 [DONE] Task 2 Details
Step 2: Doing Task2 Task 2 Details
Step 3: Doing Task3 Task 2 Details[/CODE]


And so on. At least as I work on this, I know that it will work and I can control every aspect of any and everything using my custom actions and controls within IS.
0 Kudos

Ok so it seems that progress bars can only be used during the Install phase!!??? Well in my installer I have some progress bar worthy actions that need to run BEFORE installation. My MSI DLL hangs on MsiProcessMessage probably because it is trying to send a progress bar message BEFORE the Installation part has begun. Windows installer, Basic MSI and InstallShield = "Black Art" mainly because documentation and examples are so woefully lacking clarity. So I think it's time to give up trying to approach my problem using a custom dialog, some custom actions, and a MSI DLL as its just too impossible. Instead I'll just have to resort to running a program. A hack, well yes but better than constantly jumping though hoops and it will get the job done faster. 

0 Kudos