cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
rdilipk
Level 5

Very simple CA returning error code 3

I have a very simple custom action (that calls an InstallScript function) that is practically driving me nuts by returning error code 3 (as noted in the MSI logs) and rolling back the entire installation.

Here is the function:

export prototype EnableIIS();

function EnableIIS()
begin
if (SYSINFO.WINNT.bWinNT) then
LaunchApplication(WINSYSDIR ^ "sc.exe", "config W3SVC start= auto", "", SW_HIDE, INFINITE,
LAAW_OPTION_WAIT | LAAW_OPTION_SHOW_HOURGLASS | LAAW_OPTION_HIDDEN);
endif;
end;

As you can see all I am doing is enabling IIS if the installation is running under Windows XP and family. Please note that this is actually failing on Vista! which makes the problem even more weirder. (I haven't checked this on XP yet)

I have a custom action setup to call this function like so:

Return Processing: Synchronous (check exit code)
In-Script execution: Immediate Execution
Execution Scheduling: Execute only once
Install Exec Sequence: After InstallValidate
Install Exec Condition: REMOVE<>"ALL"
MSI type number: 65792

The log notes that my custom action returned 3 (which apparently is failure) and the installation aborts.

What am i doing wrong?
Labels (1)
0 Kudos
(2) Replies
rdilipk
Level 5

.. and forgot to mention that I did put some MessageBox calls inside EnableIIS and to my surprise the function is not even being called! How can it return an error code 3 then?
0 Kudos
rdilipk
Level 5

Holy Smokes!
I just figured out the code wasn't getting called because I was missing a goshdarned HWND as a parameter to the function in its declaration? Jeez!!!! I can't believe I wasted 2 hours tracking this down 😞
0 Kudos