Skip to content

Commit 5aaa28c

Browse files
committed
Update files to version 8.1.0
1 parent 5e9fcf9 commit 5aaa28c

22 files changed

+417
-862
lines changed

.gitignore

+8-1
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,11 @@ ENV/
9090
.ropeproject
9191

9292
# Created by PyCharm
93-
.idea
93+
.idea
94+
95+
# Source file
96+
multibootusb*.tar.gz
97+
98+
# Setup file
99+
100+
multibootusb*.exe

CHANGELOG

+11
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
Version - 8.1.0
2+
---------------
3+
* Fix for debain package bug which does not pull in dependency packages
4+
* In cluded 7zip for extracting ISO files (including UDF)
5+
* Fix for windows installer
6+
* Added Comodo Rescue Disk ISO
7+
* Fix for kaspersky rescue disk
8+
* Generic fix for distros using isolinux version 3
9+
* A new installer/setup executable for windows
10+
* Fix for random crash when trying to detect syslinux version
11+
112
Version - 8.0.0
213
---------------
314
* This version is written in python 3

LICENSE.txt

+5-664
Large diffs are not rendered by default.

build_pkg

100644100755
+13-14
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,13 @@ import platform
2525
####################################################################################################
2626
# Change the below variables to suit your needs.
2727
if platform.system() == "Windows":
28-
# pyinstaller_path = "F:\Documents\PyInstaller-3.2\pyinstaller.py"
29-
# pyinstaller_path = "I:\home\sundar\Documents\pyInstaller\pyinstaller.py"
3028
pyinstaller_path = 'D:\multibootusb\pyinstaller\pyinstaller.py'
31-
# release_dir = os.path.join("D:", "multibootusb", "release")
3229
release_dir = 'D:\\multibootusb\\release'
3330
else:
3431
from os.path import expanduser
3532
home = expanduser("~")
36-
pyinstaller_path = "/home/sundar/Documents/pyInstaller/pyinstaller.py"
33+
# pyinstaller_path = "/home/sundar/Documents/pyInstaller/pyinstaller.py"
34+
pyinstaller_path = "/media/sundar/Data/multibootusb/pyinstaller/pyinstaller.py"
3735
release_dir = "/media/sundar/Data/multibootusb/release"
3836
sourceforge_release_path = "[email protected]:/home/frs/project/multibootusb/"
3937
####################################################################################################
@@ -65,13 +63,14 @@ class pkg():
6563
os.mkdir(os.path.join(self.release_upload_dir, "Source"))
6664
if self.pkg_name == "deb":
6765
print("Ensure thta you have python-stdeb package installed!")
68-
stdcfg = ("[DEFAULT]\n"
69-
"Package: multibootusb\n"
70-
"Depends: python3-pyqt5, parted, util-linux, mtools, python-dbus, pkexec\n"
71-
"Build-Depends: python3-all\n"
72-
"Section: system\n"
73-
"XS-Python-Version: = 3.5\n"
74-
"Debian-Version: 1")
66+
stdcfg = """[DEFAULT]
67+
Package: multibootusb
68+
Depends3: python3-pyqt5, parted, util-linux, mtools, python3-dbus, p7zip-full
69+
Build-Depends: python3-all
70+
Section: system
71+
XS-Python-Version: = 3.5
72+
Debian-Version: 1"""
73+
7574
with open("stdeb.cfg", "w") as f:
7675
f.write(stdcfg)
7776
if subprocess.call('python3 setup.py --command-packages=stdeb.command bdist_deb', shell=True) == 0 and \
@@ -89,9 +88,9 @@ class pkg():
8988
result = True
9089
elif self.pkg_name == 'rpm' or self.pkg_name == 'suse' or self.pkg_name == 'mageia':
9190
if self.pkg_name == 'suse' or self.pkg_name == 'mageia':
92-
require = "python3-qt5, parted, util-linux, pkexec, mtools"
91+
require = "python3-qt5, parted, util-linux, mtools, python3-dbus, p7zip, p7zip-plugins"
9392
else:
94-
require = "PyQt5, parted, util-linux, mtools"
93+
require = "PyQt5, parted, util-linux, mtools, python3-dbus, p7zip, p7zip-plugins"
9594
setup_cfg = ("[bdist_rpm]\n"
9695
"Group = Applications/System\n"
9796
"Vendor = Sundar <[email protected]>\n"
@@ -125,7 +124,7 @@ class pkg():
125124
else:
126125
# subprocess.call('python ' + pyinstaller_path + ' --upx-dir C:\\upx multibootusb.spec', shell=True) == 0 and \
127126
# os.path.exists(os.path.join("dist", 'multibootusb-' + self.version + ".exe")):
128-
if subprocess.call('python ' + pyinstaller_path + ' --windowed multibootusb.spec', shell=True) == 0 and \
127+
if subprocess.call('python ' + pyinstaller_path + ' --onefile onefile-multibootusb.spec', shell=True) == 0 and \
129128
os.path.exists(os.path.join("dist", 'multibootusb-' + self.version + ".exe")):
130129
shutil.copy2(os.path.join("dist", 'multibootusb-' + self.version + ".exe"),
131130
os.path.join(self.release_upload_dir, "Windows"))

data/tools/7zip/7z.dll

1.02 MB
Binary file not shown.

data/tools/7zip/7z.exe

259 KB
Binary file not shown.
-647 KB
Binary file not shown.

data/version.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8.0.0
1+
8.1.0

install.py

100755100644
+5-5
Original file line numberDiff line numberDiff line change
@@ -78,23 +78,23 @@ def supported_pac_manager(self):
7878
def install_dependency_package(self):
7979
if subprocess.call("which pacman", shell=True) == 0:
8080
subprocess.call("pacman -Sy --noconfirm", shell=True)
81-
if subprocess.call("pacman -S --needed --noconfirm python-pyqt5 pkexec mtools parted util-linux python-dbus") == 0: # Thank you Neitsab for "--needed" argument.
81+
if subprocess.call("pacman -S --needed --noconfirm p7zip python-pyqt5 mtools parted util-linux python-dbus") == 0: # Thank you Neitsab for "--needed" argument.
8282
result = True
8383
elif subprocess.call("which yum", shell=True) == 0:
8484
subprocess.call("yum check-update", shell=True)
85-
if subprocess.call("yum install mtools PyQt5 pkexec util-linux parted python3-dbus -y", shell=True) == 0:
85+
if subprocess.call("yum install mtools PyQt5 pkexec util-linux parted p7zip p7zip-plugins python3-dbus -y", shell=True) == 0:
8686
result = True
8787
elif subprocess.call("which apt-get", shell=True) == 0:
8888
subprocess.call("apt-get -q update", shell=True)
89-
if subprocess.call("apt-get -q -y install python3-pyqt5 pkexec parted util-linux mtools python3-dbus", shell=True) == 0:
89+
if subprocess.call("apt-get -q -y install python3-pyqt5 p7zip-full parted util-linux mtools python3-dbus", shell=True) == 0:
9090
result = True
9191
elif subprocess.call("which zypper", shell=True) == 0:
9292
subprocess.call("zypper refresh", shell=True)
93-
if subprocess.call("zypper install -y mtools python3-qt5 pkexec util-linux parted", shell=True) == 0:
93+
if subprocess.call("zypper install -y mtools python3-qt5 p7zip p7zip-plugins util-linux parted", shell=True) == 0:
9494
result = True
9595
elif subprocess.call("which urpmi", shell=True) == 0:
9696
subprocess.call("urpmi.update -a", shell=True)
97-
if subprocess.call("urpmi install -auto mtools util-linux pkexec parted python3-qt5", shell=True) == 0:
97+
if subprocess.call("urpmi install -auto mtools util-linux p7zip p7zip-plugins parted python3-qt5", shell=True) == 0:
9898
result = True
9999

100100
if result is not True:

multibootusb.nsi

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
;--------------------------------
2+
;NSIS script for creating multibootusb setup file
3+
4+
Name "multibootusb 8.1.0"
5+
OutFile "multibootusb-8.1.0-setup.exe"
6+
7+
SetCompressor lzma
8+
9+
;--------------------------------
10+
;!Include Modern UI
11+
!include "MUI2.nsh"
12+
;--------------------------------
13+
14+
15+
;--------------------------------
16+
; Pages
17+
!insertmacro MUI_PAGE_LICENSE "LICENSE.txt"
18+
!insertmacro MUI_PAGE_DIRECTORY
19+
!insertmacro MUI_PAGE_INSTFILES
20+
21+
!insertmacro MUI_UNPAGE_CONFIRM
22+
!insertmacro MUI_UNPAGE_INSTFILES
23+
!insertmacro MUI_LANGUAGE "English"
24+
25+
;--------------------------------
26+
27+
28+
InstallDir "$PROGRAMFILES\multibootusb"
29+
InstallDirRegKey HKEY_LOCAL_MACHINE "SOFTWARE\multibootusb" ""
30+
31+
DirText $(s_InstallHere)
32+
33+
Icon data\tools\multibootusb.ico
34+
35+
Section "Dummy Section" SecDummy
36+
37+
; Install files.
38+
SetOverwrite on
39+
40+
SetOutPath "$INSTDIR"
41+
File /r "dist\multibootusb\*"
42+
43+
SetOutPath "$INSTDIR\data"
44+
File /r "data\*"
45+
46+
; Create shortcut.
47+
SetOutPath -
48+
CreateDirectory "$SMPROGRAMS\multibootusb"
49+
CreateShortCut "$SMPROGRAMS\multibootusb\multibootusb.lnk" "$INSTDIR\multibootusb.exe"
50+
CreateShortCut "$SMPROGRAMS\multibootusb\Uninstall multibootusb.lnk" "$INSTDIR\uninst.exe" "" "$INSTDIR\uninst.exe" 0
51+
52+
; Optionally start program.
53+
MessageBox MB_YESNO|MB_ICONQUESTION "Do you want to run multibootusb now?" IDNO SkipRunProgram
54+
Exec "$INSTDIR\multibootusb.exe"
55+
SkipRunProgram:
56+
57+
; Create uninstaller.
58+
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\multibootusb" "" "$INSTDIR"
59+
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\multibootusb" "DisplayName" "multibootusb (remove only)"
60+
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\multibootusb" "UninstallString" '"$INSTDIR\uninst.exe"'
61+
WriteUninstaller "$INSTDIR\uninst.exe"
62+
63+
SectionEnd
64+
65+
UninstallText $(s_UnInstall)
66+
67+
Section Uninstall
68+
69+
; Delete shortcuts.
70+
Delete "$SMPROGRAMS\multibootusb\multibootusb.lnk"
71+
Delete "$SMPROGRAMS\multibootusb\Uninstall multibootusb.lnk"
72+
RMDir "$SMPROGRAMS\multibootusb"
73+
Delete "$DESKTOP\multibootusb.lnk"
74+
75+
; Delete registry keys.
76+
Delete "$INSTDIR\uninst.exe"
77+
DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\multibootusb"
78+
DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\multibootusb"
79+
80+
; Remove the installation directories.
81+
RMDir /R "$INSTDIR"
82+
83+
SectionEnd

scripts/_7zip.py

+130
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: utf-8 -*-
3+
# Name: 7zip.py
4+
# Purpose: Wrapper module to list and extract ISO files using 7zip
5+
# Authors: Sundar
6+
# Licence: This file is a part of multibootusb package. You can redistribute it or modify
7+
# under the terms of GNU General Public License, v.2 or above
8+
9+
import os
10+
import platform
11+
import subprocess
12+
from . import config
13+
from . import gen
14+
15+
if platform.system() == 'Windows':
16+
_7zip = gen.quote(gen.resource_path(os.path.join('data', 'tools', '7zip', '7z.exe')))
17+
else:
18+
_7zip = '7z'
19+
20+
21+
def extract_iso(src, dst, pattern=None, suppress_out=True):
22+
"""
23+
Simple wrapper function to extract ISO file to destination
24+
:param src: Path to ISO file
25+
:param dst: Path to directory where the files are to be extracted
26+
:param patter: The pattern to match the files to be extracted
27+
:return:
28+
"""
29+
# 7z x -y -oC:\path_to_directory X:\path_to_iso_file.iso
30+
# 7z e archive.zip -oC:\path_to_directory *.cfg *.bin -r
31+
if platform.system() == 'Windows':
32+
cli_option = ' -bb1' # Linux does not accept this option (may be due to version diff).
33+
if suppress_out != '':
34+
# suppress_out = ' 2> nul'
35+
suppress_out = ''
36+
else:
37+
cli_option = ''
38+
if suppress_out != '':
39+
suppress_out = ' 2> /dev/null'
40+
41+
if not os.path.exists(src):
42+
print('ISO file could not be found on the location specified.')
43+
return False
44+
if not os.path.exists(dst):
45+
os.makedirs(dst, exist_ok=True)
46+
47+
if pattern is None:
48+
_cmd = _7zip + cli_option + ' x -y -o' + gen.quote(dst) + ' ' + gen.quote(src) + suppress_out
49+
else:
50+
_cmd = _7zip + ' -y x ' + gen.quote(src) + ' -o' + dst + ' ' + gen.quote(pattern) + ' -r' + suppress_out
51+
# print('Executing', _cmd)
52+
_7zip_process = subprocess.Popen(_cmd, universal_newlines=True, stdin=subprocess.PIPE, stderr=subprocess.PIPE,
53+
stdout=subprocess.PIPE, shell=True)
54+
config.status_text = 'Extracting ' + os.path.basename(src)
55+
while True:
56+
line = _7zip_process.stdout.readline()
57+
# print(line)
58+
if line.startswith('- '):
59+
config.status_text = 'Extracting ' + line[2:]
60+
elif platform.system() == 'Linux': # line.startswith('Extracting'): # Under Linux it prints directly all the process (may be due to version diff).
61+
config.status_text = line
62+
if line == '' and _7zip_process.poll() != None:
63+
break
64+
65+
66+
def list_iso(iso_link, suppress_out=True):
67+
if platform.system() == 'Windows':
68+
if suppress_out is True:
69+
suppress_out = ' 2> nul'
70+
else:
71+
if suppress_out is True:
72+
suppress_out = ' 2> /dev/null'
73+
if not os.path.exists(iso_link):
74+
print('Path to ISO link does not exist.')
75+
return False
76+
else:
77+
file_list = []
78+
_cmd = _7zip + ' l ' + gen.quote(iso_link) + suppress_out
79+
# print('Executing', _cmd)
80+
_cmd_out = subprocess.check_output(_cmd, universal_newlines=True, stderr=subprocess.PIPE, shell=True).splitlines()
81+
for line in _cmd_out:
82+
line = line.split()
83+
if '.....' in line:
84+
file_list.append(line[-1])
85+
86+
return file_list
87+
88+
89+
def test_iso(iso_link, suppress_out=True):
90+
"""
91+
Function to test if ISO file is corrupted. Relying only on 7zip.
92+
:param iso_link: Path to ISO file
93+
:return: True if test is positive
94+
"""
95+
# 7z t /path/to/iso/file.iso
96+
# return value : 0 No error
97+
# return value : 1 Warning (Non fatal error(s))
98+
# return value : 2 Fatal error
99+
# return value : 7 Command line error
100+
# return value : 8 Not enough memory for operation
101+
# return value : 255 User stopped the process
102+
103+
if platform.system() == 'Windows':
104+
if suppress_out is True:
105+
suppress_out = ' > nul'
106+
else:
107+
if suppress_out is True:
108+
suppress_out = ' > /dev/null'
109+
110+
_cmd = _7zip + ' t ' + iso_link + suppress_out
111+
112+
# print('Executing', _cmd)
113+
114+
rc = subprocess.call(_cmd, shell=True)
115+
116+
if rc == 0 or rc == 1:
117+
return True
118+
else:
119+
return False
120+
121+
122+
if __name__ == '__main__':
123+
# slitaz-4.0.iso
124+
# ubuntu-16.04-desktop-amd64.iso
125+
# avg_arl_cdi_all_120_160420a12074.iso
126+
# haiku-nightly.iso
127+
# Hiren_BootCD.iso
128+
file_list = list_iso('../../ubuntu_14_04_backup/Downloads/clonezilla-live-2.4.2-32-amd64.iso')
129+
for f in file_list:
130+
print(f)

scripts/admin.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def runAsAdmin(cmdLine=None, wait=True):
103103
#showCmd = win32con.SW_HIDE
104104
lpVerb = 'runas' # causes UAC elevation prompt.
105105

106-
# print "Running", cmd, params
106+
#print("Running", cmd, params)
107107

108108
# ShellExecute() doesn't seem to allow us to fetch the PID or handle
109109
# of the process, so we can't get anything useful from it. Therefore

scripts/distro.py

+5-7
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
from . import config
1717

1818

19-
2019
def distro(iso_cfg_ext_dir, iso_link):
2120
"""
2221
Detect if distro is supported by multibootusb.
@@ -40,7 +39,7 @@ def distro(iso_cfg_ext_dir, iso_link):
4039
if re.search(r'ubcd', string, re.I):
4140
return "ubcd"
4241
elif re.search(r'Super Grub Disk', string, re.I):
43-
return None
42+
return "sgrubd2"
4443
elif re.search(r'hbcd', string, re.I):
4544
return "hbcd"
4645
elif re.search(r'systemrescuecd', string, re.I):
@@ -136,13 +135,12 @@ def distro(iso_cfg_ext_dir, iso_link):
136135
def detect_iso_from_file_list(iso_link):
137136
"""
138137
Fallback detection script from the content of an ISO.
139-
:return:
138+
:return: supported distro as string
140139
"""
140+
from . import _7zip
141141
if os.path.exists(iso_link):
142-
iso9660fs = ISO9660(iso_link)
143-
iso_file_list = iso9660fs.readDir("/")
144-
print(iso_file_list)
145-
if any("sources" in s.lower() for s in iso_file_list):
142+
iso_file_list = _7zip.list_iso(iso_link)
143+
if any("sources" in s.lower() for s in iso_file_list) and any("boot.wim" in s.lower() for s in iso_file_list):
146144
return "Windows"
147145
elif any("config.isoclient" in s.lower() for s in iso_file_list):
148146
return "opensuse"

0 commit comments

Comments
 (0)