Community Forums
Results 1 to 2 of 2

Thread: Custom Action script fails without executing

  1. #1
    Join Date
    Feb 2018

    Custom Action script fails without executing

    I have created a CA called CheckCertFileExists which is triggered on 'Next' from a filename entry/browse dialog. The script function called (ExFn_ValidateCertFile) is here:

    export prototype ExFn_ValidateCertFile();
    export prototype ExFn_CopyCertFile();
    export prototype ExFn_SetCADataProps();
    prototype string GetCADataProp(byref string, string);

    function ExFn_ValidateCertFile()
    string szFile[512];
    string szDir;
    number nSize;
    number nResult;
    BOOL tFileExists;
    SprintfMsiLog("First working statement...!");
    nSize = 512;
    MsiGetProperty(ISMSI_HANDLE, "USERCERTPATH", szFile, nSize);
    MessageBox("ExFn_ValidateCertFile " + szFile, INFORMATION);
    tFileExists = Is(FILE_EXISTS, szFile);
    if (tFileExists = TRUE) then
    MsiSetProperty(ISMSI_HANDLE, "CERTFILEOK", "Yes");
    MsiSetProperty(ISMSI_HANDLE, "CERTFILEOK", "No");
    MessageBox("File " + szFile + " does not exist.", SEVERE);
    ParsePath(szFile, szDir, PATH);
    return 0;


    Everything compiles and builds ok. However, it fails at runtime without executing a line. Here is the MSI log extract:

    MSI (c) (68:F4) [10:42:51:955]: Doing action: FileBrowse
    Action 10:42:51: FileBrowse.
    Action start 10:42:51: FileBrowse.
    MSI (c) (68:50) [10:42:51:971]: Invoking remote custom action. DLL: C:\Users\ADMINI~1\AppData\Local\Temp\1\MSIC0B6.tmp, Entrypoint: FileBrowse
    MSI (c) (68:28) [10:42:51:971]: Cloaking enabled.
    MSI (c) (68:28) [10:42:51:971]: Attempting to enable all disabled privileges before calling Install on Server
    MSI (c) (68:28) [10:42:51:971]: Connected to service for CA interface.
    MSI (c) (68!B4) [10:42:52:561]: PROPERTY CHANGE: Modifying IS_BROWSE_FILEBROWSED property. Its current value is 'C:\'. Its new value: 'C:\Development\installer\win\LiqSecEKM\Source_Packages\PO.crt'.
    Action ended 10:42:52: FileBrowse. Return value 1.
    MSI (c) (68:F4) [14:16:04:603]: PROPERTY CHANGE: Modifying USERCERTPATH property. Its current value is 'C:\Users\Administrator\Documents\'. Its new value: 'C:\Development\installer\win\LiqSecEKM\Source_Packages\PO.crt'.
    MSI (c) (68:F4) [14:16:04:603]: Doing action: CheckCertFileExists
    Action 14:16:04: CheckCertFileExists.
    Action start 14:16:04: CheckCertFileExists.
    MSI (c) (68:18) [14:16:04:621]: Invoking remote custom action. DLL: C:\Users\ADMINI~1\AppData\Local\Temp\1\MSIF582.tmp, Entrypoint: f3
    Action ended 14:16:06: CheckCertFileExists. Return value 3.
    Info 2896. Executing action CheckCertFileExists failed.
    Action ended 14:16:06: InstallWelcome. Return value 3.
    MSI (c) (68:E8) [14:16:06:438]: Doing action: SetupCompleteError

    I have found that the CA in question, and another one I have written to do an explicit file copy operation, have wacky MSI Type Numbers:

    Name:  IS Snip 1.PNG
Views: 18
Size:  25.4 KB

    Name:  IS Snip 2.PNG
Views: 17
Size:  25.8 KB

    They imply a msidbCustomActionXXXX constant at 0x10000, but I can't find one.

    Has anyone an explanation for what causes a script to fail with a 3 in this way, or what those MSI numbers mean?


  2. #2
    Join Date
    Jan 2002
    Probably on a plane somewhere or in a hotel room.
    In a Basic MSI project, an InstallScript Custom Action can only accept a single parameter--a handle to the MSI. You'll need to change the prototype and functions statements to be

    export prototype ExFn_ValidateCertFile(HWND);


    function ExFn_ValidateCertFile(hMSI)

    Then use hMSI in all of the places that you currently use ISMSI_HANDLE.

    If you do a search on ISMSI_HANDLE in the InstallShield Help, you'll see

    ISMSI_HANDLE is not supported in Basic MSI projects, and is not supported in InstallScript custom actions.

    It is only used in InstallScript MSI projects.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts