diff --git a/deb/DEBIAN/control b/deb/DEBIAN/control new file mode 100644 index 0000000..5e21dc7 --- /dev/null +++ b/deb/DEBIAN/control @@ -0,0 +1,9 @@ +Package: boxpackage +Priority: optional +Section: admin +Maintainer: Can202 +Architecture: amd64 +Version: 0.1 +Depends: python3, lxterminal +Description: Installer + Simple Visual Installer (apt) diff --git a/deb/DEBIAN/postinst b/deb/DEBIAN/postinst new file mode 100755 index 0000000..1045ee9 --- /dev/null +++ b/deb/DEBIAN/postinst @@ -0,0 +1,2 @@ +#!/bin/bash +ln /usr/lib64/boxpackage/boxpackage /usr/bin/boxpackage diff --git a/deb/DEBIAN/postrm b/deb/DEBIAN/postrm new file mode 100755 index 0000000..34077da --- /dev/null +++ b/deb/DEBIAN/postrm @@ -0,0 +1,2 @@ +#!/bin/bash +rm -f /usr/bin/boxpackage diff --git a/deb/usr/lib64/boxpackage/boxpackage b/deb/usr/lib64/boxpackage/boxpackage new file mode 100755 index 0000000..bb15f13 --- /dev/null +++ b/deb/usr/lib64/boxpackage/boxpackage @@ -0,0 +1,28 @@ +#!/bin/bash + +if [ ! -z $1 ] +then + + if [ $(whoami) = "root" ] + then + /usr/lib64/boxpackage/init $1 + exit + fi + + echo "Do you want to use sudo? (Y/n)" + read rootcommand + if [ $rootcommand = Y ] || [ $rootcommand = y ] + then + sudo /usr/lib64/boxpackage/init $1 + exit + fi + echo "Do you want to use su? (Y/n)" + if [ $rootcommand = Y ] || [ $rootcommand = y ] + then + su root -c '/usr/lib64/boxpackage/init $1' + exit + fi + echo "Error, no root" +else + echo "Error, waiting \$1" +fi diff --git a/deb/usr/lib64/boxpackage/boxpackage-su b/deb/usr/lib64/boxpackage/boxpackage-su new file mode 100755 index 0000000..ead5f35 --- /dev/null +++ b/deb/usr/lib64/boxpackage/boxpackage-su @@ -0,0 +1,15 @@ +#!/bin/bash + +if [ ! -z $1 ] +then + if [ $1 = "sudo" ] + then + sudo /usr/lib64/boxpackage/init + fi + if [ $1 = "su" ] + then + su root -c '/usr/lib64/boxpackage/init' + fi +else + echo "Error, waiting \$1" +fi diff --git a/deb/usr/lib64/boxpackage/boxpackage-sudo b/deb/usr/lib64/boxpackage/boxpackage-sudo new file mode 100755 index 0000000..ead5f35 --- /dev/null +++ b/deb/usr/lib64/boxpackage/boxpackage-sudo @@ -0,0 +1,15 @@ +#!/bin/bash + +if [ ! -z $1 ] +then + if [ $1 = "sudo" ] + then + sudo /usr/lib64/boxpackage/init + fi + if [ $1 = "su" ] + then + su root -c '/usr/lib64/boxpackage/init' + fi +else + echo "Error, waiting \$1" +fi diff --git a/deb/usr/lib64/boxpackage/boxpackage.desktop b/deb/usr/lib64/boxpackage/boxpackage.desktop new file mode 100755 index 0000000..cc6b003 --- /dev/null +++ b/deb/usr/lib64/boxpackage/boxpackage.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Name=BoxPackage +Exec=boxpackage +Icon=boxpackage +Terminal=True +Type=Application +Categories=Utility diff --git a/deb/usr/lib64/boxpackage/init b/deb/usr/lib64/boxpackage/init new file mode 100755 index 0000000..7e511a2 Binary files /dev/null and b/deb/usr/lib64/boxpackage/init differ diff --git a/deb/usr/share/applications/boxpackagesu.desktop b/deb/usr/share/applications/boxpackagesu.desktop new file mode 100755 index 0000000..5648f24 --- /dev/null +++ b/deb/usr/share/applications/boxpackagesu.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Name=BoxPackage Su +Exec=boxpackage-su +Icon=boxpackage +Terminal=True +Type=Application +Categories=Utility diff --git a/deb/usr/share/applications/boxpackagesudo.desktop b/deb/usr/share/applications/boxpackagesudo.desktop new file mode 100755 index 0000000..856fe5f --- /dev/null +++ b/deb/usr/share/applications/boxpackagesudo.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Name=BoxPackage Sudo +Exec=boxpackage-sudo +Icon=boxpackage +Terminal=True +Type=Application +Categories=Utility diff --git a/deb/usr/share/icons/hicolor/256x256/apps/boxpackage.png b/deb/usr/share/icons/hicolor/256x256/apps/boxpackage.png new file mode 100644 index 0000000..4abdf0c Binary files /dev/null and b/deb/usr/share/icons/hicolor/256x256/apps/boxpackage.png differ diff --git a/exec b/exec index 1869406..431aefb 100755 --- a/exec +++ b/exec @@ -5,9 +5,18 @@ then if [ $1 = "sudo" ] then sudo python3 /home/manuel/Descargas/installer-test/init.py + else + if [ $1 = "su" ] + then + su root -c 'python3 /home/manuel/Descargas/installer-test/init.py' + else + echo execute with sudo? (Y/n) + read sudo + if [ $sudo = Y ] || [ $sudo = y ] + then + sudo python3 /home/manuel/Descargas/installer-test/init.py + + fi fi - if [ $1 = "su" ] - then - su root -c 'python3 /home/manuel/Descargas/installer-test/init.py' - fi + fi diff --git a/init.py b/init.py index 31713a5..24ba57c 100644 --- a/init.py +++ b/init.py @@ -16,7 +16,7 @@ BUTTONWIDTH='39' TEXTWIDTH=18 screen = tk.Tk() -screen.title("Install") +screen.title("BoxPackage") screen.geometry("400x400") screen.resizable(width = False, height = False) diff --git a/media/icon.png b/media/icon.png new file mode 100644 index 0000000..947f4e2 Binary files /dev/null and b/media/icon.png differ diff --git a/media/icon.xcf b/media/icon.xcf new file mode 100644 index 0000000..ff68ad7 Binary files /dev/null and b/media/icon.xcf differ diff --git a/media/icon256.png b/media/icon256.png new file mode 100644 index 0000000..4abdf0c Binary files /dev/null and b/media/icon256.png differ