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
- :
- It crashed due to my mistake in the code
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
Apr 22, 2015
11:27 AM
Installations fails with 1603 to display Progress bar for a custom action
I have a Basic MSI project. I have added 2 new Custom Actions to display the Progress Bar continuously during file copying.
I have created a Deferred custom action that updates the Progress Bar, and an immediate custom action that informs the installer the total amount of ticks to add to the Progress Bar during the immediate and script execution phase of the script.
I have subscribed these CustomActions to the SetupProgress customaction.
What else should I do for this my product to get installed successfully with active progressbar display during the copying of the files.
Following are the 2 functions I have added, to accomplish this.
///////////////////////////////////////////////////////////////////////////////
//
// Function: SetProgressTicks(HWND)
//
// Purpose: This function informs the installer the total amount of ticks
// to add to the Progress Bar during the immediate and script execution
// phase of the script
//
///////////////////////////////////////////////////////////////////////////////
function SetProgressTicks(hMSI)
STRING svSupportDir, szvbFile, svWinSysDir, szProgram, szSourceFolder;
OBJECT rec;
NUMBER iResult, nTotalIncrement;
HWND hRec;
begin
nTotalIncrement = 1000;
rec = MsiCreateRecord(2);
if (rec = 0) then
LogIt(INFORMATION, "In SetProgressTicks - MsiCreateRecord failed");
endif;
MsiRecordSetInteger(rec, 1, 3);
MsiRecordSetInteger(rec, 2, nTotalIncrement);
iResult = MsiProcessMessage(hMSI, INSTALLMESSAGE_PROGRESS, rec);
if (iResult == IDCANCEL) then
LogIt(INFORMATION, "In SetProgressTicks - MsiProcessMessage failed");
endif;
end;
///////////////////////////////////////////////////////////////////////////////
//
// Function: SetProgressActionInfo(HWND)
//
// Purpose: This function is a deferred custom action that will also contain
// the code to update the MSI Installer’s Progress Bar.
//
///////////////////////////////////////////////////////////////////////////////
function SetProgressActionInfo(hMSI)
STRING svSupportDir, szvbFile, svWinSysDir, szProgram, szSourceFolder;
HWND hProgressRec, hRec;
NUMBER i, nTickIncrement, nItems, nTicks;
NUMBER iResult;
begin
nTickIncrement = 100;
nItems = 10;
nTicks = 1000;
hRec = MsiCreateRecord(3);
//creating template
MsiRecordSetString (hRec, 1, "Progress Custom Action");
MsiRecordSetString (hRec, 2, "Incrementing progress bar...");
MsiRecordSetString (hRec, 3, "Incrementing tick [1] or [2]");
iResult = MsiProcessMessage (hMSI, INSTALLMESSAGE_ACTIONSTART, hRec);
// Tell the installer to use explicit progress messages.
hProgressRec = MsiCreateRecord(3);
MsiRecordSetInteger(hProgressRec, 1, 1);
MsiRecordSetInteger(hProgressRec, 2, 1);
MsiRecordSetInteger(hProgressRec, 3, 0);
iResult = MsiProcessMessage (hMSI, INSTALLMESSAGE_PROGRESS, hProgressRec);
//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, nTickIncrement);
MsiRecordSetInteger(hProgressRec, 3, 0);
// The following tells the installer to send a message to update
// the progress bar its a loop.
for i = 0 to nItems step nTickIncrement
MsiRecordSetInteger(hRec, 1, i);
iResult = MsiProcessMessage(hMSI, INSTALLMESSAGE_ACTIONDATA, hRec);
iResult = MsiProcessMessage(hMSI, INSTALLMESSAGE_PROGRESS, hProgressRec);
endfor;
MsiCloseHandle(hRec);
MsiCloseHandle(hProgressRec);
end;
I have added these 2 functions between the InstallInitialize and InstallFinalize CustomActions. The Deferred CustomAction is added to be exectuted just after the Immediate CustomAction.
My installer fails. The following is the snippet of the log message I got during the installation.
InstallShield 11:43:52: Initializing Engine
InstallShield 11:43:53: Done Initializing...
InstallShield 11:43:53: Registering Msi Server...
InstallShield 11:43:53: Invoking script function SetProgressTicks
InstallShield 11:43:53: Failed to run script function, error 0x80020009
InstallShield 11:43:53: CallScriptFunctionFromMsiCA() ends, result 0x643
InstallShield 11:43:53: Cleaning up temp file C:\Users\ELIZAB~1\AppData\Local\Temp\{FC644329-99CD-42DA-B23A-5AF27E9AD15C}\ISBEW64.exe
InstallShield 11:43:53: Cleaning up temp file C:\Users\ELIZAB~1\AppData\Local\Temp\{FC644329-99CD-42DA-B23A-5AF27E9AD15C}\ISRT.dll
InstallShield 11:43:53: Cleaning up temp file C:\Users\ELIZAB~1\AppData\Local\Temp\{FC644329-99CD-42DA-B23A-5AF27E9AD15C}\IsConfig.ini
InstallShield 11:43:53: Cleaning up temp file C:\Users\ELIZAB~1\AppData\Local\Temp\{FC644329-99CD-42DA-B23A-5AF27E9AD15C}\String1033.txt
InstallShield 11:43:53: Cleaning up temp file C:\Users\ELIZAB~1\AppData\Local\Temp\{FC644329-99CD-42DA-B23A-5AF27E9AD15C}\_isres_0x0409.dll
InstallShield 11:43:53: Cleaning up temp file C:\Users\ELIZAB~1\AppData\Local\Temp\{FC644329-99CD-42DA-B23A-5AF27E9AD15C}\setup.inx
CustomAction SetProgressTicks returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
Action ended 11:43:53: SetProgressTicks. Return value 3.
Action ended 11:43:55: INSTALL. Return value 3.
Action ended 11:43:56: ExecuteAction. Return value 3.
Action start 11:43:56: SetupCompleteError.
Action start 11:44:04: ISSetupFilesCleanup.
Action ended 11:44:04: ISSetupFilesCleanup. Return value 1.
Action ended 11:44:04: SetupCompleteError. Return value 2.
Action ended 11:44:04: INSTALL. Return value 3.
**********************************************************************************************************************************************************************
Thanks,
Elizabeth.
I have created a Deferred custom action that updates the Progress Bar, and an immediate custom action that informs the installer the total amount of ticks to add to the Progress Bar during the immediate and script execution phase of the script.
I have subscribed these CustomActions to the SetupProgress customaction.
What else should I do for this my product to get installed successfully with active progressbar display during the copying of the files.
Following are the 2 functions I have added, to accomplish this.
///////////////////////////////////////////////////////////////////////////////
//
// Function: SetProgressTicks(HWND)
//
// Purpose: This function informs the installer the total amount of ticks
// to add to the Progress Bar during the immediate and script execution
// phase of the script
//
///////////////////////////////////////////////////////////////////////////////
function SetProgressTicks(hMSI)
STRING svSupportDir, szvbFile, svWinSysDir, szProgram, szSourceFolder;
OBJECT rec;
NUMBER iResult, nTotalIncrement;
HWND hRec;
begin
nTotalIncrement = 1000;
rec = MsiCreateRecord(2);
if (rec = 0) then
LogIt(INFORMATION, "In SetProgressTicks - MsiCreateRecord failed");
endif;
MsiRecordSetInteger(rec, 1, 3);
MsiRecordSetInteger(rec, 2, nTotalIncrement);
iResult = MsiProcessMessage(hMSI, INSTALLMESSAGE_PROGRESS, rec);
if (iResult == IDCANCEL) then
LogIt(INFORMATION, "In SetProgressTicks - MsiProcessMessage failed");
endif;
end;
///////////////////////////////////////////////////////////////////////////////
//
// Function: SetProgressActionInfo(HWND)
//
// Purpose: This function is a deferred custom action that will also contain
// the code to update the MSI Installer’s Progress Bar.
//
///////////////////////////////////////////////////////////////////////////////
function SetProgressActionInfo(hMSI)
STRING svSupportDir, szvbFile, svWinSysDir, szProgram, szSourceFolder;
HWND hProgressRec, hRec;
NUMBER i, nTickIncrement, nItems, nTicks;
NUMBER iResult;
begin
nTickIncrement = 100;
nItems = 10;
nTicks = 1000;
hRec = MsiCreateRecord(3);
//creating template
MsiRecordSetString (hRec, 1, "Progress Custom Action");
MsiRecordSetString (hRec, 2, "Incrementing progress bar...");
MsiRecordSetString (hRec, 3, "Incrementing tick [1] or [2]");
iResult = MsiProcessMessage (hMSI, INSTALLMESSAGE_ACTIONSTART, hRec);
// Tell the installer to use explicit progress messages.
hProgressRec = MsiCreateRecord(3);
MsiRecordSetInteger(hProgressRec, 1, 1);
MsiRecordSetInteger(hProgressRec, 2, 1);
MsiRecordSetInteger(hProgressRec, 3, 0);
iResult = MsiProcessMessage (hMSI, INSTALLMESSAGE_PROGRESS, hProgressRec);
//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, nTickIncrement);
MsiRecordSetInteger(hProgressRec, 3, 0);
// The following tells the installer to send a message to update
// the progress bar its a loop.
for i = 0 to nItems step nTickIncrement
MsiRecordSetInteger(hRec, 1, i);
iResult = MsiProcessMessage(hMSI, INSTALLMESSAGE_ACTIONDATA, hRec);
iResult = MsiProcessMessage(hMSI, INSTALLMESSAGE_PROGRESS, hProgressRec);
endfor;
MsiCloseHandle(hRec);
MsiCloseHandle(hProgressRec);
end;
I have added these 2 functions between the InstallInitialize and InstallFinalize CustomActions. The Deferred CustomAction is added to be exectuted just after the Immediate CustomAction.
My installer fails. The following is the snippet of the log message I got during the installation.
InstallShield 11:43:52: Initializing Engine
InstallShield 11:43:53: Done Initializing...
InstallShield 11:43:53: Registering Msi Server...
InstallShield 11:43:53: Invoking script function SetProgressTicks
InstallShield 11:43:53: Failed to run script function, error 0x80020009
InstallShield 11:43:53: CallScriptFunctionFromMsiCA() ends, result 0x643
InstallShield 11:43:53: Cleaning up temp file C:\Users\ELIZAB~1\AppData\Local\Temp\{FC644329-99CD-42DA-B23A-5AF27E9AD15C}\ISBEW64.exe
InstallShield 11:43:53: Cleaning up temp file C:\Users\ELIZAB~1\AppData\Local\Temp\{FC644329-99CD-42DA-B23A-5AF27E9AD15C}\ISRT.dll
InstallShield 11:43:53: Cleaning up temp file C:\Users\ELIZAB~1\AppData\Local\Temp\{FC644329-99CD-42DA-B23A-5AF27E9AD15C}\IsConfig.ini
InstallShield 11:43:53: Cleaning up temp file C:\Users\ELIZAB~1\AppData\Local\Temp\{FC644329-99CD-42DA-B23A-5AF27E9AD15C}\String1033.txt
InstallShield 11:43:53: Cleaning up temp file C:\Users\ELIZAB~1\AppData\Local\Temp\{FC644329-99CD-42DA-B23A-5AF27E9AD15C}\_isres_0x0409.dll
InstallShield 11:43:53: Cleaning up temp file C:\Users\ELIZAB~1\AppData\Local\Temp\{FC644329-99CD-42DA-B23A-5AF27E9AD15C}\setup.inx
CustomAction SetProgressTicks returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
Action ended 11:43:53: SetProgressTicks. Return value 3.
Action ended 11:43:55: INSTALL. Return value 3.
Action ended 11:43:56: ExecuteAction. Return value 3.
Action start 11:43:56: SetupCompleteError.
Action start 11:44:04: ISSetupFilesCleanup.
Action ended 11:44:04: ISSetupFilesCleanup. Return value 1.
Action ended 11:44:04: SetupCompleteError. Return value 2.
Action ended 11:44:04: INSTALL. Return value 3.
**********************************************************************************************************************************************************************
Thanks,
Elizabeth.
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Apr 22, 2015
03:30 PM
I had the variable "rec" defined as OBJECT instead of HWND.
I am all set.
I am all set.