- Revenera Community
- InstallAnywhere Forum
- Passing command line arguments to installer
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Printer Friendly Page
Passing command line arguments to installer
I'm trying to set up a silent installer for an InstallAnywhere 2018 suite project for MacOS. Ideally for our customers, we'd like to be able to use command line arguments to select the directory and features for installation.
The solution seems to be -D command line argument described here and elsewhere in the docs:
It took me awhile to figure it all out, but I got it set up using a response file. Here's an example:
This installs the features cs and de (language packs, actually) into the /Applications/zzzz directory. It works.
I'm trying everything I can to make this work with command line arguments:
open ./SketchUp.app --args -i silent -D\$INSTALLDIR\$=/Applications/zzz
open ./SketchUp.app --args -i silent -DINSTALLDIR=/Applications/zzz
open ./SketchUp.app --args -i silent INSTALLDIR=/Applications/zzz
open ./SketchUp.app --args -i silent -D INSTALLDIR=/Applications/zzz
open ./SketchUp.app --args -i silent -D$INSTALLDIR$=/Applications/zzz
open ./SketchUp.app --args -i silent -D@INSTALLDIR@=/Applications/zzz
But nothing seems to work. Has anyone had any success with this?
Thank you for your post.
Please allow me some time to look into this issue and update you.
Thank you for your patience.
I tested with an installer for Windows to establish a baseline reference / starting point for troubleshooting.
I confirmed that this command runs the installer silently and sets the install location:
install.exe -i silent -DUSER_INSTALL_DIR=C:\MyTestDir
But I understand that you are installing on Mac.
From the install.app/Contents/MacOS folder, I ran:
./install -i silent -DUSER_INSTALL_DIR=/Applications/MyTestFolder
but the installer still installed to the default installation location (the default $USER_INSTALL_DIR$ location).
So my test results match yours in that it does not work; I am not sure whether the behavior that you experienced was exactly the same.
Based on these test results, you can run an installer for Mac silently, but the tests indicate that $USER_INSTALL_DIR$ cannot be set and passed from the command-line. It is quite possible that the installer does not accept any parameters besides -i silent. I understand that you would prefer not to use a response file, but you would need to use a response file, which I believe you reported works, for this to work.
Thank you. Are you assuming that non-standard variables (say the FEATURES define I am using) will not work either?
Is this going to be logged as a bug and fix, or will the documentation be updated to reflect that the command line arguments don't work on Mac?
Thank you for your reply. You are welcome; I am happy to help.
Yes, you are correct--I don't expect that any InstallAnywhere variables will work, only the -i silent parameters and response files.
I submitted a Documentation Enhancement request for this issue. The request is for documentation that clarifies silent installs and response files on Mac, including this use case of passing InstallAnywhere variables as parameters. Please let me know if this request doesn't work for you.