I'm evaluating the Professional edition of A.I., and so far I've liked what I've seen. However, I'm having trouble getting a .NET Installer Class custom action to work correctly. I'm going to provide as much information here as I can.
I have a custom Installer class that needs to accept some input from the user via an installation dialog, then write some data to the CONFIG file in the installation directory. The class is properly written, as we use it in our current install package (created in Visual Studio). It overrides the "Install" method, and it is packaged in a dll named "AppModeInstaller.dll". This DLL is part of the install and placed into the APPDIR.
In my AIP project, I created a .NET Installer Class custom action and placed it in the "InstallFinalize" phase of Install Sequence. I pointed it to the AppModeInstaller.dll that is placed in the Application Directory. A.I. fills in the the properties as appropriate, and with default action data.
To the Action Data I add 2 extra parameters: AppMode, which points to a custom property retrieved from one of the Dialogs, and TargetDir, which points to the APPDIR substitution variable:
When I compile the project and run it, it fails when it tries to execute this custom action:
Obviously it's looking for my AppModeInstaller.dll in the wrong directory. I don't know why; the execution log indicates that it has the correct location of my DLL, and that it is building out the correct parameter values (see the PROPERTY CHANGE line below):
Code: Select all
MSI (s) (CC:F0) [10:39:15:734]: Doing action: AI_DATA_SETTER
Action 10:39:15: AI_DATA_SETTER.
Action start 10:39:15: AI_DATA_SETTER.
MSI (s) (CC:F0) [10:39:15:734]: PROPERTY CHANGE: Adding CustomActionData property. Its value is '/LogFile= /ReqVersion=2.0.50727 /InstallType=notransaction /Action=Install /AppMode="3" /TargetDir="C:\Program Files\Crosby\QuicCheck\" "C:\Program Files\Crosby\QuicCheck\AppModeInstaller.dll" "C:\DOCUME~1\cbono\LOCALS~1\Temp\dotNetCustAct.dll_Config.xml"'.
Action ended 10:39:15: AI_DATA_SETTER. Return value 1.
MSI (s) (CC:F0) [10:39:15:734]: Doing action: AppModeInstaller
Action 10:39:15: AppModeInstaller.
Action start 10:39:15: AppModeInstaller.
MSI (s) (CC:44) [10:39:15:750]: Invoking remote custom action. DLL: C:\WINDOWS\Installer\MSI36C.tmp, Entrypoint: LaunchDotNetCustomAction
MSI (s) (CC:80) [10:39:15:750]: Generating random cookie.
MSI (s) (CC:80) [10:39:15:765]: Created Custom Action Server with PID 996 (0x3E4).
MSI (s) (CC:34) [10:39:15:781]: Running as a service.
MSI (s) (CC:C4) [10:39:15:781]: Hello, I'm your 32bit Impersonated custom action server.
Error 1001. Exception occurred while initializing the installation:
System.IO.FileNotFoundException: Could not load file or assembly 'file:///C:\WINDOWS\system32\Files\Crosby\QuicCheck\AppModeInstaller.dll' or one of its dependencies. The system cannot find the file specified..
MSI (s) (CC!68) [10:43:40:937]:
MSI (s) (CC:44) [10:43:40:937]: Leaked MSIHANDLE (10) of type 790531 for thread 2920
MSI (s) (CC:44) [10:43:40:937]: Note: 1: 2769 2: AppModeInstaller 3: 1
DEBUG: Error 2769: Custom Action AppModeInstaller did not close 1 MSIHANDLEs.
The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2769. The arguments are: AppModeInstaller, 1,
Action ended 10:43:40: AppModeInstaller. Return value 3.
Action ended 10:43:40: INSTALL. Return value 3.
Any help is appreciated!
Regards,
Chris