GGG

プログラミング言語やソフトウェア開発について思ったことを書いてます

Wix インストール時にerrorcode [2762]発生

Wix で作成されたインストーラを実行したらエラーが発生して終了した。

なんじゃこりゃ。

 

f:id:taisyo7333:20150826225502p:plain

変更内容はCustomActionでPowershellスクリプトを書いた。 

開発環境

Wix Version v3.9

Visual Studio 2012 Pro

ログ

Action ended 11:01:25: InstallValidate. Return value 1.

MSI (s) (5C:78) [11:01:25:879]: Doing action:  ★InstallPSCmd★

Action 11:01:25:  ★InstallPSCmd★.

Action start 11:01:25:  ★InstallPSCmd★.

MSI (s) (5C:78) [11:01:25:954]: Note: 1: 2762

DEBUG: Error 2762:  Unable to schedule operation. The action must be scheduled between InstallInitialize and InstallFinalize.

The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2762. The arguments are: , ,

MSI (s) (5C:78) [11:03:19:238]: Product: ★ProductName★ -- The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2762. The arguments are: , ,

 

Action ended 11:03:19:  ★InstallPSCmd★. Return value 3.

Action ended 11:03:19: INSTALL. Return value 3.

 ★~★のところは置き換えています。

CustomActionの戻り値について

どうやらMicrosoft SDK のWinError.hで定義されているようだ。(参考URL参照)

 

WinError.h

Value

ERROR_SUCCESS

0

ERROR_INVALID_FUNCTION

1

ERROR_FILE_NOT_FOUND

2

ERROR_PATH_NOT_FOUND

3

ERROR_TOO_MANY_OPEN_FILES

4

 

今回の戻り値は3のため上記の”ERROR_PATH_NOT_FOUND”に該当。

powershell で書いたスクリプトファイルが無かったらしい。凡ミスでしたwww

 

というお話です。

ちなみに

どうやらCustomActionでExecute=”defered”を使用時はDefered Action は「InstallInitialize ~ InstallFinalize」 の間でなければ上記ErrorCodeが発生するようだ。

f:id:taisyo7333:20150826225614p:plain

<このOrcaの図は、WEBのmsiを読み込んで確認しました。今回の自分の問題点があるものと異なります。>

 

参考URL

http://stackoverflow.com/questions/8585918/wix-install-error-2762-while-invoking-a-customaction-from-dialog

>類似エラー

https://technet.microsoft.com/en-us/library/cc535232.aspx

>Custom Action Return Values

https://msdn.microsoft.com/en-us/library/aa368072(v=vs.85).aspx