canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Vista: "Error 2739: Could not access JavaScript runtime..."

Thu Oct 02, 2008 10:50 am

Hello everyone.

We just had this error message while trying to execute our installer on Windows Vista Home Premium, 32 bit, Service Pack 1 (automatic updates disabled, however):

"Error 2739: Could not access JavaScript runtime for custom action"

Googling for the error I came across these articles:

Basic information about the problem:
Windows Installer Errors 2738 and 2739 with Script Custom Actions
Internal error 2739 on Vista x64

Microsoft employees making excuses for why script custom actions are a bad choice (instead of fixing their own broken design of them):
Windows Installer Errors 2738 and 2739 with Script Custom Actions
Link to information about MSI script-based custom action error codes 2738 and 2739

Further information:
Adobe Creative Suite 3 application installer closes with error code 2739 (Windows Vista)
CLM does not install on Windows Vista
Javascript Custom Installer Actions on Vista
Windows Update Fix

So it seems that this problem may be caused by a misconfiguration that may even have other negative effects (Windows Update not working).

Checking the registry it turned out that the JScript engine is indeed registered under HKEY_CURRENT_USER on that machine, for the user we used to install our software.

The VBScript engine is not registered under HKEY_CURRENT_USER.



Is there a way detect this broken state in the installer and bring up a respective error message to the user (without using scripts...)?



With best regards

Clemens Anhuth
Last edited by canhuth on Thu Oct 02, 2008 1:06 pm, edited 1 time in total.

Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact:  Website

Re: Vista: "Error 2739: Could not access JavaScript runtime..."

Thu Oct 02, 2008 12:16 pm

Hi Clemens,

Does the custom action run without impersonation? Also, can you reproduce this behavior on other machines?

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Re: Vista: "Error 2739: Could not access JavaScript runtime..."

Thu Oct 02, 2008 1:03 pm

Hello Cosmin,

yes, I can reproduce the problem when I create the following registry entry:

Code: Select all

HKEY_CURRENT_USER\SOFTWARE\Classes\CLSID\{B54F3741-5B07-11CF-A4B0-00AA004A55E8}
The failing custom action is the first one in the project and it is set to immediate execution.



With best regards

Clemens Anhuth

Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact:  Website

Re: Vista: "Error 2739: Could not access JavaScript runtime..."

Thu Oct 02, 2008 1:14 pm

Hi Clemens,

This registry entry is not affected by the Windows Update settings and it is present only on a small number of machines (usually because of software corruption). However, you can detect it by using a search. The property of this search can then be used as a custom launch condition. This way you can make sure that the installation will not start and you can inform the user.

Please note that you could also try the recommended solution: C++ DLL custom actions.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Re: Vista: "Error 2739: Could not access JavaScript runtime..."

Thu Oct 02, 2008 1:41 pm

cosmin wrote:Hi Clemens,

This registry entry is not affected by the Windows Update settings and it is present only on a small number of machines (usually because of software corruption). However, you can detect it by using a search. The property of this search can then be used as a custom launch condition. This way you can make sure that the installation will not start and you can inform the user.
Ecellent, thank you very much Cosmin :)


Please note that you could also try the recommended solution: C++ DLL custom actions.
(C++ is something we try to avoid to some extent. The thought of a C++ DLL in VS 2005 in conjunction with the possibly required VS runtime files alone makes my stomach hurt.)



With best regards

Clemens Anhuth

canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Re: Vista: "Error 2739: Could not access JavaScript runtime..."

Fri Oct 10, 2008 10:47 am

cosmin wrote:This registry entry is not affected by the Windows Update settings and it is present only on a small number of machines (usually because of software corruption). However, you can detect it by using a search.
Hi Cosmin,

can I really check the existence of a key with a registry search? So far it seems to me that a registry search can only retrieve values, and not check for existence of keys.



With best regards

Clemens Anhuth

Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact:  Website

Re: Vista: "Error 2739: Could not access JavaScript runtime..."

Fri Oct 10, 2008 12:08 pm

Hi Clemens,

I'm afraid that a search cannot find a registry key directly. However, you can search a value in this key. If the value is found, then the key exists.

Another approach would be to use a custom action which enumerates the subkeys of "HKEY_CURRENT_USER\SOFTWARE\Classes\CLSID". This custom action can be scheduled under "InstallUISequence" -> "AppSearch" and under "InstallExecuteSequence" -> "AppSearch".

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Re: Vista: "Error 2739: Could not access JavaScript runtime..."

Fri Oct 10, 2008 1:40 pm

cosmin wrote:I'm afraid that a search cannot find a registry key directly. However, you can search a value in this key. If the value is found, then the key exists.
Hello Cosmin,

unfortunately in this case there is no guarantee that there is a value under the key.
Another approach would be to use a custom action which enumerates the subkeys of "HKEY_CURRENT_USER\SOFTWARE\Classes\CLSID". This custom action can be scheduled under "InstallUISequence" -> "AppSearch" and under "InstallExecuteSequence" -> "AppSearch".
Well, the examples you point to are scripts, but I need to find out whether I can execute scripts in the first place (hen-egg problem).

I guess if this is urgent for us we need to write a *.exe to perform the registry check.

Thank you Cosmin.



With best regards

Clemens Anhuth

Return to “Common Problems”