BobCrothers
Posts: 66
Joined: Wed Dec 05, 2007 10:58 pm

Opinion on Custom Actions

We have 5 Custom Action VBscripts which do small tasks, but are a necessary part of the install process. The install program has worked fine for several years. As soon as we moved to Windows 7 (64 bit) we ran into permissions issues. See
http://www.advancedinstaller.com/forums ... =2&t=11719

Today, I ran our install MSI program on a Windows 7 machine. The install failed, the error message was, "Could not access VBScript run time for custom action" This same install had worked fine previously. The following web site
http://www.nitropdf.com/kb/article.aspx?id=10106
suggested deleting the registry for vbscript.dll and registering vbscript.dll. This solved the problem. I never figured why I needed to register the DLL.

While researching the problem could not access VBScript problem, I came across this blog
http://blogs.msdn.com/b/robmen/archive/ ... 36530.aspx
The blog says to avoid using VBScript or Jscript for custom actions.

With the problems we have had with Windows 7 and our custom actions, I wonder if you should move away from custom actions. What do you think? What are the alternatives?

What about a vbs script like Session.DoAction("ResolveSource")?

Thanks
Bob
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Opinion on Custom Actions

Hi Bob,
I never figured why I needed to register the DLL.
The vbscript.dll registration could be easily altered for several reasons over time( viruses, someone tampered with the registry, etc ).
With the problems we have had with Windows 7 and our custom actions, I wonder if you should move away from custom actions. What do you think? What are the alternatives?
The best approach would be to use DLLs for your custom actions rather than VBScript or JScript custom actions. Here is sample DLL that contains the required signature.
What about a vbs script like Session.DoAction("ResolveSource")?
As you mentioned yourself, you would still be using VBScript to execute the ResolveSource action and this way you could encounter the same problems.
If you need, you can execute the ResolveSource action from a DLL custom action as well. You can find more related information from MSDN here.

Best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
BobCrothers
Posts: 66
Joined: Wed Dec 05, 2007 10:58 pm

Re: Opinion on Custom Actions

Hi Mihai,

Thank you for the quick, clear reply.

We will be converting our custom actions to DLLs.

Bob
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Opinion on Custom Actions

You're welcome Bob, glad to help.

Best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”