jmoleary
Posts: 53
Joined: Mon May 13, 2019 7:30 pm

Can I make AI download a pre-requisite at build time?

One of my application pre-requisites is .NET Desktop 10.0.5. But when I go to the prerequisites tab in AI, I only appear to have two options.

One option is to completely download the .NET installer immediately when I check the prerequisite box in AI and include it in my AI-built installer. Then it is up to me to store it in my source control

Another option is to download the .NET installer when the user runs my AI-built installer, requiring the user to have an internet connection.

I don't want to do the first option because I don't want to store huge Microsoft Installers in my source control. I cannot do the second option because many of my customers do not have internet connections.

What I would like to do is have AI download the .NET Installer only at build time. Is that possible?
Catalin
Posts: 7845
Joined: Wed Jun 13, 2018 7:49 am

Re: Can I make AI download a pre-requisite at build time?

Hello,
What I would like to do is have AI download the .NET Installer only at build time. Is that possible?
Would you like Advanced Installer to download it at install time and then add it to your installation package so that it can be run offline by your users?

If so, I am thinking of using a "pre-build" event where we download .NET and then add it to our AIP file via our PowerShell automation support. However, before offering a solution, I want to confirm that this is the scenario so I can test it further on my end to make sure everything is working as expected. :)

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jmoleary
Posts: 53
Joined: Mon May 13, 2019 7:30 pm

Re: Can I make AI download a pre-requisite at build time?

Hi Catalin.

I don't want Advanced Installer to download the package at install time. Many of the users who run my installer are not online.

I want AI to download the package at installer build time When I build my installer from my .AIP file. I know that I do always have an internet connection then.

In other words, I would like for my installer .AIP file to just hold some kind of reference (e.g. a URL) to the online location that gets turned into an actual included package once my installer has finished building. So that clients can run my installer without an internet connection but I don't need to store the package in my source control.
Catalin
Posts: 7845
Joined: Wed Jun 13, 2018 7:49 am

Re: Can I make AI download a pre-requisite at build time?

Hello,

Here is how we can achieve what you need.

For this, we will use our PowerShell COM Automation support, specifically the PrerequisitesComponent.
Screenshot_118.png
Screenshot_118.png (21.74 KiB) Viewed 13215 times
Here's how that looks in practice:

Code: Select all

$advinst = new-object -comobject AdvancedInstaller
$proj = $advinst.loadproject("your_project_path")
$prereq = $proj.PrerequisitesComponent
$prereq.NewPredefinedPackage(".NET Framework 4.8.1", "false")
This way, the prerequisite will be downloaded right away near your project and will be added in your project.
Screenshot_119.png
Screenshot_119.png (32.17 KiB) Viewed 13215 times
Screenshot_120.png
Screenshot_120.png (16.68 KiB) Viewed 13215 times

Hope this helps! :)

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”