AI_New_User
Posts: 10
Joined: Thu Aug 26, 2021 4:57 pm

How to update an already existing aip?

Thu Oct 14, 2021 7:23 pm

I have a project / aip already. But I want to --through PowerShell-- update the version number, product code, and the files (that will go in appdir).

I have this code:

Code: Select all

$advinst = New-Object -ComObject AdvancedInstaller
$project = $advinst.CreateProjects(“enterprise”)
$project.ProductDetails.Name = "Existing Project"
But this seems to be for a brand new installer, not an existing one.

Is there a full example of how to update an existing aip?

Liviu
Posts: 199
Joined: Tue Jul 13, 2021 11:29 am
Contact:  Website

Re: How to update an already existing aip?

Fri Oct 15, 2021 7:45 am

Hello,
But I want to --through PowerShell-- update the version number, product code, and the files (that will go in appdir).
You need to use a command like this:

Code: Select all

$advinst = New-Object -comobject AdvancedInstaller

$project = $advinst.LoadProject("C:\Your Application.aip")
$project.ProductDetails.Version = "2.0.0"
$project.ProductDetails.ProductCode.GenerateAll()
$project.FilesComponent.AddFileS("APPDIR", "C:\Desktop\test.txt")
$project.Save()
When you want to edit an existing project, just use the LoadProject command.

To change the product code you can check all the commands here: ProductCode PowerShell Automation.
Is there a full example of how to update an existing aip?
You can find more information and code example in our User Guide: PowerShell Automation

You can also have a look on our video: PowerShell Automation video tutorial.

Hope this helps! If you have any other questions, please don't hesitate to contact us.

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

AI_New_User
Posts: 10
Joined: Thu Aug 26, 2021 4:57 pm

Re: How to update an already existing aip?

Wed Oct 20, 2021 5:10 pm

I checked PowerShell Automation but didn't see the code to set Builds as in (Package Definition > Builds > Builds > Settings > Builds)

In the example, how do I pick EITHER DefaultBuild or Build (not both) in Powershell?
Test_AI_1.PNG
Test_AI_1.PNG (40.21KiB)Viewed 4760 times

Liviu
Posts: 199
Joined: Tue Jul 13, 2021 11:29 am
Contact:  Website

Re: How to update an already existing aip?

Thu Oct 21, 2021 1:36 pm

Hello,

Unfortunately, we do not have command line (automation) support for this setting.

I have added this improvement on our TODO list and it will be included in the future.

Thank you for your suggestion!

However, I have sent you over the email an RC Version which implements this. You can test this version and let us know if everything works as expected.

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”