raptor_installers_scriptable.txt 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. Making the Raptor installers scriptable
  2. ---------------------------------------
  3. In order to improve testing of the packaging of Raptor, the Raptor installers
  4. need to be able to run unattended in "silent" mode.
  5. Windows installer
  6. -----------------
  7. Some small changes were required to the NSIS code to enable this.
  8. Specifically, the installer had to be able to detect the installation type,
  9. that is whether to set the system path, the user path, or to not update the
  10. environment at all.
  11. The installer can now be run in silent mode like this:
  12. sbs-2.XX.YY.exe /S /INSTALL_TYPE=NO_ENV /D=C:\APPS\Raptor
  13. Explanation of the flags:
  14. /S run in silent mode
  15. /INSTALL_TYPE installation type: valid values are
  16. NO_ENV - do not set the PATH
  17. USR - add Raptor's bin directory to the current user's PATH
  18. SYS - add Raptor's bin directory to the system PATH (all users)
  19. This is case sensitive and anything else is an error.
  20. /D installation directory: does not have to exist, but must be a valid
  21. directory name.
  22. *N.B.*: due to a parsing oddity in NSIS installers, the /D flag must come last
  23. otherwise everything following it is used as the installation directory name.
  24. When run from a command prompt (in silent mode or not), sbs-2.XX.YY.exe is
  25. launched as a separate process, as it is not a console application. Therefore,
  26. the best way to monitor progress of the installer in silent mode is to run it
  27. via Python's subprocess.Popen API with shell=False, and to wait on the process
  28. to exit. The exit code can also be obtained in this way.
  29. Running in interactive/GUI mode continues to function as before.
  30. Linux installer
  31. ---------------
  32. The Linux installer is created using the makeself.sh script, which packages a
  33. shell script and tar archive into a single .run file. The .run file unpacks
  34. the tar archive and can then runs a shell script that is embedded in the
  35. archive. In the case of Raptor, the embedded script is bin/install_raptor.sh.
  36. The double-dash, --, passes following arguments to the embedded script.
  37. Small changes were required to the install_raptor.sh script. As for the
  38. Windows installer, the installation directory has to be specified; in addition
  39. the script can be run in "silent" mode, i.e. in a non-interactive mode.
  40. The installer can now be run in silent mode like this:
  41. ./sbs-2.XX.YY-linux-ARCH-libc2_ZZ.run -- -s -i /my/installation/dir/for/raptor
  42. As the .run file is itself a script, the double-dash, --, is required to pass
  43. the "-s -i /my/installation/dir/for/raptor" to the embedded script.
  44. Explanation of the flags:
  45. -s run in silent mode
  46. -i installation directory; if missing or not given a value the script exits
  47. with an error. If used without -s, -i is ignored.
  48. Running in interactive mode continues to function as before and uses the
  49. dialog utility.