Link to information about MSI script-based custom action error codes 2738 and 2739
Heath Stewart posted an item on his blog this past week that I wanted to raise awareness about. In the post, located at https://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:
- Click on the Start menu, choose Run, type cmd and click OK
- To unregister the VBScript engine, run this command: reg delete "HKCU\SOFTWARE\Classes\CLSID\{B54F3741-5B07-11CF-A4B0-00AA004A55E8}" /f
- 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
- To unregister the JScript engine, run this command: reg delete "HKCU\SOFTWARE\Classes\CLSID\{F414C260-6AC0-11CF-B6D1-00AA00BBBB58}" /f
- 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>
Comments
Anonymous
June 07, 2007
PingBack from http://www.joyofsetup.com/2007/06/07/when-vbscript-and-jscript-custom-actions-arent-utterly-evil/Anonymous
September 19, 2007
The comment has been removedAnonymous
April 01, 2008
Recently, while attempting to build a Japanese MSI using WiX v3.0 , I received an error message thatAnonymous
February 12, 2009
PingBack from http://www.lrthompson.com/ppc/google-adwords-editor-vista-error-2739-fix/Anonymous
July 28, 2009
Under Windows 7 x64 I also had to delete this key:HKEY_CURRENT_USERSoftwareClassesWow6432NodeCLSID{B54F3741-5B07-11CF-A4B0-00AA004A55E8}Anonymous
July 29, 2009
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.Anonymous
June 22, 2010
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 OFFFOR /D %%I IN (%0) DO CD /d %%~dpISET ARCH=x86rem If either is set to AMD64, we have a 64bit OSIF /I "x%PROCESSOR_ARCHITECTURE%x" == "xAMD64x" SET ARCH=x64IF /I "x%PROCESSOR_ARCHITEW6432%x" == "xAMD64x" SET ARCH=x64FOR %%V IN (VBScript JScript) DO CALL :Register %%VGOTO :done:RegisterCALL :SetupEnvIF DEFINED REGSVR32 CALL :RegScript %1GOTO:EOF:SetupEnvSET REGSVR32=IF "%ARCH%" == "x86" (
) ELSE (CALL :SetupEnv32
)GOTO:EOF:SetupEnv32SET REGSVR32=%SystemRoot%System32regsvr32.exeSET HKCU=HKCUSOFTWAREClassesSET HKLM=HKLMSOFTWAREClassesGOTO:EOF:SetupEnv64SET REGSVR32=%SystemRoot%SysWOW64regsvr32.exeSET HKCU=HKCUSOFTWAREWow6432NodeClassesSET HKLM=HKLMSOFTWAREWow6432NodeClassesGOTO:EOF:RegScriptSET SCNAME=%1IF NOT DEFINED SCNAME GOTO:EOFIF %SCNAME% == VBScript (CALL :SetupEnv64
) ELSE (SET KEY=B54F3741-5B07-11CF-A4B0-00AA004A55E8
)ECHO Registering ScriptingHost for %SCNAME% (%ARCH%)reg delete "%HKCU%CLSID{%KEY%}" /f >NUL 2>NULreg delete "%HKLM%CLSID{%KEY%}" /f >NUL 2>NUL"%REGSVR32%" "%SCNAME%.dll" /sIF ERRORLEVEL 1 GOTO :errorGOTO:EOF:errorECHO Failed to register ScriptingHost for %SCNAME% (%ARCH%)!ECHO.GOTO:EOF:doneECHO.PAUSESET KEY=F414C260-6AC0-11CF-B6D1-00AA00BBBB58
Anonymous
October 10, 2010
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.Anonymous
October 10, 2010
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.Anonymous
October 13, 2010
thanks manAnonymous
December 14, 2010
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!Anonymous
December 15, 2010
The comment has been removedAnonymous
January 30, 2011
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.............Anonymous
January 31, 2011
Hi Luis - If you run c:windowssystem32cmd.exe, you will start in the system32 directory. If you run c:windowssyswow64cmd.exe, you will start in the syswow64 directory. For the steps in this blog post, you should use c:windowssystem32cmd.exe.Anonymous
February 23, 2011
Hi,I understand that your product has not to be installed due to this key but it's not possible to find before what is the application create this key (install or using) and solve it ?Kr,gillesAnonymous
February 24, 2011
Hi Gilles - I'm not sure I understand your question. Are you asking about what is causing those keys to be created in the first place? If so, there isn't one single root cause for that. Someone could be incorrectly registering the DLLs, or it could be a badly behaving setup program or something like that.Anonymous
May 24, 2011
tried re registering vb and jscrips . . . didnt workdeleted the 2 reg commands in W7 x64 and VOALLA . .Thanks for the post . . really helped me outAnonymous
June 21, 2011
Thanks, this article was very helpful.Anonymous
August 06, 2011
Had this problem installing CorelDraw 12 on Win7 64bit. Applied the 64-bit commands and it now installs properly. Thanks for the info!Anonymous
September 11, 2011
My problem is that i keep getting this error 2738, Could not access VBScript run time for custom action each time i try to uninstall a blackberry 9630 update and or install a srs HD audio lab software. I use a lenovo pc vista 32 bit.Anonymous
September 11, 2011
Hi Michael - Did you try the steps listed in this blog post to see if they help resolve this error? If you already tried those steps and they didn't help, then you may need to contact the manufacturer of the software that you're trying to install and see if they know of any other workarounds to try.Anonymous
November 11, 2011
Deleting the registry keys worked for me. Thanks.Anonymous
March 01, 2013
I TRIED UNREGISTERING THE VBSCRIPT ENGINE BY CMD...BUT IT IS NOT HAPPENING...IT SAYS- The system was unable to find the specified registry key or value.Anonymous
March 01, 2013
Hi Shubham - If you tried the commands and they reported that the registry keys are not found, then that likely means that the problem you're facing isn't the same one described in this blog post. What version of Windows are you using, and what is the exact error you're seeing?Anonymous
November 04, 2014
This is what fixed my problem.. just run Microsoft Fix it to reset VBScript security settingsblogs.technet.com/.../error-code-2738-when-running-a-microsoft-fix-it-solution.aspxAnonymous
January 06, 2015
You will also get this error if you are running the WiX build on a TFS Build Server and the Service Account under which the build process is running is not in the Local Administrators group on the machine. After adding the Build Service Account to the Local Administrators group on the build server, make sure to restart the Build Service.I can only assume that the Windows Installer service somehow limits access to account which are Local Administrators.Anonymous
May 13, 2015
Thanks Art, very pleased I read all the comments.Anonymous
February 11, 2016
Ref "Error 2738 Could not access VBScript runtime for custom action." Thanks Martin Schlemmer for your Batch file. I had spent many hours trying to repair this error and your batch file immediately fixed the problem. I appreciate your work and sharing very much.