cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
honolua
Level 7

Custom Action Not Executing?

Project Type: Basic MSI

I've been trying to get this custom action to work but it just doesn't seem to execute. It is an InstallScript action immediately after InstallODBC in the Install/Execute sequence. I've set it as "Asynchronous (Waits for exit code)". The only condition is REMOVE<>"ALL". The In-Script Execution is set to "Deferred". So I would expect it to execute during a fresh install. However, the first line in the function is a MessageBox that never appears. The EXE CA immediately after this InstallScript CA works just fine (it displays a run-time progress dialog) and has the same exact setup except that it is a different type.

Any help or advice would be greatly appreciated.
Labels (1)
0 Kudos

(6) Replies
RobertDickau
Flexera Alumni

Does a run-time log file say anything about the action (the condition failing, anything)? What is the InstallScript function's signature?
0 Kudos
honolua
Level 7

Actually, it looks to be running something.

MSI (s) (98:14) [15:17:49:079]: Doing action: spsInstallHelpFiles
Action 15:17:49: spsInstallHelpFiles.
Action start 15:17:49: spsInstallHelpFiles.
spsInstallHelpFiles:
Action ended 15:17:49: spsInstallHelpFiles. Return value 1.


This claims the return value is "1" but according to the script code the one and only location where a value of "1" could be returned is the very last statement in the function. There should be several MessageBox dialogs, a directory created and some files copied before the end of this function. Is there any way I can add a logging statement to verify where in the function the return value is coming from?
0 Kudos
RobertDickau
Flexera Alumni

Please see the MSI help topic "Logging of Action Return Values" (logged values are different from the "real" return values), and perhaps see this old newsletter tip (PDF warning) for information about SprintfMsiLog and other techniques: http://www.acresso.com/webdocuments/PDF/msi_writing_to_the_log_file.pdf.
0 Kudos
honolua
Level 7

I added a couple SprintfMsiLog() calls to the function. The very first line of the function is one of them. The MSI log shows the exact same output as before. It appears the function is not actually executing.
0 Kudos
RobertDickau
Flexera Alumni

Sanity check: the prototype and declarations are:
export prototype FunctionName(HWND);

function FunctionName(hInstall)
// vars.
begin
// etc.
return ERROR_SUCCESS;
end;
...?
0 Kudos
honolua
Level 7

RobertDickau wrote:
Sanity check: the prototype and declarations are:
export prototype FunctionName(HWND);
function FunctionName(hInstall)
end;


This appears to have been the problem. I did not have an HWND parameter on this function. I will endeavour to remember that custom InstallScript actions need to have this defined. Now I just need to figure out why the action fails to work properly now that's successfully invoked! 🙂
0 Kudos