--- a/codesys-ide/install.sh +++ b/codesys-ide/install2.sh @@ -32,79 +32,6 @@ # kill current and subprocesses on exit trap "kill 0" EXIT - -# this should be running in the background to close rundll32 dialogs -function handle_rundll -{ - while true; do - # - # rundll32 error - # - while ! xdotool search --name 'rundll32'; do - sleep 1 - done - echo "rundll32 error found" - ( - # next - sleep 2 - echo "-> sending key sequence" - xdotool key "Tab"; xdotool key "space"; - ) - sleep 1 - done - -} - -function handle_codemeter -{ - while true; do - # - # CodeMeter setup - # - while ! xdotool search --name 'codemeter'; do - sleep 1 - done - echo "codemeter found" - ( - # next - sleep 5 - echo "-> sending key sequence" - xdotool key "space"; - # check license - sleep 1 - xdotool key "space"; - # next - sleep 1 - xdotool key "Tab"; xdotool key "Tab"; xdotool key "space"; - # next - sleep 1 - xdotool key "Tab"; xdotool key "Tab"; xdotool key "Tab"; xdotool key "Tab"; xdotool key "space"; - # next - sleep 1 - xdotool key "Tab"; xdotool key "Tab"; xdotool key "Tab"; xdotool key "Tab"; xdotool key "Tab"; xdotool key "space"; - # install - sleep 1 - xdotool key "space"; - # finish - sleep 5 - xdotool key "space"; - ) - sleep 1 - done - -} - -function kill_systray -{ - while true; do - while ! pgrep -f SysTray.exe; do - sleep 1 - done - echo "SysTrays running - kill them..." - pgrep -f SysTray.exe | xargs -n 1 kill - sleep 1 - done -} function get { @@ -150,8 +77,14 @@ function install { - ${WINE} setup.exe /v/qn /s /v'INSTALLDIR=C:\\CODESYS' /v"ADDLOCAL=Basic,CODESYS,cforge Tool" /v"CDS_INSTALL_SERVICES=0" - wineserver-development -w + WINEPREFIX=~/.wine.cds wine-development ./setup.exe /s /x /b"C:\tmp" /v"/qn" + ( + wineserver-development -w + cd ~/.wine.cds/drive_c/tmp + msiextract *.msi + mv Program*/CODESYS* ../CODESYS + mv CommonAppData/CODESYS/* ../CODESYS/CODESYS/ + ) } function post_install @@ -165,7 +98,6 @@ no_winetricks="y" no_install="y" no_postinstall="y" -no_xvfb="y" case ${1} in --winetricks) no_winetricks="" @@ -176,13 +108,12 @@ --postinstall) no_postinstall="" ;; - --xvfb) - no_check="" - no_dl="" - no_winetricks="" - no_install="" - no_postinstall="" - no_xvfb="" + -h) + echo "usage: $0 <param>" + echo "params:" + echo " --winetricks" + echo " --install" + echo " --postinstall" ;; *) no_check="" @@ -193,19 +124,6 @@ ;; esac -if [ -z ${no_xvfb} ]; then - echo "=== Start XVFB ===" - export DISPLAY=:98 - Xvfb :98 & - sleep 3 - jwm & - - # install handlers only when automating the installation - # with Xvfb and xdotool - (handle_rundll)& - (handle_codemeter)& - (kill_systray)& -fi if [ -z ${no_check} ]; then echo "=== Checking Prerequisites ===" prereq @@ -225,15 +143,6 @@ if [ -z ${no_postinstall} ]; then echo "=== Postinstall Fixups ===" post_install - if [ -z ${no_install} ]; then - echo "=== Installing CODESYS again ===" - echo "after one complete run + post install, also all *.exe are copied ;)" - install - fi -fi -if [ -z ${no_xvfb} ]; then - echo "=== Kill XVFB ===" - killall -9 Xvfb fi exit