Prerequisite custom executable running order - 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!

Arthur
Posts: 69
Joined: Wed May 19, 2010 9:53 am

Prerequisite custom executable running order

Hi, I have an installer that has several prerequisites. One of the prerequisite is .Net Framework 2.0. Another is an Anti Virus programme. The anti virus prerequisite is conditional on a VB executable. The VB executable needs .Net Framework 2.0. I have the .Net Framework 2.0 prerequisite as the first thing in the list, the AV prerequisite is several items later. When I start the installer, I get an error from my VB executable. After that, .Net Framework 2.0 is installed, and when it gets to the Anti Virus prerequisite, the executable works correctly.

Why is the VB executable running before the .Net Framework 2.0 prerequisite is installed? Can I change this?

Arthur
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Prerequisite custom executable running order

Hello Arthur,

Please keep in mind that searches from prerequisites install conditions are performed early, before the prerequisites start. So, if your prerequisites are added both as pre-install prerequisites or as feature-based prerequisites, then your searches from prerequisites install conditions will be performed before your first prerequisite starts.

In order to correctly perform your search done by the VB executable you should add .Net Framework 2.0 as pre-install prerequisite and your antivirus program as feature-based prerequisite.

If you have any questions let me know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Arthur
Posts: 69
Joined: Wed May 19, 2010 9:53 am

Re: Prerequisite custom executable running order

Hi Daniel,

My Anti Virus installer needs to reboot the machine once it's finished, so I can't make it a feature based prerequisite.

My Visual Basic executable is looking to see if there is any Anti Virus on the system , not necessarrily the one that I have as a prerequisite. I'm doing this by querying the Microsoft Action Centre. If there is AV already on the system, then I don't install any, but if there's none, then I do. Is there any way that AI can check this?

Arthur
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Prerequisite custom executable running order

Hello Arthur,

In order to achieve what you want you should add the antivirus program as post-install prerequisite.

Another approach would be to add the antivirus as feature-based prerequisite with an install command line which will set the antivirus to not reboot after install. Also, you should perform a system reboot after the main package installation is complete. From "Install Parameters" page set the "Reboot Behavior" to "Force Reboot after install".
Is there any way that AI can check this?

No, unfortunately Advanced Installer doesn't offer such a functionality.

If you have any questions let me know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Arthur
Posts: 69
Joined: Wed May 19, 2010 9:53 am

Re: Prerequisite custom executable running order

Hi Daniel,

The reboot is required to allow the Microsoft Action Centre to pick up the changes in the Anti Virus status. If I don't reboot, the VB executable fails and reports that the Anti Virus prerequisite hasn't been installed. That would mean that a post install prerequisite wouldn't work.

Arthur
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Prerequisite custom executable running order

Hello Arthur,

You can add .Net Framework 2.0 as a launch condition for your package installation. Then, you can add your antivirus program as pre-install prerequisite using "Reboot system after installing this prerequisite" option. Also, from "Prerequisite" page you should enable "Check predefined launch conditions before searching for prerequisites" option.

Another solution would be to use a native exe for your antivirus prerequisite install condition. In this way you don't need .Net Framework runtime in order to run your exe.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Arthur
Posts: 69
Joined: Wed May 19, 2010 9:53 am

Re: Prerequisite custom executable running order

Hi Daniel,

thanks for the reply. If I add .Net Framework 2.0 as a launch condition, that won't actually install .Net Framework 2.0, will it? If it's not installed, then the user won't be able to run my installer. That's not realy what I want - I need a self contained installer, that includes everyrthing needed by the installer.

I think I can see another way around this - if I add a restart after installing .Net Framework 2.0, then the VB exe should work ok. That would mean two reboots before the install actually starts, and then I also need another one at the end... I might try a completely different approach.

I don't think native exes can query the Microsoft Action Centre.

Arthur
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Prerequisite custom executable running order

Hello Arthur,
If I add .Net Framework 2.0 as a launch condition, that won't actually install .Net Framework 2.0, will it? If it's not installed, then the user won't be able to run my installer.

Yes, this is true. The users will have to manually install .Net Framework 2.0 ( if isn't already installed) before running your installation package.
I think I can see another way around this - if I add a restart after installing .Net Framework 2.0, then the VB exe should work ok. That would mean two reboots before the install actually starts, and then I also need another one at the end...

I'm afraid this is a wrong approach. As I mentioned in my previous post, searches from prerequisites install conditions are performed before the prerequisites installation starts. So, your VB executable will be scheduled before .Net Framework 2.0 prerequisite installation will start.

However, if my previous solutions aren't suitable for your scenario, then you can try the following workaround:
- Create a separate installation package (i.e. ANTIVIRUS_PACKAGE) which will contain the antivirus program added as pre-install prerequisite using "Reboot system after installing this prerequisite" option. Here you can add your search done by the VB executable for antivirus prerequisite.
- Create your main installation package and add .Net Framework 2.0 and ANTIVIRUS_PACKAGE as pre-install prerequisite. Also, ANTIVIRUS_PACKAGE prerequisite should be set to always install.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Arthur
Posts: 69
Joined: Wed May 19, 2010 9:53 am

Re: Prerequisite custom executable running order

Hi Daniel, you're right of course - I'd still see the error with my workaround. Your solution looks better.
Thanks, Arthur

Return to “Common Problems”