This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Custom Action script fails without executing
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Feb 19, 2018
05:10 PM
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:
[FONT=Lucida Console][SIZE=1]
export prototype ExFn_ValidateCertFile();
export prototype ExFn_CopyCertFile();
export prototype ExFn_SetCADataProps();
prototype string GetCADataProp(byref string, string);
function ExFn_ValidateCertFile()
.
.
.
[/SIZE][/FONT]
Everything compiles and builds ok. However, it fails at runtime without executing a line. Here is the MSI log extract:
[FONT=Lucida Console][SIZE=1]
.
.
.
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
.
.
.
[/SIZE][/FONT]
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:
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?
Thanks.
[FONT=Lucida Console][SIZE=1]
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;
beginstring 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
ParsePath(szFile, szDir, PATH);
MsiSetProperty(ISMSI_HANDLE, "IS_BROWSE_FILEBROWSED", szDir);
return 0;
end;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");
elseMsiSetProperty(ISMSI_HANDLE, "CERTFILEOK", "No");
MessageBox("File " + szFile + " does not exist.", SEVERE);
endif;MessageBox("File " + szFile + " does not exist.", SEVERE);
ParsePath(szFile, szDir, PATH);
MsiSetProperty(ISMSI_HANDLE, "IS_BROWSE_FILEBROWSED", szDir);
return 0;
.
.
.
[/SIZE][/FONT]
Everything compiles and builds ok. However, it fails at runtime without executing a line. Here is the MSI log extract:
[FONT=Lucida Console][SIZE=1]
.
.
.
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
.
.
.
[/SIZE][/FONT]
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:
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?
Thanks.
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Feb 20, 2018
08:06 PM
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);
and
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.
export prototype ExFn_ValidateCertFile(HWND);
and
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.