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 the ProgressBar
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
Mar 05, 2009
02:17 AM
Updating the ProgressBar
Hi all:
Any help is appreciated. Thanks in advance.
[CODE]// Included header files ----------------------------------------------------
#include "ifx.h"
// Note: In order to have your InstallScript function executed as a custom
// action by the Windows Installer, it must be prototyped as an
// entry-point function.
// The keyword export identifies MyFunction() as an entry-point function.
// The argument it accepts must be a handle to the Installer database.
/* export prototype MyFunction(HWND); */
export prototype AddProgressInfo(HWND);
export prototype AddTotalTicks(HWND);
function AddProgressInfo(hInstall) //Deferred Execution
OBJECT rec;
OBJECT progrec;
NUMBER i;
begin
set rec = MsiCreateRecord(3);
MsiRecordSetString(rec, 1, "callAddProgressInfo");
MsiRecordSetString(rec, 2, "Incrementing the progress bar...");
MsiRecordSetString(rec, 3, "Incrementing tick [1] of [2]");
MsiProcessMessage(hInstall, INSTALLMESSAGE_ACTIONSTART, rec);
MsiRecordSetInteger(rec, 1, 1);
MsiRecordSetInteger(rec, 2, 1);
MsiRecordSetInteger(rec, 3, 0);
MsiProcessMessage(hInstall, INSTALLMESSAGE_PROGRESS, rec);
set progrec = MsiCreateRecord(3);
MsiRecordSetInteger(progrec, 1, 2);
MsiRecordSetInteger(progrec, 2, 500000);
MsiRecordSetInteger(progrec, 3, 0);
MsiRecordSetInteger(rec, 2, 5000000);
for i=0 to 5000000 step 500000
MsiRecordSetInteger(rec, 1, i);
MsiProcessMessage(hInstall, INSTALLMESSAGE_ACTIONDATA, rec);
MsiProcessMessage(hInstall, INSTALLMESSAGE_PROGRESS, progrec);
Delay(1);
endfor;
end;
function AddTotalTicks(hInstall) //Immediate Execution
OBJECT rec;
begin
set rec = MsiCreateRecord(3);
MsiRecordSetInteger(rec, 1, 2);
MsiRecordSetInteger(rec, 2, 5000000);
MsiRecordSetInteger(rec, 3, 0);
MsiProcessMessage(hInstall, INSTALLMESSAGE_PROGRESS, rec);
end;
[/CODE]
I've searched all posts about how to update the progress bar in this forum. However, all are not worked fine for me. The Progress bar is always 100% and that is not what I want.
My problem is: I hope it can move 10% per second. After 10 seconds, the progress bar is 100%.
I reference one thread posted by RobertDickau: http://community.installshield.com/showthread.php?t=105165
My procedures is listed below:
I believe some necessary steps iare missed by me. Ex: Should I modify MSI table in DirectEditor? Like ControlEvent or EventMapping Table or something. If yes, how to do?
1. Create an empty InstallScript MSI project
2. Copy RobertDickau's VBScript Code and modify it to InstallScript Language. (My modified InstallScript code is attached below.)
3. Use Custom Action Wizard to create two CAs to link InstallScript functions. One is called AddProgressInfo (deferred exection, executed before InstallFiles CA), the other is called AddTotalTicks (immediate execution, executed before AddProgressInfo).
4. Finally, build this release.
I believe some necessary steps iare missed by me. Ex: Should I modify MSI table in DirectEditor? Like ControlEvent or EventMapping Table or something. If yes, how to do?
Any help is appreciated. Thanks in advance.
[CODE]// Included header files ----------------------------------------------------
#include "ifx.h"
// Note: In order to have your InstallScript function executed as a custom
// action by the Windows Installer, it must be prototyped as an
// entry-point function.
// The keyword export identifies MyFunction() as an entry-point function.
// The argument it accepts must be a handle to the Installer database.
/* export prototype MyFunction(HWND); */
export prototype AddProgressInfo(HWND);
export prototype AddTotalTicks(HWND);
function AddProgressInfo(hInstall) //Deferred Execution
OBJECT rec;
OBJECT progrec;
NUMBER i;
begin
set rec = MsiCreateRecord(3);
MsiRecordSetString(rec, 1, "callAddProgressInfo");
MsiRecordSetString(rec, 2, "Incrementing the progress bar...");
MsiRecordSetString(rec, 3, "Incrementing tick [1] of [2]");
MsiProcessMessage(hInstall, INSTALLMESSAGE_ACTIONSTART, rec);
MsiRecordSetInteger(rec, 1, 1);
MsiRecordSetInteger(rec, 2, 1);
MsiRecordSetInteger(rec, 3, 0);
MsiProcessMessage(hInstall, INSTALLMESSAGE_PROGRESS, rec);
set progrec = MsiCreateRecord(3);
MsiRecordSetInteger(progrec, 1, 2);
MsiRecordSetInteger(progrec, 2, 500000);
MsiRecordSetInteger(progrec, 3, 0);
MsiRecordSetInteger(rec, 2, 5000000);
for i=0 to 5000000 step 500000
MsiRecordSetInteger(rec, 1, i);
MsiProcessMessage(hInstall, INSTALLMESSAGE_ACTIONDATA, rec);
MsiProcessMessage(hInstall, INSTALLMESSAGE_PROGRESS, progrec);
Delay(1);
endfor;
end;
function AddTotalTicks(hInstall) //Immediate Execution
OBJECT rec;
begin
set rec = MsiCreateRecord(3);
MsiRecordSetInteger(rec, 1, 2);
MsiRecordSetInteger(rec, 2, 5000000);
MsiRecordSetInteger(rec, 3, 0);
MsiProcessMessage(hInstall, INSTALLMESSAGE_PROGRESS, rec);
end;
[/CODE]
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Apr 08, 2009
01:37 PM
I came across your post and this link on MSDN when I was searching for the related topics.
This is what you need to do for your AddTotalTicks function:
It works for me.
This is what you need to do for your AddTotalTicks function:
function AddTotalTicks(hInstall) //Immediate Execution
OBJECT rec;
begin
set rec = MsiCreateRecord(2);
MsiRecordSetInteger(rec, 1, 3);
MsiRecordSetInteger(rec, 2, 5000000);
MsiProcessMessage(hInstall, INSTALLMESSAGE_PROGRESS, rec);
end;
It works for me.