mthama
Posts: 15
Joined: Mon Feb 10, 2014 1:49 pm

Mod operator in VBS custom actions

Hello all,
Does Advanced Installer implement the MOD operator (Mod) in Visual Basic Scripts? When we was coding a VBS within custom action, we've found that an error occurs whenever we write a Mod operator.
Thank you! Indeed, this forum is really fast when answering! =)
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Mod operator in VBS custom actions

Hello,

I'm not sure why you encountered this behavior. I've tested your scenario but I cannot replicate it.

Also, I've attached a sample which implement your scenario.
I've used the predefined Execute inline script code custom action with sequence on the Wizard Dialogs Stage. This custom action is basically a small VBScript or JScript that is ran during the install process.
In order to launch a vbs file which is not among my project files I've used the predefined Launch attached file custom action with sequence. Using this type of custom action you can execute an application (EXE or DLL) or run a script (VB or Java script) which is not among your project files.  This source file will be embedded in the MSI file but will not be deployed at install time with the other application files.

Maybe the Why does my VBScript custom action fail to run? artcile and How do I debug a .VBS custom action? can help you.

Please let us know if that helped.

Best regards,
Dan
Attachments
VBS_ScriptSample.zip
(2.75 KiB) Downloaded 369 times
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mthama
Posts: 15
Joined: Mon Feb 10, 2014 1:49 pm

Re: Mod operator in VBS custom actions

Hi Dan,
Thank you for the given attention. I'd like to say that MOD operator is OK.
I'm a beginner with VBS and I was trying to use MOD operator in a wrong type.
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Mod operator in VBS custom actions

You're welcome,

Here's are some VBSript examples which may be useful to you.

However, we recommend you to use a DLL custom action for example, you can create your custom action as a custom action written in C# or a custom action written in C++, instead of VBScript and you can see some reasons why not to use VBScript .
Then you can go in the “Custom Actions” page and add a predefined Launch attached file custom action with sequence. This type of custom action can execute an application (EXE or DLL) or run a script (VBScript or Java script). Also, the source file will be embedded in the MSI file but will not be deployed at install time with the other application files.

If there is anything else I can help with, please let me know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”