Matlab macOS install works in Terminal but not in ActionScript

Hi all,

I’m working on a deployment of Matlab R2017A to several computers and running into a strange issue where the command to install it works when I type in in Terminal, but not when I push it as a Task. I’ve gone through and figured out all of the contingencies around the path for the installation file, etc (using absolute paths below to remove that variable) – the issue is just that when I type the below in a Terminal and press “Enter,” it installs, and when I send the exact same thing in a task, it gives an exit code of 0 but does not install. The command is as follows (all one line although it looks like two):

/private/tmp/InstallForMacOSX.app/Contents/MacOS/InstallForMacOSX -inputFile /private/tmp/install.txt -activationPropertiesFile /private/tmp/activate.ini

When running it from the Terminal, the InstallForMacOSX binary runs a series of commands, which you can see by watching the top of the Terminal window – first it runs tail, then unzip, then the Matlab logo pops up (even in a silent install) and it starts to install. When running that same command from a task, prepended with “wait” or with “wait bash” or with “wait /bin/sh -c” and encasing it in quotes, nothing happens. I have an output file specified but it seems to not even get far enough in the installation process to create that file.

I’m totally stumped – the only thing I can think of is that as it starts running the tail and unzip commands as part of the install, it’s somehow not running it as part of the same job? Or that the part where it pops up the Matlab logo is somehow essential to the install and it can’t do it because the BigFix-sent job is running as root, not the logged on user and thus can’t display.

I would be extremely grateful for any help on this. Please let me know if I can clarify anything.

Remember the client runs things as root on the Mac so in terminal are you running as a user or as root? You might need to run as a user so check the override on how to run as the current user (also you need to check there is a current user) if that is the case

https://developer.bigfix.com/action-script/reference/execution/override.html

I’m not sure this will allow a user interaction. There is no way to request this to be silent?

1 Like

The thing is that it is specified as silent in the install.txt file that you feed the installer, it’s just that the Matlab logo pops up anyway. It doesn’t actually need user interaction.

The other thing I forgot to mention is that I’m running the file from Terminal as root (after doing sudo -s). Not sure if there’s a difference between that escalation and how BigFix runs?

Figured it out! It works if I change directory to /private/tmp before running the command, so the working command is

wait /bin/sh -c "cd /private/tmp; /private/tmp/InstallForMacOSX.app/Contents/MacOS/InstallForMacOSX -inputFile /private/tmp/install.txt -activationPropertiesFile /private/tmp/activate.ini"

I’m guessing it has something to do with the working directory of __Download not being recognized by the installer, which extracts a bunch of stuff to the working directory when it works properly. I’d be curious if folks had thoughts on what’s going on behind the scenes, but Matlab is installing and I’m a happy camper, so I’m considering this issue finished.

1 Like

If this was a mailbox action then the directory is fairly protected and the installer might not like the permissions. Glad changing the directory got around that!