Advanced installer calling my custom MSI with flag / argument via command line?

I created a custom MSI package and I am working with Advanced Installer to try and add some kind of command line argument "flag"

that can be run. When this flag is fired, it will trigger a chain of events in the installer (delete specific files, move folders around, extract the zip file ... So ...)

In other words, let's say I have a generated exe

from Advanced Installer named installer.exe

.

I want, from a command line call installer.exe --triggerEvents

, that will trigger a chain of custom events inside the installer itself.

After doing a little research, I came across this very good article that addresses my question:

How to pass command line arguments to custom actions of MSI installer

But it looks like the author is strictly focusing on MSI and not Advanced Installer, I would rather take advantage of this application which I use.

Is it possible to just invoke the installer by passing any argument I want and grab it with a custom action using a session? Or is there a way to do it using AI?

+3


source to share


1 answer


You should be able to create a public property in your MSI using the AdvancedInstaller (Install Parameters, Properties) page. Note that public properties must be ALL_CAPS , while private properties can contain lowercase letters.

Refer to the public property in your custom actions to get the property value at run time.

When calling msi from the command line, you can set the value of the public property like this:

msiexec.exe /i "C:\MyAwesomeApp.msi" AWESOME_PROP="myValue"

      



From your description, it looks like you are compiling the MSI into a bootloader . I understand that bootstrapper exe will pass arguments for the public property to the MSI on your behalf, ala:

C:\MyAwesomeApp.exe /i AWESOME_PROP="myValue"

      

I found it takes quite a bit of trial and error to get your custom actions to describe the content of a public property, and it also takes a lot of trial and error to get it working the way you want it to, but that's probably because I'm not great for MSI developers. In my case, I found myself building small test installers as the proof of concept more or less helps me debug what I am trying to do. Once I fix this, I will add this part to the actual AIP file I am working with and test there. Rinse and repeat as needed!

+4


source







All Articles