I have used a Visual Studio setup project to create an MSI. I have edited the MSI in Orca so that a custom action is performed via a DLL when it is first opened. When I run the MSI, msiexec
logs the following:
MSI (c) (E4:BC) [15:28:14:453]: Doing action: CustomAction1
Action 15:28:14: CustomAction1.
Action start 15:28:14: CustomAction1.
MSI (c) (E4:BC) [15:28:14:453]: Note: 1: 2235 2: 3: ExtendedType 4: SELECT `Action`,`Type`,`Source`,`Target`, NULL, `ExtendedType` FROM `CustomAction` WHERE `Action` = 'CustomAction1'
MSI (c) (E4:BC) [15:28:14:453]: Creating MSIHANDLE (13) of type 790542 for thread 3260
MSI (c) (E4:B4) [15:28:14:453]: Invoking remote custom action. DLL: C:\DOCUME~1\USERNA~1\LOCALS~1\Temp\MSIA3.tmp, Entrypoint: SampleFunction
MSI (c) (E4:B4) [15:28:14:453]: Closing MSIHANDLE (13) of type 790542 for thread 3260
Action ended 15:28:14: CustomAction1. Return value 3.
MSI (c) (E4:BC) [15:28:14:468]: Doing action: FatalErrorForm
Action 15:28:14: FatalErrorForm.
Action start 15:28:14: FatalErrorForm.
MSI (c) (E4:BC) [15:28:14:468]: Note: 1: 2235 2: 3: ExtendedType 4: SELECT `Action`,`Type`,`Source`,`Target`, NULL, `ExtendedType` FROM `CustomAction` WHERE `Action` = 'FatalErrorForm'
The installer wizard then displays the error message: The installer was interrupted before MyProduct could be installed. You need to restart the installer to try again.
The custom DLL is written in C++. Here is the source code:
MyCustomAction.cpp:
// MyCustomAction.cpp : Defines the entry point for the DLL application.
#include "stdafx.h"
BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
return TRUE;
}
UINT __stdcall SampleFunction(MSIHANDLE hModule)
{
//This is the function that is called by the MSI
//It is empty because I just want to check that it can be called without interrupting the installer, then I will add the actual functionality
}
MyCustomAction.def:
; MyCustomAction.def
;
; defines the exported functions which will be available to the MSI engine
LIBRARY "MyCustomAction"
DESCRIPTION 'Custom Action DLL'
EXPORTS
SampleFunction
I have also referenced msi.lib
in the DLL's additional dependencies. Why does the custom action interrupt the installation when I am currently not explicitly telling it do anything? Any help would be appreciated.
UPDATE:
In Orca, the custom action is in the Binary
table and is type 1 in the CustomAction
table. The custom action is Immediate
and takes place after IsolateComponents
and before WelcomeForm
in the InstallUISequence
table.
return 1;
, but I got the same issue. – BenERROR_SUCCESS
. – tkausl