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!

rjpedrosa
Posts: 7
Joined: Wed Oct 19, 2022 12:17 pm

Conditional file based on command line install parameter

Hi,

I have a folder with a couple of license files. Would like these to be installed conditionally, based on a command line install parameter (for a silent install from the command line).

E.g.

"License" folder contains 2 files:

Code: Select all

a123.lic
b456.lic

Parameter -lic=a123 would copy a123.lic file to the app base folder as license.lic (or any other folder I specify)
Parameter -lic=a456 would copy a456.lic file to the app base folder as license.lic (or any other folder I specify)

Is this possible?

Thanks in advance
Catalin
Posts: 7853
Joined: Wed Jun 13, 2018 7:49 am

Re: Conditional file based on command line install parameter

Hello,

That would be possible, although not exactly how you want it.

Here is how you can proceed:

- go to "Files and Folders" page

- right click on your .LIC file --> "Go to component"

- use the "Condition field" to condition the component, as it follows:

Code: Select all

LIC_A123="installed"
- repeat the same for the other .LIC file, e.g.:

Code: Select all

LIC_A456="installed"
Note: the two .LIC files, since they have the same extension, might be added under the same component. To create two components, you can expand the component, select the file --> right click on it --> "Move to New Component".

After that, you can choose to install either files through a command line as it follows:

Code: Select all

msiexec /i "<path_to_msi>" LIC_A123="installed"
If it's a setup.exe, then the command line would become:

Code: Select all

setup.exe LIC_A123="installed"
Hope this helps!

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

Return to “Building Installers”