hajo68
Posts: 6
Joined: Wed Mar 02, 2016 4:42 pm

Running exe with parameters in custom action

Hi,

I want to run an exe file with command line parameters in a custom action but I don't know how to do it. In my case I want to run the following to install JDK 8 with NiNite:
NiNitepro.exe /select "JDK" "JDK x64" /disableshortcuts /disableautoupdate /silent. Is it possible to do that and how?

Best Regards,

John
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Running exe with parameters in custom action

Hi John and welcome to Advanced Installer forums.

In order to install a package from another package, you can go in the "Prerequisites" page and add your EXE file as described in the "Add Prerequisites" tutorial. The command line can be written in the appropriate fields from the "Setup Files" tab of the prerequisite.

Let me know if this helped, otherwise give me more details about your scenario.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
hajo68
Posts: 6
Joined: Wed Mar 02, 2016 4:42 pm

Re: Running exe with parameters in custom action

Hi Eusebiu,

Thank you for your quick response.

I want to build a msi package containing files and that also runs a exe file with command line parameters. Instead of running separate exe it would be nice to run them from inside the msi. In this case I want to run NiNite. I don't know if you are familiar with NiNite but it is a program that connects to a server and downloads and install software. For example if I want to install the latest Java JDK I just run "NinitePro /select "JDK" "JDK x64" /disableshortcuts /disableautoupdate /silent"

I'm note sure how to use Advanced Installer to do that. Is there any examples that I can look at?

Best,

John
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Running exe with parameters in custom action

Hi John,

Since, JDK is an installer package, it cannot be installed as a custom action from another package because two MSI-based packages cannot be installed at the same time. So, you need to install it through the prerequisites support as described in the tutorial I mentioned above. Just add "NiNitepro.exe" file as a "pre-install" prerequisite, then go in the "Setup Files" tab and write the command line in the "Install Command Line" fields.

Just let me know if you need more details.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
hajo68
Posts: 6
Joined: Wed Mar 02, 2016 4:42 pm

Re: Running exe with parameters in custom action

Hi Eusebiu,

Thank you for your advice, I have now manage to install JDK from inside my msi package by using the "Prerequisites" page. I noticed that that the JDK installation continued after the install wizard ended but it worked!

Best Regards,

John
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Running exe with parameters in custom action

You're welcome John. I'm glad you got this working.

The installation may continue after the install wizard ends if the "NiNitepro.exe" application returns a success code just after it launches the JDK installer. If you want to avoid this, you can add the "JDK" prerequisite directly from the predefined prerequisites list, without using the "NiNitepro.exe" application to handle it.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”