Skip to content

Commit

Permalink
update to version 8.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mbusb committed Dec 26, 2016
1 parent a149f76 commit be4c8d9
Show file tree
Hide file tree
Showing 21 changed files with 383 additions and 285 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
Version - 8.4.0
---------------
* Bug fix in selection of persistence size
* Fixed crashing of application when selecting extended drive
* Introduction of log file (/tmp/multibootusb.log on linux and C:\Program Files (x86)\multibootusb\multibootusb.log under Windows)
* Added F Secure Rescue CD
* Added Tail
* Support for latest wifislax
* Fix for ROSA boot issue
* Various other minor bug fixes

Version - 8.3.0
---------------
* Added React OS
Expand Down
6 changes: 3 additions & 3 deletions build_pkg
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class pkg():
print("Ensure thta you have python-stdeb package installed!")
stdcfg = """[DEFAULT]
Package: multibootusb
Depends3: python3-pyqt5, parted, util-linux, mtools, python3-dbus, p7zip-full
Depends3: python3-pyqt5, parted, util-linux, mtools, python3-dbus, p7zip-full, python3-six
Build-Depends: python3-all
Section: system
XS-Python-Version: = 3.5
Expand All @@ -88,9 +88,9 @@ class pkg():
result = True
elif self.pkg_name == 'rpm' or self.pkg_name == 'suse' or self.pkg_name == 'mageia':
if self.pkg_name == 'suse' or self.pkg_name == 'mageia':
require = "python3-qt5, parted, util-linux, mtools, python3-dbus, p7zip, p7zip-plugins"
require = "python3-qt5, parted, util-linux, mtools, python3-dbus, p7zip, p7zip-plugins, python3-six"
else:
require = "PyQt5, parted, util-linux, mtools, python3-dbus, p7zip, p7zip-plugins"
require = "PyQt5, parted, util-linux, mtools, python3-dbus, p7zip, p7zip-plugins, python3-six"
setup_cfg = ("[bdist_rpm]\n"
"Group = Applications/System\n"
"Vendor = Sundar <[email protected]>\n"
Expand Down
2 changes: 1 addition & 1 deletion data/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.3.0
8.4.0
11 changes: 7 additions & 4 deletions multibootusb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# Licence: This file is a part of multibootusb package. You can redistribute it or modify
# under the terms of GNU General Public License, v.2 or above

import logging
import getopt
import sys
import os
Expand All @@ -16,10 +17,12 @@ import platform
try:
from scripts.mbusb_cli import *
from scripts import admin
from scripts import gen
except:
try:
from .scripts.mbusb_cli import *
from .scripts import admin
from .scripts import gen
except:
import scripts

Expand All @@ -44,16 +47,16 @@ def usage():

def start_gui():
from scripts import mbusb_gui
print('Starting multibootusb GUI...')
gen.log('Starting multibootusb GUI...')
if platform.system() == 'Linux':
if os.getuid() != 0:
print('\n\n\nAdmin privilege is required to run multibootusb.\n If you are running from source try '
'\'sudo python3 ./multibootusb\'\n or you can try \'multibootusb-pkexec\' (post install)\n\n\n')
gen.log('\n\nAdmin privilege is required to run multibootusb.\n If you are running from source try '
'\'sudo python3 ./multibootusb\'\n or you can try \'multibootusb-pkexec\' (post install)\n\n',
info=False, debug=True)
mbusb_gui.main_gui()


if __name__ == '__main__':

if platform.system() == 'Windows':
if not admin.isUserAdmin():
admin.runAsAdmin()
Expand Down
4 changes: 2 additions & 2 deletions multibootusb.nsi
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
;--------------------------------
;NSIS script for creating multibootusb setup file

Name "multibootusb 8.2.0"
OutFile "multibootusb-8.2.0-setup.exe"
Name "multibootusb 8.4.0"
OutFile "multibootusb-8.4.0-setup.exe"

SetCompressor lzma

Expand Down
12 changes: 6 additions & 6 deletions scripts/_7zip.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def extract_iso(src, dst, pattern=None, suppress_out=True):
suppress_out = ' 2> /dev/null'

if not os.path.exists(src):
print('ISO file could not be found on the location specified.')
gen.log('ISO file could not be found on the location specified.')
return False
if not os.path.exists(dst):
os.makedirs(dst, exist_ok=True)
Expand All @@ -48,13 +48,13 @@ def extract_iso(src, dst, pattern=None, suppress_out=True):
_cmd = _7zip + cli_option + ' x -y -o' + gen.quote(dst) + ' ' + gen.quote(src) + suppress_out
else:
_cmd = _7zip + ' -y x ' + gen.quote(src) + ' -o' + dst + ' ' + gen.quote(pattern) + ' -r' + suppress_out
# print('Executing', _cmd)
# gen.log('Executing', _cmd)
_7zip_process = subprocess.Popen(_cmd, universal_newlines=True, stdin=subprocess.PIPE, stderr=subprocess.PIPE,
stdout=subprocess.PIPE, shell=True)
config.status_text = 'Extracting ' + os.path.basename(src)
while True:
line = _7zip_process.stdout.readline()
# print(line)
# gen.log(line)
if line.startswith('- '):
config.status_text = 'Extracting ' + line[2:]
elif platform.system() == 'Linux': # line.startswith('Extracting'): # Under Linux it prints directly all the process (may be due to version diff).
Expand All @@ -71,12 +71,12 @@ def list_iso(iso_link, suppress_out=True):
if suppress_out is True:
suppress_out = ' 2> /dev/null'
if not os.path.exists(iso_link):
print('Path to ISO link does not exist.')
gen.log('Path to ISO link does not exist.')
return False
else:
file_list = []
_cmd = _7zip + ' l ' + gen.quote(iso_link) + suppress_out
# print('Executing', _cmd)
# gen.log('Executing', _cmd)
_cmd_out = subprocess.check_output(_cmd, universal_newlines=True, stderr=subprocess.PIPE, shell=True).splitlines()
for line in _cmd_out:
line = line.split()
Expand Down Expand Up @@ -109,7 +109,7 @@ def test_iso(iso_link, suppress_out=True):

_cmd = _7zip + ' t ' + iso_link + suppress_out

# print('Executing', _cmd)
# gen.log('Executing', _cmd)

rc = subprocess.call(_cmd, shell=True)

Expand Down
13 changes: 7 additions & 6 deletions scripts/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import sys
import subprocess
from PyQt5 import QtWidgets
from . import gen


def isUserAdmin():
Expand All @@ -46,7 +47,7 @@ def isUserAdmin():
(root on Unix), otherwise False.
Warning: The inner function fails unless you have Windows XP SP2 or
higher. The failure causes a traceback to be printed and this
higher. The failure causes a traceback to be gen.loged and this
function to return False.
"""

Expand All @@ -57,7 +58,7 @@ def isUserAdmin():
return ctypes.windll.shell32.IsUserAnAdmin()
except:
traceback.print_exc()
print("Admin check failed, assuming not an admin.")
gen.log("Admin check failed, assuming not an admin.")
return False
elif platform.system() == "Linux":
return os.getuid() == 0
Expand Down Expand Up @@ -103,7 +104,7 @@ def runAsAdmin(cmdLine=None, wait=True):
#showCmd = win32con.SW_HIDE
lpVerb = 'runas' # causes UAC elevation prompt.

#print("Running", cmd, params)
#gen.log("Running", cmd, params)

# ShellExecute() doesn't seem to allow us to fetch the PID or handle
# of the process, so we can't get anything useful from it. Therefore
Expand All @@ -121,7 +122,7 @@ def runAsAdmin(cmdLine=None, wait=True):
procHandle = procInfo['hProcess']
obj = win32event.WaitForSingleObject(procHandle, win32event.INFINITE)
rc = win32process.GetExitCodeProcess(procHandle)
#print "Process handle %s returned code %s" % (procHandle, rc)
#gen.log "Process handle %s returned code %s" % (procHandle, rc)
else:
rc = None

Expand Down Expand Up @@ -157,10 +158,10 @@ def adminCmd(cmd, fork=False, gui=False):
'Could not find any of: pkexec, sudo, gksu, kdesu, gksudo, or kdesudo. Please install one then restart multibootusb.')
sys.exit(0)
final_cmd = ' '.join(sudo_cmd + ['"' + ' '.join(cmd).replace('"', '\\"') + '"'])
print("Executing ==> " + final_cmd)
gen.log("Executing ==> " + final_cmd)
if fork:
return subprocess.Popen(final_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, bufsize=1, shell=True)
else:
ret = subprocess.call(final_cmd, shell=True)
print("Process returned ==> " + str(ret))
gen.log("Process returned ==> " + str(ret))
return ret
10 changes: 6 additions & 4 deletions scripts/distro.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def distro(iso_cfg_ext_dir, iso_link):
return "solydx"
elif re.search(r'knoppix', string, re.I):
return "knoppix"
elif re.search(r'root=live', string, re.I):
elif re.search(r'root=live:CDLABEL=', string, re.I):
return "fedora"
elif re.search(r'redhat', string, re.I):
return "redhat"
Expand All @@ -74,7 +74,7 @@ def distro(iso_cfg_ext_dir, iso_link):
re.I):
return "opensuse"
elif re.search(
r'slitaz|dban|ophcrack|tinycore|rescue.cpi|xpud|untangle|4mlinux|partition wizard|'
r'slitaz|dban |ophcrack|tinycore|rescue.cpi|xpud|untangle|4mlinux|partition wizard|android-x86.png|'
r'riplinux|lebel dummy|http://pogostick.net/~pnh/ntpasswd/|AVG Rescue CD', string, re.I):
return "slitaz"
elif re.search(r'boot=casper', string, re.I):
Expand Down Expand Up @@ -123,6 +123,8 @@ def distro(iso_cfg_ext_dir, iso_link):
return "Windows"
elif re.search(r'ReactOS', string, re.I):
return "ReactOS"
elif re.search(r'fsecure', string, re.I):
return "fsecure"

distro = detect_iso_from_file_list(iso_link)
if distro:
Expand Down Expand Up @@ -159,11 +161,11 @@ def detect_iso_from_file_list(iso_link):
elif any("menu.lst" in s.lower() for s in iso_file_list):
return "grub4dos"
else:
print(iso_file_list)
log(iso_file_list)

if __name__ == '__main__':
iso_cfg_ext_dir = os.path.join(multibootusb_host_dir(), "iso_cfg_ext_dir")
#iso_link = '../../../DISTROS/2016/debian-live-8.3.0-amd64-lxde-desktop.iso'
iso_link = '/media/sundar/Data/DISTROS/ubuntu_14_04_backup/Downloads/clonezilla-live-2.4.2-32-amd64.iso'
iso_extract_file(iso_link, iso_cfg_ext_dir, 'cfg')
print(distro(iso_cfg_ext_dir))
log(distro(iso_cfg_ext_dir))
Loading

0 comments on commit be4c8d9

Please sign in to comment.