pinstall.sh 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/bin/sh
  2. #BK may 2011
  3. PWD="`pwd`"
  4. SETDEFAULT='no'
  5. if [ "$PWD" = "/" ];then #installing in a running puppy.
  6. if [ "`cat /root/.packages/woof-installed-packages /root/.packages/user-installed-packages | grep 'gecko\-mediaplayer'`" = "" ];then
  7. EXTRAMSG="<text>
  8. <label>Note: It is highly recommended that you also install Gecko-mediaplayer, a web browser plugin. These two applications are designed to work together.</label>
  9. </text>"
  10. fi
  11. export ASKDIALOG="
  12. <window title=\"Ask\" decorated=\"false\" window_position=\"1\" skip_taskbar_hint=\"true\">
  13. <vbox>
  14. <frame>
  15. <text>
  16. <label>Hi, you have just installed Gnome-mplayer. Click the 'Yes' button if you would like Gnome-mplayer to become the default media player, otherwise click 'No'. Note, you can also manually edit /usr/local/bin/defaultmediaplayer and /usr/local/bin/defaultvideoplayer at any time to change the default.</label>
  17. </text>
  18. ${EXTRAMSG}
  19. <hbox>
  20. <button> <label>Yes</label> <action type=\"exit\">SetDefault</action> </button>
  21. <button> <label>No</label> <action type=\"exit\">NotDefault</action> </button>
  22. </hbox>
  23. </frame>
  24. </vbox>
  25. </window>
  26. "
  27. RETVAL="`gtkdialog3 --program=ASKDIALOG`"
  28. echo "$RETVAL"
  29. [ "`echo "$RETVAL" | grep 'SetDefault'`" != "" ] && SETDEFAULT='yes'
  30. fi
  31. if [ "$PWD" != "/" -o "$SETDEFAULT" = "yes" ];then
  32. echo '#!/bin/sh' > ./usr/local/bin/defaultmediaplayer
  33. echo 'exec gnomemplayershell "$@"' >> ./usr/local/bin/defaultmediaplayer
  34. chmod 755 ./usr/local/bin/defaultmediaplayer
  35. echo '#!/bin/sh' > ./usr/local/bin/defaultvideoplayer
  36. echo 'exec gnomemplayershell "$@"' >> ./usr/local/bin/defaultvideoplayer
  37. chmod 755 ./usr/local/bin/defaultvideoplayer
  38. fi