Visual Studio 설치 프로젝트를 사용하여 MSI를 만들었습니다. Orca에서 MSI를 편집하여 사용자 지정 작업이 처음 열릴 때 DLL을 통해 수행되도록했습니다. 나는 MSI를 실행하면, msiexec
는 다음과 같은 기록합니다 The installer was interrupted before MyProduct could be installed. You need to restart the installer to try again.
MSI 설치가 사용자 지정 작업 DLL에 의해 중단되었습니다.
사용자 정의 DLL은 C++로 작성되었습니다 :
이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'
설치 마법사가 다음 오류 메시지를 표시합니다. 여기에 소스 코드 :
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 : 나는 또한 DLL의 추가 종속성에서 msi.lib
을 참조한
; MyCustomAction.def
;
; defines the exported functions which will be available to the MSI engine
LIBRARY "MyCustomAction"
DESCRIPTION 'Custom Action DLL'
EXPORTS
SampleFunction
. 현재 사용자 지정 작업이 설치 작업을 방해하는 이유는 무엇입니까? 어떤 도움을 주시면 감사하겠습니다.
UPDATE :
오카에서 사용자 지정 작업이 Binary
테이블에 있고 CustomAction
테이블에 1을 입력합니다. 사용자 지정 작업은 Immediate
이며 IsolateComponents
이후이고 WelcomeForm
전에 InstallUISequence
테이블에서 발생합니다.
함수가 아무 것도 반환하지 않습니다. VS가 경고를 생성하지 않습니까? – tkausl
@tkausl 경고가 없습니다. 그것은 성공적으로 구축됩니다. – Ben
경고 수준이 충분히 높지는 않습니다. 함수는 무언가를 반환해야합니다. – tkausl