Is it really ok to use VBScript for custom actions? - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

johndwill
Posts: 5
Joined: Sat Oct 20, 2007 2:11 am

Is it really ok to use VBScript for custom actions?

Hi all,

I've read on other sites that there is a general recommendation against using VBScript or JScript for custom actions. I believe this is because the windows scripting support may not be available on the target machine.

Does Caphyon have any official recommendation? Should I use C++ or would the scripts be sufficient.

I'm targeting Windows XP and higher operating systems if that makes a difference.

Thanks
John
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi John,

Indeed VBscript/JScript custom actions are not very recommended and yes, one of the reasons is because Windows Script Host may not be available on all target machines. Other arguments can be found here:
http://blogs.msdn.com/robmen/archive/20 ... 36530.aspx

Best recommendation is to use C++ DLL custom actions:
http://msdn2.microsoft.com/en-us/library/aa368075.aspx

You can read more about all type of custom actions supported by AI and how to use them here:
http://www.advancedinstaller.com/user-g ... types.html

Regards,
Gigi
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com/
johndwill
Posts: 5
Joined: Sat Oct 20, 2007 2:11 am

Thanks for the quick reply, Gigi.

One other question, I have several custom actions in a single C++ DLL. It looks like the DLL gets inserted into a new row in the Binary table each time I reference a different function. I would assume then that the recommendation would be to separate the functions out into separate DLLs to avoid the duplication. Would you agree?

John
UnstoppableDrew
Posts: 32
Joined: Tue Oct 16, 2007 4:04 pm
Location: Burlington, MA USA
Contact: Website Yahoo Messenger

How much VBS functionality is actually available ? I have a pretty simple script that does some substitutions in a web.config changing all instances of 'localhost' to the name of the host being installed on. I've already had to strip it down because wscript objects aren't available. Now it's dieing when I try to open the file for reading.

Writing a C++ dll isn't really a viable option for me. I'm a release engineer, I haven't written C in 10+ years, and never really learned C++. I'd prefer to do it in Perl but I can suffer through vbs. But it's not much use if I can't even do something as basic as read & write files.
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

johndwill wrote:Thanks for the quick reply, Gigi.

One other question, I have several custom actions in a single C++ DLL. It looks like the DLL gets inserted into a new row in the Binary table each time I reference a different function. I would assume then that the recommendation would be to separate the functions out into separate DLLs to avoid the duplication. Would you agree?

John
I cannot reproduce this behavior on my test machine, the binary is not duplicated. Please make sure you use the same DLL file (located in the same folder on the disk).
UnstoppableDrew wrote:How much VBS functionality is actually available ?
VBS custom actions are fully supported, but they have some drawbacks as in the arguments mentioned in my previous post. However web.config file is an XML based file. Next version of AI (scheduled for release this week) will offer support for importing/updating XML files and then you can import this file as XML rather than regular file.

Regards,
Gigi
Last edited by gigi on Tue Oct 23, 2007 2:13 pm, edited 1 time in total.
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com/
johndwill
Posts: 5
Joined: Sat Oct 20, 2007 2:11 am

I cannot reproduce this behavior on my test machine, the binary is not duplicated. Please make sure you use the same DLL file (located in the same folder on the disk).
You're correct. It's only showing up once. I'm not sure what I was seeing!

Thanks again.
UnstoppableDrew
Posts: 32
Joined: Tue Oct 16, 2007 4:04 pm
Location: Burlington, MA USA
Contact: Website Yahoo Messenger

gigi wrote: VBS custom actions are fully supported, but they have some drawbacks as in the arguments mentioned in my previous post. However web.config file is an XML based file. Next version of AI (scheduled for release this week) will offer support for importing/updating XML files and then you can import this file as XML rather than regaler file.
Cool. I was just about to purchase it anyway, that's like icing on the cake.
UnstoppableDrew
Posts: 32
Joined: Tue Oct 16, 2007 4:04 pm
Location: Burlington, MA USA
Contact: Website Yahoo Messenger

gigi wrote: Next version of AI (scheduled for release this week) will offer support for importing/updating XML files and then you can import this file as XML rather than regular file.
Any update on that release ? I really need the 'update xml' functionality.
Thanks,
Drew
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi Drew,

The next release is targeted for the beginning of the next month.

Regards,
Gigi
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”