elanius
Posts: 38
Joined: Fri May 15, 2009 9:49 am

Register VB runtime during installation

Hi

On some machines I have problem with my installer. It fails with error.
DEBUG: Error 2738: Could not access VBScript runtime for custom action
I know there is problem with VB runtime and I can register it with command regsvr32 vbscript.dll

But can I do it automatically from installer? to avoid manual registration.

Or another question. I have VB inline script
Session.FeatureRequestState("feature")=2
And I want to rewrite in into DLL CA to avoid using VB. But I don't know how get 'Session' object from my CA.
Some example of using Session.FeatureRequestState or another Session function, property from DLL CA will be very useful for me.

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

Re: Register VB runtime during installation

Hi,
I know there is problem with VB runtime and I can register it with command regsvr32 vbscript.dll
But can I do it automatically from installer? to avoid manual registration.
Sure, you can use a Launch file or open URL custom action which launches regsvr32. To find vbscript.dll on the target machine you can use a search.
And I want to rewrite in into DLL CA to avoid using VB. But I don't know how get 'Session' object from my CA.
This can be done through MsiGetProperty() function only in Win32 DLLs which receive an installation handle. Our user guide contains a sample C++ DLL custom action which may help you.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
elanius
Posts: 38
Joined: Fri May 15, 2009 9:49 am

Re: Register VB runtime during installation

Hi, thanks for you advice.
But I am not sure if I have understood second part.

I have one inline VB skript:

Code: Select all

Session.FeatureRequestState("feature")=2
and I need rewrite it into Win32 DLL Custaom Action. This CAs are well known for me. In my project are more than 50 CA written in Win32 C++ and MsiGetProperty() function I am hugely using. But MsiGetProperty is for obtaining properties from MSI database. FeatureRequestState is property of Session object not property of MSI database. So what I need is to get instance of Session object into my Win32 DLL CA and than set its property in order to change feature state.
Probably it can by done through ISession interface like COM objects but this is something new for me.
IID_ISession is defined as 000C109E-0000-0000-C000-000000000046
Or better. Is there any way to change feature state from Win32 DLL C++ Custom Action( through MSI API )?

thanks.
elanius
Posts: 38
Joined: Fri May 15, 2009 9:49 am

Re: Register VB runtime during installation

So, probably I am blind because there is MSI api function MsiSetFeatureState which do exactly what I want.

regards,
elanius.

Return to “Common Problems”