Closed cghislai closed 5 years ago
workaround:
perl spadsInstaller.pl
sed -i 's/^\$conf{lobbyLogin}.*$//' spadsInstaller.pl
sed -i 's/^\$conf{lobbyPassword}.*$//' spadsInstaller.pl
sed -i 's/^\$conf{owner}.*$//' spadsInstaller.pl
sed -i 's/spadsInstaller\.pl //' spadsInstaller.pl
perl spadsInstaller.pl
I'm not sure I understand your request. Why don't you just use the standard way of passing STDIN arguments to programs in non-interactive mode instead of patching the binary ?
In your case, for the 3 parameters which seem to cause you trouble:
echo "lobbyLoginValue
lobbyPasswordValue
ownerValue" | perl spadsInstaller.pl
This is indeed another way to work around that. I tried using \n rather than an actual line break which is probably why it failed and I opted for sed. It would be nice if that workaround was not mandatory though.
I don't understand why you call that a workaround ? The installer isn't supposed to be used in a non-interactive way for full SPADS install, however you can use it this way as any other console program, by piping inputs.
Ok looking at the code, i saw that there was a nonInteractive variable used in most place except those 3, thus I thought this was a supported feature and that those 3 last input not working was a bug. If this is not supported then thats ok this can be closed
Ah ok I understand now. Actually there is indeed some special handling for non-interactive mode, in order to avoid being stuck in re-ask loop in case of invalid value provided, but that's about all.
I think you might have been confused by a mechanism in place which allows the installer to relaunch itself during auto-updates and library path adjustments for example. This mechanism makes it possible to start the installer from a specific step without re-asking the questions from the beginning. In this case indeed some configuration values are passed as parameters so that they don't need to be re-asked to the user, but it's just internal functioning not officially exposed to the end user. That's why this mechanism doesn't handle the parameters you listed: the installer doesn't need to restart itself once it has reached these steps.
The installer fails in non-interactive mode due to the last 3 questions:
These statements should be run only if the $conf entries are empty and the installer is running in interactive mode. So that we can pass them as arguments or edit the config file afterwards.