kkkwj
Posts: 88
Joined: Thu Mar 01, 2007 10:45 pm

Possible to programmatically generate an AIP file?

Mon Nov 21, 2022 3:09 pm

Q1. Is it 1) possible and 2) feasible to write a program to generate an AIP project file? I'm wondering if I can make a completely automated process by using a driver file (eg xml) of some kind to give a program enough information for it to generate an AIP file.

Q2. Is the AIP file an xml file?

Thank you

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Possible to programmatically generate an AIP file?

Tue Nov 22, 2022 9:21 am

Hello,

Advanced Installer offers the posibility to automate the most common tasks through its command line and PowerShell automation support.

Working with Advanced Installer from the command line

Advanced Installer PowerShell Automation Interfaces

Regarding the later one, we get feedback from our users constantly and try to improve it.

So the answer is yes, it is possible to programatically create an AIP file.

Regarding the feasability, it's not feasible to create the whole project from scratch. I do not see a reason why you'd do that when the UI is so much simpler to use. However, the automation can come in handy for sure.
Q2. Is the AIP file an xml file?
Yes, it is.

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

kkkwj
Posts: 88
Joined: Thu Mar 01, 2007 10:45 pm

Re: Possible to programmatically generate an AIP file?

Tue Nov 22, 2022 7:18 pm

Thank you for the pointers to the CLI interface. I had looked at those operations before and concluded that the interface was more concerned with using an existing .aip file than with creating and using such a file. I was hoping for something like this:

Code: Select all

# create a folder containing all the files to install
set filestoInstallDir=c;/my/files/to/install
copy my/documentation/userManual.pdf %filestoInstallDir%/userDocs
copy my/documentation/refManual.pdf %filestoInstallDir%/userDocs
copy -recursive v/studio/proj1/proj1/publish/.../winx64/* %filestoInstallDir%/AppDir/*
etc.

# create an installer aip project from files built in visual studio NET 6 and other document files
# define and pass in all the necessary AIP options in a reusable XML file
set outputDir=docs/ai/myprojectMSI
advinst -newAip -FilesToInstall %filestoInstall% -xmlOptionsSettings some/optionsFileMSI.xml -outputFolder docs/ai/myprojectMSI/ 

# copy the generated installer
copy %outputDir%/.../myproject.MSI (or EXE, MSIX, specified by the input xml options

kkkwj
Posts: 88
Joined: Thu Mar 01, 2007 10:45 pm

Re: Possible to programmatically generate an AIP file?

Tue Nov 22, 2022 9:10 pm

PS. Maybe it is helpful to say that I have code that automatically generates Visual Studio project files. For example, it makes it possible to 1) generate a HelloWorld.cs program, 2) generate a visual studio project file, 3) build the program using VS and the project file, and 4) publish the binaries to the publish folder.

Now I am trying to figure out if it is possible to 1) generate a set of options for installation (call it an "AIoptions.xml" input file), 2) use the options file to generate a working .aip file, 3) build the installer using the .aip file, and then 4) copy out the final installer.

You could imagine running the installer at the end of the process to install HelloWorld on the developer's machine for testing. So, that's my goal - create a complete hands-off "build an installer and run it" experience. (This would be useful because I want to use voice for programming - trying to click around a UI interface with voice/mouse commands is a VERY tedious process. I would like to avoid it if possible.) Thank you

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Possible to programmatically generate an AIP file?

Wed Nov 23, 2022 3:56 pm

Hello,

I think you should have a look over the following article which explains how to achieve something similar with what you'd like:

Professional Installation from CLI]Professional Installation from CLI

Of course, with some tweaks here and there.
generate a set of options for installation (call it an "AIoptions.xml" input file)
I'm afraid this might not be possible.

Instead, you could use a "file of commands":

Executing a file of commands

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

kkkwj
Posts: 88
Joined: Thu Mar 01, 2007 10:45 pm

Re: Possible to programmatically generate an AIP file?

Wed Nov 23, 2022 7:11 pm

As always, thank you for your help. (FYI, the first link above seemed to be broken.) My question (goal) is about how to generate an .aip file without moving my mouse through the AI GUI. I'm guessing the closest that I will get is to make a first template AIP file and then clone/modify it programmatically to create a custom AIP file for new installations.

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Possible to programmatically generate an AIP file?

Thu Nov 24, 2022 11:39 am

Hello,

Thank you for your followup on this!

Indeed, I somehow forgot to attach the URL for the link above - I have edited it now and everything should be working as expected. :)

If you'd like to create a project as a template, please make sure you do not copy/paste it as that can lead to some issues. Instead, simply use the "Save as template" option.

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

kkkwj
Posts: 88
Joined: Thu Mar 01, 2007 10:45 pm

Re: Possible to programmatically generate an AIP file?

Thu Nov 24, 2022 6:14 pm

Hi, thank you for the Save As Template pointer. I see the GUID issues and why using the Save as Template is the best way. At least that method will drastically reduce the number of clicks required to start up a new installer project!

There is so much to learn about installers ... it's a whole university course in itself! (And you would be the Master Professor Caitlin.. :-))

Thank you again for all your help. My plan is to push through all this installer stuff and create installers for all my apps over the Christmas slow period.

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Possible to programmatically generate an AIP file?

Fri Nov 25, 2022 9:30 am

Hello,

Thank you very much for your kind words! :)
My plan is to push through all this installer stuff and create installers for all my apps over the Christmas slow period.
If you require any assistance with this, please let me know and I will gladly assist (with a bit of delay, thought, as I might be offline for the Christmas period :) )

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

Return to “Building Installers”