Install a program automatically with terminal (which has menus)

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
1
down vote

favorite












Is it possible to install a program automatically, which when extracted and run, it opens up a menu installer? (doesn't look like the installer has any options which I can pass in either).



Is there a package out there which can maybe automate pressing the buttons in the menus?



For those interested, the program in question is CrossWorks for ARM.










share|improve this question



























    up vote
    1
    down vote

    favorite












    Is it possible to install a program automatically, which when extracted and run, it opens up a menu installer? (doesn't look like the installer has any options which I can pass in either).



    Is there a package out there which can maybe automate pressing the buttons in the menus?



    For those interested, the program in question is CrossWorks for ARM.










    share|improve this question

























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      Is it possible to install a program automatically, which when extracted and run, it opens up a menu installer? (doesn't look like the installer has any options which I can pass in either).



      Is there a package out there which can maybe automate pressing the buttons in the menus?



      For those interested, the program in question is CrossWorks for ARM.










      share|improve this question















      Is it possible to install a program automatically, which when extracted and run, it opens up a menu installer? (doesn't look like the installer has any options which I can pass in either).



      Is there a package out there which can maybe automate pressing the buttons in the menus?



      For those interested, the program in question is CrossWorks for ARM.







      16.04 software-installation xorg xvfb






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Feb 9 at 19:31









      ukos

      476114




      476114










      asked Feb 2 at 11:07









      Rekovni

      1134




      1134




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          Usually one can try --quiet, -q --help but as you said, this will not work here. We have to build something on our own.



          For an unattended installation I find it useful to let the installation be run on a virtual X-server. We can send keys to the X-server and will not mess with the current screen. Therefore we need xvfb form the X.org project. I also want to take screenshots during the installation to see where the process is at and if any errors occur. We need imagemagick for that. Note that imagemagick will only work on X sessions. No wayland support right now.



          First download the installer and unpack it.



          cd ~/Downloads
          wget http://cdn.rowleydownload.co.uk/arm/releases/arm_crossworks_4_1_0_linux_x64.tar.gz
          tar xf arm_crossworks_4_1_0_linux_x64.tar.gz
          cd ~/Downloads/arm_crossworks_4_1_linux_x64


          then execute this script from my gist:





          #!/bin/bash
          #
          # source: https://askubuntu.com/questions/1002349/install-a-program-automatically-with-terminal-which-has-menus
          # dependencies: sudo imagemagick xvfb

          # constants
          SERVERNUM=99
          SCREENSHOT=status.png
          CROSSWORKS_PID=
          XVFB_PID=
          PROGRESS_PID=
          KEYS_PID=

          # function find_free_servernum() taken from xvfb-run
          # Xvfb is part of x.org and licensed under MIT
          # http://opensource.org/licenses/mit-license.php
          #
          # Find a free server number by looking at .X*-lock files in /tmp.
          find_free_servernum()
          # Sadly, the "local" keyword is not POSIX. Leave the next line commented in
          # the hope Debian Policy eventually changes to allow it in /bin/sh scripts
          # anyway.
          #local i

          i=$SERVERNUM
          while [ -f /tmp/.X$i-lock ]; do
          i=$(($i + 1))
          done
          echo $i


          start_xvfb()
          SERVERNUM=$(find_free_servernum)
          echo starting virtual DISPLAY at :$SERVERNUM
          export DISPLAY=:$SERVERNUM

          Xvfb $DISPLAY -screen 0 1280x800x16 &> /dev/null &
          XVFB_PID=$!


          install_crossworks()
          check_root
          if [ ! -e ./install_crossworks ]; then
          echo crossworks installation file not found
          exit 1
          fi
          timeout --kill-after=90s 90s sudo -n ./install_crossworks &
          CROSSWORKS_PID=$!

          crossworks_enter_keys &
          KEYS_PID=$!

          show_progress &
          PROGRESS_PID=$!

          if wait $CROSSWORKS_PID; then
          echo ok
          fi

          kill "$PROGRESS_PID" &> /dev/null
          kill "$KEYS_PID" &> /dev/null


          crossworks_enter_keys()
          # wait for archive to get checked for crc errors
          sleep 5
          # press next
          xdotool key KP_Enter
          sleep 1
          # accept license
          xdotool key Tab Tab Tab space Tab Tab KP_Enter
          sleep 1
          # select install directory
          xdotool key KP_Enter
          sleep 1
          # start installation
          xdotool key KP_Enter
          sleep 60
          # exit installation
          xdotool key KP_Enter
          sleep 1


          show_progress()
          while /bin/true; do
          take_screenshot
          echo -n .
          sleep 1
          done


          take_screenshot()
          import -window root $SCREENSHOT
          sudo chown $USER $SCREENSHOT


          check_root()
          if ! sudo -n /bin/true 2>/dev/null; then
          echo super user is required for installation.
          sudo /bin/true
          fi


          check_installation()
          if [ -e /usr/share/crossworks_for_arm_4.1/bin/crossstudio ]; then
          echo Crossworks installed.
          exit 0
          fi


          cleanup()
          kill "$PROGRESS_PID" &> /dev/null
          kill "$CROSSWORKS_PID" &> /dev/null
          kill "$XVFB_PID" &> /dev/null
          kill "$KEYS_PID" &> /dev/null


          trap cleanup EXIT

          check_installation
          start_xvfb
          install_crossworks
          check_installation


          One big problem was that I was guessing the times the installer takes before the next user input is necessary. It may vary depending on your CPU.



          Please also note that the installation script is only valid for installing crossworks. The script will not work for upgrading or uninstalling.



          To uninstall crossworks again, execute



          sudo /usr/share/crossworks_for_arm_4.1/bin/uninstall


          if there are any errors, try to take a look at the status.png that is placed in the current working directory. It is a screenshot from the X framebuffer.



          It will look something like this on installation:



          status image from screenshot



          Also take a look at /usr/share/crossworks_for_arm_4.1/. Sometimes if installation is aborted this directory is there but not completely filled with all the necessary data.



          You can try to get the script more advanced, i.e. by capturing status images when a keystroke is required and comparing their checksum some already saved checksums to see at which status the installation is.






          share|improve this answer






















            Your Answer







            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "89"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1002349%2finstall-a-program-automatically-with-terminal-which-has-menus%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            1
            down vote



            accepted










            Usually one can try --quiet, -q --help but as you said, this will not work here. We have to build something on our own.



            For an unattended installation I find it useful to let the installation be run on a virtual X-server. We can send keys to the X-server and will not mess with the current screen. Therefore we need xvfb form the X.org project. I also want to take screenshots during the installation to see where the process is at and if any errors occur. We need imagemagick for that. Note that imagemagick will only work on X sessions. No wayland support right now.



            First download the installer and unpack it.



            cd ~/Downloads
            wget http://cdn.rowleydownload.co.uk/arm/releases/arm_crossworks_4_1_0_linux_x64.tar.gz
            tar xf arm_crossworks_4_1_0_linux_x64.tar.gz
            cd ~/Downloads/arm_crossworks_4_1_linux_x64


            then execute this script from my gist:





            #!/bin/bash
            #
            # source: https://askubuntu.com/questions/1002349/install-a-program-automatically-with-terminal-which-has-menus
            # dependencies: sudo imagemagick xvfb

            # constants
            SERVERNUM=99
            SCREENSHOT=status.png
            CROSSWORKS_PID=
            XVFB_PID=
            PROGRESS_PID=
            KEYS_PID=

            # function find_free_servernum() taken from xvfb-run
            # Xvfb is part of x.org and licensed under MIT
            # http://opensource.org/licenses/mit-license.php
            #
            # Find a free server number by looking at .X*-lock files in /tmp.
            find_free_servernum()
            # Sadly, the "local" keyword is not POSIX. Leave the next line commented in
            # the hope Debian Policy eventually changes to allow it in /bin/sh scripts
            # anyway.
            #local i

            i=$SERVERNUM
            while [ -f /tmp/.X$i-lock ]; do
            i=$(($i + 1))
            done
            echo $i


            start_xvfb()
            SERVERNUM=$(find_free_servernum)
            echo starting virtual DISPLAY at :$SERVERNUM
            export DISPLAY=:$SERVERNUM

            Xvfb $DISPLAY -screen 0 1280x800x16 &> /dev/null &
            XVFB_PID=$!


            install_crossworks()
            check_root
            if [ ! -e ./install_crossworks ]; then
            echo crossworks installation file not found
            exit 1
            fi
            timeout --kill-after=90s 90s sudo -n ./install_crossworks &
            CROSSWORKS_PID=$!

            crossworks_enter_keys &
            KEYS_PID=$!

            show_progress &
            PROGRESS_PID=$!

            if wait $CROSSWORKS_PID; then
            echo ok
            fi

            kill "$PROGRESS_PID" &> /dev/null
            kill "$KEYS_PID" &> /dev/null


            crossworks_enter_keys()
            # wait for archive to get checked for crc errors
            sleep 5
            # press next
            xdotool key KP_Enter
            sleep 1
            # accept license
            xdotool key Tab Tab Tab space Tab Tab KP_Enter
            sleep 1
            # select install directory
            xdotool key KP_Enter
            sleep 1
            # start installation
            xdotool key KP_Enter
            sleep 60
            # exit installation
            xdotool key KP_Enter
            sleep 1


            show_progress()
            while /bin/true; do
            take_screenshot
            echo -n .
            sleep 1
            done


            take_screenshot()
            import -window root $SCREENSHOT
            sudo chown $USER $SCREENSHOT


            check_root()
            if ! sudo -n /bin/true 2>/dev/null; then
            echo super user is required for installation.
            sudo /bin/true
            fi


            check_installation()
            if [ -e /usr/share/crossworks_for_arm_4.1/bin/crossstudio ]; then
            echo Crossworks installed.
            exit 0
            fi


            cleanup()
            kill "$PROGRESS_PID" &> /dev/null
            kill "$CROSSWORKS_PID" &> /dev/null
            kill "$XVFB_PID" &> /dev/null
            kill "$KEYS_PID" &> /dev/null


            trap cleanup EXIT

            check_installation
            start_xvfb
            install_crossworks
            check_installation


            One big problem was that I was guessing the times the installer takes before the next user input is necessary. It may vary depending on your CPU.



            Please also note that the installation script is only valid for installing crossworks. The script will not work for upgrading or uninstalling.



            To uninstall crossworks again, execute



            sudo /usr/share/crossworks_for_arm_4.1/bin/uninstall


            if there are any errors, try to take a look at the status.png that is placed in the current working directory. It is a screenshot from the X framebuffer.



            It will look something like this on installation:



            status image from screenshot



            Also take a look at /usr/share/crossworks_for_arm_4.1/. Sometimes if installation is aborted this directory is there but not completely filled with all the necessary data.



            You can try to get the script more advanced, i.e. by capturing status images when a keystroke is required and comparing their checksum some already saved checksums to see at which status the installation is.






            share|improve this answer


























              up vote
              1
              down vote



              accepted










              Usually one can try --quiet, -q --help but as you said, this will not work here. We have to build something on our own.



              For an unattended installation I find it useful to let the installation be run on a virtual X-server. We can send keys to the X-server and will not mess with the current screen. Therefore we need xvfb form the X.org project. I also want to take screenshots during the installation to see where the process is at and if any errors occur. We need imagemagick for that. Note that imagemagick will only work on X sessions. No wayland support right now.



              First download the installer and unpack it.



              cd ~/Downloads
              wget http://cdn.rowleydownload.co.uk/arm/releases/arm_crossworks_4_1_0_linux_x64.tar.gz
              tar xf arm_crossworks_4_1_0_linux_x64.tar.gz
              cd ~/Downloads/arm_crossworks_4_1_linux_x64


              then execute this script from my gist:





              #!/bin/bash
              #
              # source: https://askubuntu.com/questions/1002349/install-a-program-automatically-with-terminal-which-has-menus
              # dependencies: sudo imagemagick xvfb

              # constants
              SERVERNUM=99
              SCREENSHOT=status.png
              CROSSWORKS_PID=
              XVFB_PID=
              PROGRESS_PID=
              KEYS_PID=

              # function find_free_servernum() taken from xvfb-run
              # Xvfb is part of x.org and licensed under MIT
              # http://opensource.org/licenses/mit-license.php
              #
              # Find a free server number by looking at .X*-lock files in /tmp.
              find_free_servernum()
              # Sadly, the "local" keyword is not POSIX. Leave the next line commented in
              # the hope Debian Policy eventually changes to allow it in /bin/sh scripts
              # anyway.
              #local i

              i=$SERVERNUM
              while [ -f /tmp/.X$i-lock ]; do
              i=$(($i + 1))
              done
              echo $i


              start_xvfb()
              SERVERNUM=$(find_free_servernum)
              echo starting virtual DISPLAY at :$SERVERNUM
              export DISPLAY=:$SERVERNUM

              Xvfb $DISPLAY -screen 0 1280x800x16 &> /dev/null &
              XVFB_PID=$!


              install_crossworks()
              check_root
              if [ ! -e ./install_crossworks ]; then
              echo crossworks installation file not found
              exit 1
              fi
              timeout --kill-after=90s 90s sudo -n ./install_crossworks &
              CROSSWORKS_PID=$!

              crossworks_enter_keys &
              KEYS_PID=$!

              show_progress &
              PROGRESS_PID=$!

              if wait $CROSSWORKS_PID; then
              echo ok
              fi

              kill "$PROGRESS_PID" &> /dev/null
              kill "$KEYS_PID" &> /dev/null


              crossworks_enter_keys()
              # wait for archive to get checked for crc errors
              sleep 5
              # press next
              xdotool key KP_Enter
              sleep 1
              # accept license
              xdotool key Tab Tab Tab space Tab Tab KP_Enter
              sleep 1
              # select install directory
              xdotool key KP_Enter
              sleep 1
              # start installation
              xdotool key KP_Enter
              sleep 60
              # exit installation
              xdotool key KP_Enter
              sleep 1


              show_progress()
              while /bin/true; do
              take_screenshot
              echo -n .
              sleep 1
              done


              take_screenshot()
              import -window root $SCREENSHOT
              sudo chown $USER $SCREENSHOT


              check_root()
              if ! sudo -n /bin/true 2>/dev/null; then
              echo super user is required for installation.
              sudo /bin/true
              fi


              check_installation()
              if [ -e /usr/share/crossworks_for_arm_4.1/bin/crossstudio ]; then
              echo Crossworks installed.
              exit 0
              fi


              cleanup()
              kill "$PROGRESS_PID" &> /dev/null
              kill "$CROSSWORKS_PID" &> /dev/null
              kill "$XVFB_PID" &> /dev/null
              kill "$KEYS_PID" &> /dev/null


              trap cleanup EXIT

              check_installation
              start_xvfb
              install_crossworks
              check_installation


              One big problem was that I was guessing the times the installer takes before the next user input is necessary. It may vary depending on your CPU.



              Please also note that the installation script is only valid for installing crossworks. The script will not work for upgrading or uninstalling.



              To uninstall crossworks again, execute



              sudo /usr/share/crossworks_for_arm_4.1/bin/uninstall


              if there are any errors, try to take a look at the status.png that is placed in the current working directory. It is a screenshot from the X framebuffer.



              It will look something like this on installation:



              status image from screenshot



              Also take a look at /usr/share/crossworks_for_arm_4.1/. Sometimes if installation is aborted this directory is there but not completely filled with all the necessary data.



              You can try to get the script more advanced, i.e. by capturing status images when a keystroke is required and comparing their checksum some already saved checksums to see at which status the installation is.






              share|improve this answer
























                up vote
                1
                down vote



                accepted







                up vote
                1
                down vote



                accepted






                Usually one can try --quiet, -q --help but as you said, this will not work here. We have to build something on our own.



                For an unattended installation I find it useful to let the installation be run on a virtual X-server. We can send keys to the X-server and will not mess with the current screen. Therefore we need xvfb form the X.org project. I also want to take screenshots during the installation to see where the process is at and if any errors occur. We need imagemagick for that. Note that imagemagick will only work on X sessions. No wayland support right now.



                First download the installer and unpack it.



                cd ~/Downloads
                wget http://cdn.rowleydownload.co.uk/arm/releases/arm_crossworks_4_1_0_linux_x64.tar.gz
                tar xf arm_crossworks_4_1_0_linux_x64.tar.gz
                cd ~/Downloads/arm_crossworks_4_1_linux_x64


                then execute this script from my gist:





                #!/bin/bash
                #
                # source: https://askubuntu.com/questions/1002349/install-a-program-automatically-with-terminal-which-has-menus
                # dependencies: sudo imagemagick xvfb

                # constants
                SERVERNUM=99
                SCREENSHOT=status.png
                CROSSWORKS_PID=
                XVFB_PID=
                PROGRESS_PID=
                KEYS_PID=

                # function find_free_servernum() taken from xvfb-run
                # Xvfb is part of x.org and licensed under MIT
                # http://opensource.org/licenses/mit-license.php
                #
                # Find a free server number by looking at .X*-lock files in /tmp.
                find_free_servernum()
                # Sadly, the "local" keyword is not POSIX. Leave the next line commented in
                # the hope Debian Policy eventually changes to allow it in /bin/sh scripts
                # anyway.
                #local i

                i=$SERVERNUM
                while [ -f /tmp/.X$i-lock ]; do
                i=$(($i + 1))
                done
                echo $i


                start_xvfb()
                SERVERNUM=$(find_free_servernum)
                echo starting virtual DISPLAY at :$SERVERNUM
                export DISPLAY=:$SERVERNUM

                Xvfb $DISPLAY -screen 0 1280x800x16 &> /dev/null &
                XVFB_PID=$!


                install_crossworks()
                check_root
                if [ ! -e ./install_crossworks ]; then
                echo crossworks installation file not found
                exit 1
                fi
                timeout --kill-after=90s 90s sudo -n ./install_crossworks &
                CROSSWORKS_PID=$!

                crossworks_enter_keys &
                KEYS_PID=$!

                show_progress &
                PROGRESS_PID=$!

                if wait $CROSSWORKS_PID; then
                echo ok
                fi

                kill "$PROGRESS_PID" &> /dev/null
                kill "$KEYS_PID" &> /dev/null


                crossworks_enter_keys()
                # wait for archive to get checked for crc errors
                sleep 5
                # press next
                xdotool key KP_Enter
                sleep 1
                # accept license
                xdotool key Tab Tab Tab space Tab Tab KP_Enter
                sleep 1
                # select install directory
                xdotool key KP_Enter
                sleep 1
                # start installation
                xdotool key KP_Enter
                sleep 60
                # exit installation
                xdotool key KP_Enter
                sleep 1


                show_progress()
                while /bin/true; do
                take_screenshot
                echo -n .
                sleep 1
                done


                take_screenshot()
                import -window root $SCREENSHOT
                sudo chown $USER $SCREENSHOT


                check_root()
                if ! sudo -n /bin/true 2>/dev/null; then
                echo super user is required for installation.
                sudo /bin/true
                fi


                check_installation()
                if [ -e /usr/share/crossworks_for_arm_4.1/bin/crossstudio ]; then
                echo Crossworks installed.
                exit 0
                fi


                cleanup()
                kill "$PROGRESS_PID" &> /dev/null
                kill "$CROSSWORKS_PID" &> /dev/null
                kill "$XVFB_PID" &> /dev/null
                kill "$KEYS_PID" &> /dev/null


                trap cleanup EXIT

                check_installation
                start_xvfb
                install_crossworks
                check_installation


                One big problem was that I was guessing the times the installer takes before the next user input is necessary. It may vary depending on your CPU.



                Please also note that the installation script is only valid for installing crossworks. The script will not work for upgrading or uninstalling.



                To uninstall crossworks again, execute



                sudo /usr/share/crossworks_for_arm_4.1/bin/uninstall


                if there are any errors, try to take a look at the status.png that is placed in the current working directory. It is a screenshot from the X framebuffer.



                It will look something like this on installation:



                status image from screenshot



                Also take a look at /usr/share/crossworks_for_arm_4.1/. Sometimes if installation is aborted this directory is there but not completely filled with all the necessary data.



                You can try to get the script more advanced, i.e. by capturing status images when a keystroke is required and comparing their checksum some already saved checksums to see at which status the installation is.






                share|improve this answer














                Usually one can try --quiet, -q --help but as you said, this will not work here. We have to build something on our own.



                For an unattended installation I find it useful to let the installation be run on a virtual X-server. We can send keys to the X-server and will not mess with the current screen. Therefore we need xvfb form the X.org project. I also want to take screenshots during the installation to see where the process is at and if any errors occur. We need imagemagick for that. Note that imagemagick will only work on X sessions. No wayland support right now.



                First download the installer and unpack it.



                cd ~/Downloads
                wget http://cdn.rowleydownload.co.uk/arm/releases/arm_crossworks_4_1_0_linux_x64.tar.gz
                tar xf arm_crossworks_4_1_0_linux_x64.tar.gz
                cd ~/Downloads/arm_crossworks_4_1_linux_x64


                then execute this script from my gist:





                #!/bin/bash
                #
                # source: https://askubuntu.com/questions/1002349/install-a-program-automatically-with-terminal-which-has-menus
                # dependencies: sudo imagemagick xvfb

                # constants
                SERVERNUM=99
                SCREENSHOT=status.png
                CROSSWORKS_PID=
                XVFB_PID=
                PROGRESS_PID=
                KEYS_PID=

                # function find_free_servernum() taken from xvfb-run
                # Xvfb is part of x.org and licensed under MIT
                # http://opensource.org/licenses/mit-license.php
                #
                # Find a free server number by looking at .X*-lock files in /tmp.
                find_free_servernum()
                # Sadly, the "local" keyword is not POSIX. Leave the next line commented in
                # the hope Debian Policy eventually changes to allow it in /bin/sh scripts
                # anyway.
                #local i

                i=$SERVERNUM
                while [ -f /tmp/.X$i-lock ]; do
                i=$(($i + 1))
                done
                echo $i


                start_xvfb()
                SERVERNUM=$(find_free_servernum)
                echo starting virtual DISPLAY at :$SERVERNUM
                export DISPLAY=:$SERVERNUM

                Xvfb $DISPLAY -screen 0 1280x800x16 &> /dev/null &
                XVFB_PID=$!


                install_crossworks()
                check_root
                if [ ! -e ./install_crossworks ]; then
                echo crossworks installation file not found
                exit 1
                fi
                timeout --kill-after=90s 90s sudo -n ./install_crossworks &
                CROSSWORKS_PID=$!

                crossworks_enter_keys &
                KEYS_PID=$!

                show_progress &
                PROGRESS_PID=$!

                if wait $CROSSWORKS_PID; then
                echo ok
                fi

                kill "$PROGRESS_PID" &> /dev/null
                kill "$KEYS_PID" &> /dev/null


                crossworks_enter_keys()
                # wait for archive to get checked for crc errors
                sleep 5
                # press next
                xdotool key KP_Enter
                sleep 1
                # accept license
                xdotool key Tab Tab Tab space Tab Tab KP_Enter
                sleep 1
                # select install directory
                xdotool key KP_Enter
                sleep 1
                # start installation
                xdotool key KP_Enter
                sleep 60
                # exit installation
                xdotool key KP_Enter
                sleep 1


                show_progress()
                while /bin/true; do
                take_screenshot
                echo -n .
                sleep 1
                done


                take_screenshot()
                import -window root $SCREENSHOT
                sudo chown $USER $SCREENSHOT


                check_root()
                if ! sudo -n /bin/true 2>/dev/null; then
                echo super user is required for installation.
                sudo /bin/true
                fi


                check_installation()
                if [ -e /usr/share/crossworks_for_arm_4.1/bin/crossstudio ]; then
                echo Crossworks installed.
                exit 0
                fi


                cleanup()
                kill "$PROGRESS_PID" &> /dev/null
                kill "$CROSSWORKS_PID" &> /dev/null
                kill "$XVFB_PID" &> /dev/null
                kill "$KEYS_PID" &> /dev/null


                trap cleanup EXIT

                check_installation
                start_xvfb
                install_crossworks
                check_installation


                One big problem was that I was guessing the times the installer takes before the next user input is necessary. It may vary depending on your CPU.



                Please also note that the installation script is only valid for installing crossworks. The script will not work for upgrading or uninstalling.



                To uninstall crossworks again, execute



                sudo /usr/share/crossworks_for_arm_4.1/bin/uninstall


                if there are any errors, try to take a look at the status.png that is placed in the current working directory. It is a screenshot from the X framebuffer.



                It will look something like this on installation:



                status image from screenshot



                Also take a look at /usr/share/crossworks_for_arm_4.1/. Sometimes if installation is aborted this directory is there but not completely filled with all the necessary data.



                You can try to get the script more advanced, i.e. by capturing status images when a keystroke is required and comparing their checksum some already saved checksums to see at which status the installation is.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Feb 5 at 20:47

























                answered Feb 2 at 20:17









                ukos

                476114




                476114



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1002349%2finstall-a-program-automatically-with-terminal-which-has-menus%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    pylint3 and pip3 broken

                    Missing snmpget and snmpwalk

                    How to enroll fingerprints to Ubuntu 17.10 with VFS491