Summary
Discussion on the causes and resolutions of errors that result in 0x80040707 or 80040707Symptoms
When running an InstallShield installation, you receive the run-time error 0x80040707 / 80040707 with a message that is specific to each cause.
Cause
Cause 1: The error code 0x80040704 usually appears because the wrong calling convention for a DLL function is being used.
Cause 2: The error description 'Dll function call crashed: ISRT.PathGetSpecialFolder' occurs because the Windows API used to get the information fails if one of the special paths is invalid in the registry. This problem sometimes causes a DosExecPgm initialization error in 6.0.
Cause 3: The error description 'Dll function call crashed: ISRT.VerGerFileVersion' occurs on a call to VerGetFileVersion for a file in TARGETDIR because TARGETDIR has an invalid length. InstallShield has assigned this issue to work order number 1-8UA0V. This number can be referenced when tracking the issue.
Cause 4: This error might also occur during initialization.
Resolution
Resolution 1: Specify the calling convention in your DLL function declaration. The calling convention can be specified using either of the keywords cdecl or stdcall. Use the following syntax:
prototype [stdcall|cdecl] [ReturnType] [DllName.]FunctionName
( ParameterList ... );
Everything in [ ] is optional and stdcall is the default.
An example prototype would be:
prototype cdecl INT MyDLL.MyFunction(BYREF STRING);
Resolution 2: To workaround this exception, you can implement the following when calling ProgDefGroupType:
try ProgDefGroupType(...) catch endcatch;
Doing this will ignore the exception.
The special paths have not been documented by Microsoft. To test and narrow down the issue further, create a C++ program that calls the Windows API SHGetSpecialFolderLocation with CSIDL_DESKTOP, CSIDL_PROGRAMS, CSIDL_STARTUP, and CSIDL_STARTMENU. One constant should fail, and then through trial and error or research on MSDN, you can determine which registry value is invalid. You can then fix the registry value, and the Windows API should work on the system.
Resolution 3: As a workaround, the Is function can be used to verify that TARGETDIR is a valid directory. Here is a sample code snippet from the OnFirstUIBefore event handler showing a workaround:
function OnFirstUIBefore()
number nResult;
string szTitle, szMsg, svVersion;
begin
TARGETDIR = PROGRAMFILES ^ @COMPANY_NAME ^ @PRODUCT_NAME;
...
Dlg_SdAskDestPath:
szTitle = "";
szMsg = "";
nResult = SdAskDestPath( szTitle, szMsg, TARGETDIR, 0 );
if (nResult = BACK) goto Dlg_Start;
nResult = Is (DIR_WRITEABLE, TARGETDIR);
if (nResult= 0 ) then
// TARGETDIR is not writeable
MessageBox("TARGETDIR is not writeable. Enter a valid directory.", 0);
// reset the value of TARGETDIR
TARGETDIR = PROGRAMFILES ^ @COMPANY_NAME ^ @PRODUCT_NAME;
// go back to SdAskDestPath dialog
goto Dlg_SdAskDestPath;
elseif (nResult = 1) then
// TARGETDIR is writeable
MessageBox("TARGETDIR is writeable", 0);
// ok to call VerGetFileVersion
VerGetFileVersion(TARGETDIR^ "myfile.txt", svVersion);
else
MessageBox("Is function failed" , 0);
endif;
...
end;
Resolution 4: For further information about troubleshooting initialization issues, refer to the Knowledge Base article listed below.
Additional Information
For further information about the Windows API, SHGetSpecialFolderLocation, refer to the Microsoft article SHGetSpecialFolderLocation Function.
For further information and a more in depth example of the try, catch, and endcatch keywords, refer to the InstallShield Help Library topic Exception Handling.
Related KB Articles
Q104986 : Initialization Error Troubleshooting.Related Articles
Unhandled Exception 0x80040707 8Number of Views Run-Time Error 1919 3Number of Views Troubleshooting Run-Time Errors 3Number of Views Setup.exe Run-Time Error 1629 4Number of Views Microsoft Access Runtime 365 may crash when used by MGSBI to read data to be imported from files 12Number of Views
Hi, I am Reva - Ask me anything.
No new updates
Thanks for the feedback!
Your feedback has been saved.Rate this response:
Add Additional feedback ( Optional )
Are you sure you want to cancel
the case creation?
Are you sure you want to cancel the case creation?
Are you sure you want to close this case
| Products | Region | Phone Numbers |
|---|---|---|
| FlexNet Operations FlexNet Embedded FlexNet Publisher FlexNet Connect FlexNet Code Insight InstallAnywhere InstallShield |
North America * |
+1 630-332-2513 (toll) +1 877-279-2853 (toll-free in North America) |
| Europe * |
+44 1925 944367 (toll) +44 800 047 8642 (toll-free in Europe) |
|
| Japan * | +81 3-4540-5335 (select option 2) | |
| Australia * |
+61 3 9895 2177 +61 1800 560 603 (toll-free in Australia) |
|
|
Usage Intelligence (formerly
Revulytics) Compliance Intelligence |
Please use the Case Portal to submit your support ticket or reach out to your Revenera contact. | |
Case id: 00001065
Activity: Status change: 2 hours ago