Failed to run script function from Custom Actions

1

I implemented an installscript file of my own that will allow the installer to register dll's. I combined this with a custom action to actually run the function I created. I had to make this script because the dlls were failing to register with setting the property to self register. So I am stuck on how to resolve this problem with the custom action failing so that I can test my script. Below is my script:

#include "Ifx.h"

export prototype RegisterComponents(HWND);

function RegisterComponents(hMSI)

STRING sRunStr;

begin

sRunStr = WINSYSDIR ^ "regsvr32.exe";

LongPathToQuote(sRunStr, TRUE);

//change the directory to target directory
ChangeDirectory(TARGETDIR);

//register dll
if(LaunchAppAndWait(sRunStr, "/s " + 
"C:\NCRUniEmulatorService\NCRUniEmulatorSO.dll", 
WAIT)) < 0) then
MessageBox("NCRUniEmulatorSO.dll", SEVERE);
else
endif;

end;

Below is my custom actions:

FunctionName: RegisterComponents

Return Processing: Synchronous

In-Script Execution: Deferred Execution

Install Exec Sequence: After PublishProduct

All other sequence settings are set to Absent from sequence.

log file

InstallShield 14:17:18: Invoking script function RegisterComponents InstallShield 14:17:18: Failed to run script function, error 0x80020006 InstallShield 14:17:18: CallScriptFunctionFromMsiCA() ends, result 0x643 CustomAction RegisterComponents returned actual error code 1603 but will be translated to success due to continue marking

installshield
installscript
asked on Stack Overflow Sep 24, 2018 by JFrosty • edited Sep 25, 2018 by Sinto

1 Answer

0

Is this an MSI project? I would not use self-registration, instead enable COM Extract at Build in the property page for the component in question:

COM Extract at build

If this extraction does not work, then you might have dependencies that are not met for the file to load. For example a missing resource dll or something like that. The extraction process for "COM Extract at Build" will populate a number of MSI-specific COM tables that take care of all COM registration details for you (including rollback support).

InstallShield Self-Registration: Additionally you can enable self-registration for a file in Installshield and not run via custom action code at all. I think it is in the property page for each file.

answered on Stack Overflow Sep 29, 2018 by Stein Åsmul • edited Jan 8, 2019 by Stein Åsmul

User contributions licensed under CC BY-SA 3.0