How to run js function. - 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!

kkrzyzak
Posts: 47
Joined: Wed Oct 13, 2010 2:10 pm

How to run js function.

Hi,
I want to run function called runexe() from js file calles start.js using AI. I guess that i can do this using UI CustomActions but i realy don't know how to do it :(
I know how to assaign custom action to next button, but i really don't know how to setup the custom action to work.
Can anyone help me, please?

Here is code of my js file:

Code: Select all

MyObject = new ActiveXObject( "WScript.Shell" )  
         function RunExe()   
         {  
            MyObject.Run("file:///C:/Windows/regedit.exe") ;  
        }  
Karol.
kkrzyzak
Posts: 47
Joined: Wed Oct 13, 2010 2:10 pm

Re: How to run js function.

I only know how to run bat file.
How to lunch bat file using AI.

Karol.
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: How to run js function.

Hi Carol,

What you need to do is to add the JS files as a "New Attached Custom Action". In the "Function Name" field you can specify the name of your function.

After this simply attach it to the desired button, as you already know.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”