postinst.in 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #!/usr/bin/env bash
  2. #
  3. # Copyright (c) Contributors to the Open 3D Engine Project.
  4. # For complete copyright and license terms please see the LICENSE at the root of this distribution.
  5. #
  6. # SPDX-License-Identifier: Apache-2.0 OR MIT
  7. #
  8. #
  9. set -o errexit # exit on the first failure encountered
  10. {
  11. ln -s -f @CPACK_PACKAGING_INSTALL_PREFIX@/bin/Linux/profile/Default/o3de /usr/local/bin/o3de
  12. ln -s -f @CPACK_PACKAGING_INSTALL_PREFIX@/scripts/o3de.sh /usr/local/bin/o3de.sh
  13. ln -s -f @CPACK_PACKAGING_INSTALL_PREFIX@/bin/Linux/profile/Default/AssetProcessor /usr/local/bin/o3de.assetprocessor
  14. ln -s -f @CPACK_PACKAGING_INSTALL_PREFIX@/bin/Linux/profile/Default/Editor /usr/local/bin/o3de.editor
  15. # Generate the desktop icon
  16. DESKTOP_ICON_FILE=/usr/share/applications/o3de.desktop
  17. echo -e "[Desktop Entry]\n\
  18. Version=@CPACK_PACKAGE_VERSION@\n\
  19. Name=O3DE\n\
  20. Comment=O3DE Project Manager\n\
  21. Type=Application\n\
  22. Exec=@CPACK_PACKAGING_INSTALL_PREFIX@/bin/Linux/profile/Default/o3de\n\
  23. Path=@CPACK_PACKAGING_INSTALL_PREFIX@/bin/Linux/profile/Default/\n\
  24. Icon=@CPACK_PACKAGING_INSTALL_PREFIX@/o3de_desktop.svg\n\
  25. Terminal=false\n\
  26. StartupWMClass=O3DE.SNAP\n\
  27. StartupNotify=true\n\
  28. X-GNOME-Autostart-enabled=true\n\
  29. " > $DESKTOP_ICON_FILE
  30. pushd @CPACK_PACKAGING_INSTALL_PREFIX@
  31. # Clear out any previously generated egg-info linked folder (as a result of the installer build)
  32. sudo rm -rf scripts/o3de/o3de.egg-info
  33. # The following folders must be writeable to support the egg-info creation during the bootstrapping of
  34. # python.
  35. sudo chmod a+w Tools/LyTestTools
  36. sudo chmod a+w Tools/RemoteConsole/ly_remote_console
  37. sudo chmod a+w Gems/Atom/RPI/Tools
  38. sudo chmod a+w Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface
  39. sudo chmod a+w scripts/o3de
  40. popd
  41. } &> /dev/null # hide output