Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
441 views
in Technique[技术] by (71.8m points)

installshield - Failed to run script function from Custom Actions

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:NCRUniEmulatorServiceNCRUniEmulatorSO.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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...