From f868ea85f5bc1c0e7d36b3f74e45a4f756b9d87b Mon Sep 17 00:00:00 2001 From: mbusb Date: Sat, 30 Dec 2017 17:26:43 +0530 Subject: [PATCH] Windows improvements and update extlinux.cfg 1. Hide command wind when multibootusb is launched 2. Update extlinux.cfg to match with updated syslinux.cfg --- build_pkg | 2 +- data/version.txt | 2 +- scripts/update_cfg_file.py | 3 +++ scripts/usb.py | 5 ++++- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/build_pkg b/build_pkg index 5be8cb5b..4b8fd1ab 100644 --- a/build_pkg +++ b/build_pkg @@ -157,7 +157,7 @@ class pkg(): else: # subprocess.call('python ' + pyinstaller_path + ' --upx-dir C:\\upx multibootusb.spec', shell=True) == 0 and \ # os.path.exists(os.path.join("dist", 'multibootusb-' + self.version + ".exe")): - if subprocess.call('python ' + pyinstaller_path + ' --onefile onefile-multibootusb.spec', shell=True) == 0 and \ + if subprocess.call('python ' + pyinstaller_path + ' --uac-admin --onefile onefile-multibootusb.spec', shell=True) == 0 and \ os.path.exists(os.path.join("dist", 'multibootusb-' + self.version + ".exe")): shutil.copy2(os.path.join("dist", 'multibootusb-' + self.version + ".exe"), os.path.join(self.release_upload_dir, "Windows")) diff --git a/data/version.txt b/data/version.txt index e5c15102..f7ee0669 100644 --- a/data/version.txt +++ b/data/version.txt @@ -1 +1 @@ -8.9.0 +9.0.0 diff --git a/scripts/update_cfg_file.py b/scripts/update_cfg_file.py index a4bff75d..43ffba5a 100644 --- a/scripts/update_cfg_file.py +++ b/scripts/update_cfg_file.py @@ -409,6 +409,9 @@ def update_mbusb_cfg_file(iso_link, usb_uuid, usb_mount, distro): config_file.write("#end " + iso_basename(iso_link) + "\n") config_file.close() + # Update extlinux.cfg file by copying updated syslinux.cfg + shutil.copy(os.path.join(usb_mount, 'multibootusb', 'syslinux.cfg'), + os.path.join(usb_mount, 'multibootusb', 'extlinux.cfg')) def kaspersky_config(distro): diff --git a/scripts/usb.py b/scripts/usb.py index dd972f3c..8f216449 100644 --- a/scripts/usb.py +++ b/scripts/usb.py @@ -361,9 +361,12 @@ def gpt_device(dev_name): :return: True if GPT else False """ if platform.system() == 'Windows': + startupinfo = subprocess.STARTUPINFO() + startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW diskpart_cmd = 'wmic partition get name, type' dev_no = get_physical_disk_number(dev_name) - cmd_out = subprocess.check_output(diskpart_cmd) + cmd_out = subprocess.check_output(diskpart_cmd, subprocess.SW_HIDE, startupinfo=startupinfo) + gen.log(cmd_out) cmd_spt = cmd_out.split(b'\r') for line in cmd_spt: line = line.decode('utf-8')