Add Linux native GUI program for Ventoy2Disk.

x86_64    gtk2/gtk3
i386      gtk2/gtk3
aarch64   gtk3
mips64el  gtk3
This commit is contained in:
longpanda
2021-09-08 10:44:41 +08:00
parent 7db83dc0f1
commit dd2411d7d4
37 changed files with 11312 additions and 131 deletions

BIN
INSTALL/VentoyGUI.aarch64 Normal file

Binary file not shown.

BIN
INSTALL/VentoyGUI.i386 Normal file

Binary file not shown.

BIN
INSTALL/VentoyGUI.mips64el Normal file

Binary file not shown.

BIN
INSTALL/VentoyGUI.x86_64 Normal file

Binary file not shown.

View File

@@ -1,109 +0,0 @@
#!/bin/sh
if echo "$*" | grep -q '[-]v'; then
set -x
fi
print_usage() {
echo 'Usage: VentoyWebDeepin.sh [ OPTION ]'
echo ' OPTION: (optional)'
echo ' -H x.x.x.x http server IP address (default is 127.0.0.1)'
echo ' -p PORT http server PORT (default is 24680)'
echo ' -h print this help'
echo ' -v print verbose info'
echo ''
}
print_err() {
echo ""
echo "$*"
echo ""
}
get_user() {
name=$(logname)
if [ -n "$name" -a "$name" != "root" ]; then
echo $name; return
fi
name=${HOME#/home/}
if [ -n "$name" -a "$name" != "root" ]; then
echo $name; return
fi
}
uid=$(id -u)
if [ $uid -ne 0 ]; then
exec sudo sh $0 $*
fi
OLDDIR=$(pwd)
if uname -m | egrep -q 'aarch64|arm64'; then
TOOLDIR=aarch64
elif uname -m | egrep -q 'x86_64|amd64'; then
TOOLDIR=x86_64
elif uname -m | egrep -q 'mips64'; then
TOOLDIR=mips64el
else
TOOLDIR=i386
fi
if [ ! -f ./tool/$TOOLDIR/V2DServer ]; then
if [ -f ${0%VentoyWebDeepin.sh}/tool/$TOOLDIR/V2DServer ]; then
cd ${0%VentoyWebDeepin.sh}
fi
fi
PATH=./tool/$TOOLDIR:$PATH
if [ ! -f ./boot/boot.img ]; then
if [ -d ./grub ]; then
echo "Don't run VentoyWebDeepin.sh here, please download the released install package, and run the script in it."
else
echo "Please run under the correct directory!"
fi
exit 1
fi
HOST="127.0.0.1"
PORT=24680
while [ -n "$1" ]; do
if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
print_usage
exit 0
elif [ "$1" = "-v" ]; then
VERBOSE=1
elif [ "$1" = "-H" ]; then
shift
if echo $1 | grep -q '[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*'; then
HOST="$1"
else
print_err "Invalid host $1"
exit 1
fi
elif [ "$1" = "-p" ]; then
shift
if [ $1 -gt 0 -a $1 -le 65535 ]; then
PORT="$1"
else
print_err "Invalid port $1"
exit 1
fi
fi
shift
done
if ps -ef | grep "V2DServer.*$HOST.*$PORT" | grep -q -v grep; then
print_err "Another ventoy server is running now, please close it first."
exit 1
fi
if grep -q -i uos /etc/os-release; then
. ./tool/WebUos.sh
else
. ./tool/WebDeepin.sh
fi

View File

@@ -0,0 +1,582 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="2.2"/>
<object class="GtkImage" id="image_refresh">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<object class="GtkWindow" id="part_cfg_dlg">
<property name="can_focus">False</property>
<property name="resizable">False</property>
<property name="title" translatable="yes">Partition Configuration</property>
<property name="modal">True</property>
<property name="default_width">460</property>
<property name="default_height">270</property>
<child>
<object class="GtkFixed" id="fixed_partcfg_1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkFrame" id="frame_space_check">
<property name="width_request">440</property>
<property name="height_request">50</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
<child>
<object class="GtkFixed" id="fixed_space_check">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkCheckButton" id="space_check_btn">
<property name="width_request">380</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="x">10</property>
<property name="y">10</property>
</packing>
</child>
</object>
</child>
</object>
<packing>
<property name="x">10</property>
<property name="y">10</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="frame_space_value">
<property name="width_request">220</property>
<property name="height_request">60</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
<child>
<object class="GtkFixed" id="fixed_space_value">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkEntry" id="entry_reserve_space">
<property name="width_request">200</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">*</property>
<property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property>
<property name="primary_icon_sensitive">True</property>
<property name="secondary_icon_sensitive">True</property>
<property name="width_chars">10</property>
</object>
<packing>
<property name="x">10</property>
<property name="y">10</property>
</packing>
</child>
</object>
</child>
</object>
<packing>
<property name="x">10</property>
<property name="y">60</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="frame_space_unit">
<property name="width_request">220</property>
<property name="height_request">60</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
<child>
<object class="GtkFixed" id="fixed_space_unit">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkComboBoxText" id="comboboxtext_unit">
<property name="width_request">200</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="active">1</property>
<items>
<item translatable="yes">MB</item>
<item translatable="yes">GB</item>
</items>
</object>
<packing>
<property name="x">10</property>
<property name="y">10</property>
</packing>
</child>
</object>
</child>
</object>
<packing>
<property name="x">230</property>
<property name="y">60</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="frame_space_align">
<property name="width_request">440</property>
<property name="height_request">50</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
<child>
<object class="GtkFixed" id="fixed_space_alian">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkCheckButton" id="space_align_btn">
<property name="width_request">380</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="active">True</property>
</object>
<packing>
<property name="x">10</property>
<property name="y">10</property>
</packing>
</child>
</object>
</child>
</object>
<packing>
<property name="x">10</property>
<property name="y">140</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button_partcfg_ok">
<property name="label" translatable="yes">OK</property>
<property name="width_request">100</property>
<property name="height_request">40</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="x">90</property>
<property name="y">210</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button_partcfg_cancel">
<property name="label" translatable="yes">Cancel</property>
<property name="width_request">100</property>
<property name="height_request">40</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="x">270</property>
<property name="y">210</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="frame_dummy1">
<property name="width_request">460</property>
<property name="height_request">25</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
</object>
<packing>
<property name="x">10</property>
<property name="y">250</property>
</packing>
</child>
</object>
</child>
</object>
<object class="GtkWindow" id="window">
<property name="can_focus">False</property>
<property name="resizable">False</property>
<property name="title" translatable="yes">Ventoy2Disk</property>
<property name="modal">False</property>
<property name="window_position">center</property>
<property name="default_width">480</property>
<property name="default_height">365</property>
<child>
<object class="GtkFixed" id="fixed_main">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkMenuBar" id="menubar1">
<property name="width_request">480</property>
<property name="height_request">22</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkMenuItem" id="menu_option">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Options</property>
<property name="use_underline">True</property>
<child type="submenu">
<object class="GtkMenu" id="submenu_option">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkCheckMenuItem" id="menu_item_secure">
<property name="label">Secure Boot Support</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="active">False</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="menu_part_style">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Partition Style</property>
<property name="use_underline">True</property>
<child type="submenu">
<object class="GtkMenu" id="submenu_part_style">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkRadioMenuItem" id="menu_item_mbr">
<property name="label">MBR</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="active">True</property>
</object>
</child>
<child>
<object class="GtkRadioMenuItem" id="menu_item_gpt">
<property name="label">GPT</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="active">False</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkMenuItem" id="menu_item_part_cfg">
<property name="label">Partition Configuration</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="menu_item_clear">
<property name="label">Clear Ventoy</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
</object>
</child>
<child>
<object class="GtkCheckMenuItem" id="menu_item_show_all">
<property name="label">Show All Devices</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="active">False</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkMenuItem" id="menu_language">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Language</property>
<property name="use_underline">True</property>
<child type="submenu">
<object class="GtkMenu" id="submenu_language">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkFrame" id="frame_device">
<property name="width_request">460</property>
<property name="height_request">75</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
<child>
<object class="GtkFixed" id="fixed5">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkComboBoxText" id="combobox_devlist">
<property name="width_request">380</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="x">10</property>
<property name="y">5</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button_refresh">
<property name="width_request">50</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">image_refresh</property>
</object>
<packing>
<property name="x">398</property>
<property name="y">0</property>
</packing>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label_device">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes"> Device </property>
</object>
</child>
</object>
<packing>
<property name="x">10</property>
<property name="y">40</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="frame_pkg_ver">
<property name="width_request">228</property>
<property name="height_request">70</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0.5</property>
<child>
<object class="GtkFixed" id="fixed3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkImage" id="image_secure_local">
<property name="width_request">10</property>
<property name="height_request">40</property>
<property name="visible">False</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="x">20</property>
<property name="y">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_local_ver_value">
<property name="width_request">120</property>
<property name="height_request">40</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes"></property>
<property name="use_markup">True</property>
</object>
<packing>
<property name="x">45</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_local_part_style">
<property name="width_request">45</property>
<property name="height_request">20</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">MBR</property>
</object>
<packing>
<property name="x">180</property>
<property name="y">30</property>
</packing>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label_local_ver">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes"> Ventoy In Package </property>
<property name="use_markup">True</property>
</object>
</child>
</object>
<packing>
<property name="x">10</property>
<property name="y">132</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="frame3">
<property name="width_request">228</property>
<property name="height_request">70</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0.5</property>
<child>
<object class="GtkFixed" id="fixed4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkImage" id="image_secure_dev">
<property name="width_request">10</property>
<property name="height_request">40</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="x">20</property>
<property name="y">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_dev_ver_value">
<property name="width_request">120</property>
<property name="height_request">40</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes"></property>
<property name="use_markup">True</property>
</object>
<packing>
<property name="x">45</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_dev_part_style">
<property name="width_request">45</property>
<property name="height_request">20</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes"></property>
</object>
<packing>
<property name="x">180</property>
<property name="y">30</property>
</packing>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label_device_ver">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes"> Ventoy In Device </property>
<property name="use_markup">True</property>
</object>
</child>
</object>
<packing>
<property name="x">243</property>
<property name="y">132</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="frame4">
<property name="width_request">460</property>
<property name="height_request">50</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
<child>
<object class="GtkFixed" id="fixed2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkProgressBar" id="progressbar1">
<property name="width_request">440</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="fraction">0.0</property>
</object>
<packing>
<property name="x">8</property>
<property name="y">10</property>
</packing>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label_status">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes"> Status - READY</property>
</object>
</child>
</object>
<packing>
<property name="x">10</property>
<property name="y">215</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button_install">
<property name="label" translatable="yes">Install</property>
<property name="width_request">100</property>
<property name="height_request">40</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="x">100</property>
<property name="y">300</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button_update">
<property name="label" translatable="yes">Update</property>
<property name="width_request">100</property>
<property name="height_request">40</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="x">280</property>
<property name="y">300</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="frame_dummy2">
<property name="width_request">460</property>
<property name="height_request">25</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
</object>
<packing>
<property name="x">10</property>
<property name="y">345</property>
</packing>
</child>
</object>
</child>
</object>
</interface>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -8,7 +8,7 @@ fi
dos2unix -q ./tool/ventoy_lib.sh
dos2unix -q ./tool/VentoyWorker.sh
dos2unix -q ./tool/VentoyGTK.glade
. ./tool/ventoy_lib.sh
@@ -104,6 +104,7 @@ cp $OPT ./tool $tmpdir/
rm -f $tmpdir/ENROLL_THIS_KEY_IN_MOKMANAGER.cer
cp $OPT Ventoy2Disk.sh $tmpdir/
cp $OPT VentoyWeb.sh $tmpdir/
cp $OPT VentoyGUI* $tmpdir/
#cp $OPT Ventoy.desktop $tmpdir/
cp $OPT README $tmpdir/
@@ -131,11 +132,15 @@ rm -f ventoy-${curver}-linux.tar.gz
CurDir=$PWD
for d in i386 x86_64 aarch64; do
for d in i386 x86_64 aarch64 mips64el; do
cd $tmpdir/tool/$d
for file in $(ls); do
if [ "$file" != "xzcat" ]; then
xz --check=crc32 $file
if echo "$file" | grep -q '^Ventoy2Disk'; then
chmod +x $file
else
xz --check=crc32 $file
fi
fi
done
cd $CurDir
@@ -146,6 +151,9 @@ find $tmpdir/ -type d -exec chmod 755 "{}" +
find $tmpdir/ -type f -exec chmod 644 "{}" +
chmod +x $tmpdir/Ventoy2Disk.sh
chmod +x $tmpdir/VentoyWeb.sh
chmod +x $tmpdir/VentoyGUI*
cp $OPT $LANG_DIR/languages.json $tmpdir/tool/
#chmod +x $tmpdir/Ventoy.desktop
chmod +x $tmpdir/CreatePersistentImg.sh