Aaron Stebner's WebLog

Thoughts about setup and deployment issues, WiX, XNA, the .NET Framework and Visual Studio

Link to information about MSI script-based custom action error codes 2738 and 2739

Link to information about MSI script-based custom action error codes 2738 and 2739

  • Comments 25

Heath Stewart posted an item on his blog this past week that I wanted to raise awareness about.  In the post, located at http://blogs.msdn.com/heaths/archive/2007/05/31/windows-installer-errors-2738-and-2739-with-script-custom-actions.aspx, Heath described some potential issues and workarounds for script-based custom action failures in MSI-based setups.

These error codes appear in an MSI log file when a script-based custom action fails to run correctly, and the error messages look like the following:

  • 2738, Could not access VBScript run time for custom action [2].
  • 2739, Could not access JScript run time for custom action [2].

A common resolution for this type of error is to re-register the file %windir%\system32\vbscript.dll and/or %windir%\system32\jscript.dll.  However, on Windows Vista this can present problems because if you attempt to re-register these DLLs from a normal user cmd prompt, the registration will be written to HKEY_CURRENT_USER instead of HKEY_CURRENT_MACHINE.

A key point Heath makes in his blog post that I was not aware of before reading it is that Windows Installer will not load and use scripting engines if they are registered in HKEY_CURRENT_USER (for security reasons that he described in more detail in his post).  Therefore, if you have registered the DLLs on Windows Vista from a normal user cmd prompt, that will not help fix this type of error.

If you have these scripting engines registered under HKEY_CURRENT_USER, you need to make sure that you remove that registration and re-register them under HKEY_LOCAL_MACHINE.  You can use the following steps to unregister them from HKEY_CURRENT_USER:

  1. Click on the Start menu, choose Run, type cmd and click OK
  2. To unregister the VBScript engine, run this command:  reg delete "HKCU\SOFTWARE\Classes\CLSID\{B54F3741-5B07-11CF-A4B0-00AA004A55E8}" /f
  3. To unregister the VBScript engine on a 64-bit OS, run this command:  reg delete "HKCU\SOFTWARE\Classes\Wow6432Node\CLSID\{B54F3741-5B07-11CF-A4B0-00AA004A55E8}" /f
  4. To unregister the JScript engine, run this command: reg delete "HKCU\SOFTWARE\Classes\CLSID\{F414C260-6AC0-11CF-B6D1-00AA00BBBB58}" /f
  5. To unregister the JScript engine on a 64-bit OS, run this command: reg delete "HKCU\SOFTWARE\Classes\Wow6432Node\CLSID\{F414C260-6AC0-11CF-B6D1-00AA00BBBB58}" /f

One last note - if you are a setup developer reading this post, I encourage you to read this post by Rob Mensching where he explains reasons why using script-based custom actions in an MSI can lead to bad results and should be avoided if at all possible.

<update date="7/29/2009"> Added steps to unregister the VBScript and JScript engines on 64-bit OS's. </update>

 

  • PingBack from http://www.joyofsetup.com/2007/06/07/when-vbscript-and-jscript-custom-actions-arent-utterly-evil/

  • This is one the things that should have been taken care of by the instaler already. The instaler team has enhanced MSI for some while, but has not taken care of fixing some of the basic functionality of the product. I have submitted change request after change request for fixes to this since the beginning. Everytime I see posting referring to "this post by Rob Mensching", I completly freak out.  

    This is total rubbish. All of his assumption are total bull. IMHO

    1.- Robust code is difficult write in script.

    This is utterly nonsense, bad code can be writing in any language, but specially C. If the developer of the custom action written in script can not do a simple try{}catch() on his code, changing to C would not make it any better.

    2.  Debugging script in the Windows Installer is difficult

    Another stupid instaler team mistake and another request of mine. Has anyone on that team heard of "Active Scripting Host debug". Microsoft for some while sold us the idea of scripting debugging, I built several of them. doesn't that team care what their customer want?

    3.  Anti-virus products kill them

    My anti-virus kills any new code I put in my machine. Many ways exist of fixing this, but the main one is: Just execute the stupid script, do not put it in the file system, get it directly from the binary table and execute it, simple isn't it?

    4.- Make sure jscript.dll and vbscript.dll are correctly registered.

    So many things that are supposedly part of the base system (ie, media player, etc). Aren't those part of the system too since they are required by and used by the former apps? Shouldn't the system (MSI, etc) make sure they are in the correct state before executing an action which requires it?

    This is just the tip of the iceberg. I honestly think that script should be the ONLY allowable way of writing custom action, since they provide sort of a sandbox model to protect the end user from ill-intented code from the part of the producer of the MSI and for the most part (i could say allways) they provide all the functionality you may possible need, besides the fact that script is so easy to write and debug (with the right support, of course)

    I will send another set of emails to the Windows Installer Wishes mailto:msiwish@microsoft.com asking for some fixes for the upcoming 4.5 release. Let's hope someone is actually listening............

  • Recently, while attempting to build a Japanese MSI using WiX v3.0 , I received an error message that

  • PingBack from http://www.lrthompson.com/ppc/google-adwords-editor-vista-error-2739-fix/

  • Under Windows 7 x64 I also had to delete this key:

    HKEY_CURRENT_USER\Software\Classes\Wow6432Node\CLSID\{B54F3741-5B07-11CF-A4B0-00AA004A55E8}

  • Hi Navara - Thanks for the information.  I'll update the main blog post to include the x64 registry values in addition to the x86 registry values for this scenario.

  • Having had to do this more than once (and also for Visual Studio's Wizard issues), and on more than one machine, I wrote a batch file.  Simply copy below to a .bat, and right-click -> Run as administrator

    -----RegScriptHosts.bat-----

    @ECHO OFF

    FOR /D %%I IN (%0) DO CD /d %%~dpI

    SET ARCH=x86

    rem If either is set to AMD64, we have a 64bit OS

    IF /I "x%PROCESSOR_ARCHITECTURE%x" == "xAMD64x" SET ARCH=x64

    IF /I "x%PROCESSOR_ARCHITEW6432%x" == "xAMD64x" SET ARCH=x64

    FOR %%V IN (VBScript JScript) DO CALL :Register %%V

    GOTO :done

    :Register

    CALL :SetupEnv

    IF DEFINED REGSVR32 CALL :RegScript %1

    GOTO:EOF

    :SetupEnv

    SET REGSVR32=

    IF "%ARCH%" == "x86" (

    CALL :SetupEnv32

    ) ELSE (

    CALL :SetupEnv64

    )

    GOTO:EOF

    :SetupEnv32

    SET REGSVR32=%SystemRoot%\System32\regsvr32.exe

    SET HKCU=HKCU\SOFTWARE\Classes

    SET HKLM=HKLM\SOFTWARE\Classes

    GOTO:EOF

    :SetupEnv64

    SET REGSVR32=%SystemRoot%\SysWOW64\regsvr32.exe

    SET HKCU=HKCU\SOFTWARE\Wow6432Node\Classes

    SET HKLM=HKLM\SOFTWARE\Wow6432Node\Classes

    GOTO:EOF

    :RegScript

    SET SCNAME=%1

    IF NOT DEFINED SCNAME GOTO:EOF

    IF %SCNAME% == VBScript (

    SET KEY=B54F3741-5B07-11CF-A4B0-00AA004A55E8

    ) ELSE (

    SET KEY=F414C260-6AC0-11CF-B6D1-00AA00BBBB58

    )

    ECHO Registering ScriptingHost for %SCNAME% (%ARCH%)

    reg delete "%HKCU%\CLSID\{%KEY%}" /f >NUL 2>NUL

    reg delete "%HKLM%\CLSID\{%KEY%}" /f >NUL 2>NUL

    "%REGSVR32%" "%SCNAME%.dll" /s

    IF ERRORLEVEL 1 GOTO :error

    GOTO:EOF

    :error

    ECHO Failed to register ScriptingHost for %SCNAME% (%ARCH%)!

    ECHO.

    GOTO:EOF

    :done

    ECHO.

    PAUSE

  • Hello all:

    Thanks for all the great information, but I have tried ALL of the above methods, many times, and get no further.  The error continues, even when I get positive confirmation of registration.  When I browse through the registry after the positive confirmation, the key that people sometimes had to delete is never there.  I was under the impression that registering it would create that key.

    Even if that is a wrong way to double check, things like this batch file, even though giving positive results, I still cannot install my stupid verizon access manager.  I have worked with computers my whole life, and have never felt as helpless about fixing a problem as I do now.  Any further guidance would be greatly appreciated.

    Thanks.

  • Hi John - I'm sorry for the hassles that this issue is causing for you.  The information in this blog post is not the only possible cause for this type of error.  There could be a problem within the setup package as well.  If you're only seeing this type of error from this Verizon program and not from any other programs that you are trying to install on your computer, then I'd suggest trying to contact Verizon to see if they can provide more in-depth troubleshooting for this install error.

  • thanks man

  • Vodafone Mobile Connect Lite VMC Lite 9.4.4.19931 causes this problem on my Windows 7 Home Premium (32bit, Lenovo OEM) also. Vodafone could not help me. Regsvr32 I've run, HKCU doesn't contain the key, but problem still arises. I'm digging the net for correct solution. Can anybody help? Thanks a lot!

  • Hi Leslie - The information in this blog post only solves one of the possible causes of this error code.  There are other possible causes as well.  A common one I've seen is anti-virus or anti-spyware software that contains script blocker functionality.  If a script blocker is running during an install that tries to run a vbscript or jscript custom action, that custom action will fail and setup will fail.  It might help to temporarily disable your anti-virus and anti-spyware, then run this installer again.

    It is also possible that this issue is caused by a bug in the installer itself.  You mentioned that Vodafone could not help - do you know what exact troubleshooting steps they had you try?

  • Mi proble es que tengo windows vista de 64 bits pero al momento de ejeuctar como administrador me sale C.windows \system32> y no C:windows \ SysWow64 > como me deberia salir ya que tengo de 64 bit.

    Ayudenme gracias de antemano.............

  • Hi Luis - If you run c:\windows\system32\cmd.exe, you will start in the system32 directory.  If you run c:\windows\syswow64\cmd.exe, you will start in the syswow64 directory.  For the steps in this blog post, you should use c:\windows\system32\cmd.exe.

Page 1 of 2 (25 items) 12
Leave a Comment
  • Please add 3 and 5 and type the answer here:
  • Post