diff --git a/build_command_line_linux.bash b/build_command_line_linux.bash old mode 100644 new mode 100755 index 96935b5..2f95904 --- a/build_command_line_linux.bash +++ b/build_command_line_linux.bash @@ -1,3 +1,10 @@ -rm -rf command_line_builds/files +rm -rf command_line_builds + pyinstaller --onefile --hidden-import configobj --distpath command_line_builds -n web2exe-linux command_line.py cp -rf files command_line_builds/files +rm -rf command_line_builds/files/downloads/* + +rm -rf Web2ExeLinux +pyinstaller -F --hidden-import configobj -n web2exe --distpath Web2ExeLinux main.py +cp -rf files Web2ExeLinux/files +rm -rf Web2ExeLinux/files/downloads/* diff --git a/command_line.py b/command_line.py index d22e140..f8a9f2f 100644 --- a/command_line.py +++ b/command_line.py @@ -15,7 +15,6 @@ import stat import tarfile import zipfile import traceback -import platform import subprocess from distutils.version import LooseVersion @@ -99,6 +98,13 @@ class Setting(object): self.save_path = location else: self.save_path = self.save_path or DEFAULT_DOWNLOAD_PATH + + versions = re.findall('(\d+)\.(\d+)\.(\d+)', version)[0] + + minor = int(versions[1]) + if minor >= 12: + self.save_path = self.save_path.replace('node-webkit', 'nwjs') + self.get_file_information_from_url() if self.full_file_path: @@ -117,19 +123,28 @@ class Setting(object): def get_file_bytes(self, version): fbytes = [] - file = self.extract_class(self.save_file_path(version), + path = self.save_file_path(version) + + file = self.extract_class(path, *self.extract_args) for extract_path, dest_path in zip(self.extract_files, self.dest_files): new_bytes = None try: extract_p = extract_path.format(version) + + versions = re.findall('(\d+)\.(\d+)\.(\d+)', version)[0] + + minor = int(versions[1]) + if minor >= 12: + extract_p = extract_p.replace('node-webkit', 'nwjs') + if self.file_ext == '.gz': new_bytes = file.extractfile(extract_p).read() elif self.file_ext == '.zip': new_bytes = file.read(extract_p) except KeyError as e: - log(e) + log(str(e)) # dirty hack to support old versions of nw if 'no item named' in str(e): extract_path = '/'.join(extract_path.split('/')[1:]) @@ -139,7 +154,7 @@ class Setting(object): elif self.file_ext == '.zip': new_bytes = file.read(extract_path) except KeyError as e: - log(e) + log(str(e)) if new_bytes is not None: fbytes.append((dest_path, new_bytes)) @@ -639,6 +654,12 @@ class CommandBase(object): location = self.get_setting('download_dir').value + versions = re.findall('v(\d+)\.(\d+)\.(\d+)', path)[0] + + minor = int(versions[1]) + if minor >= 12: + path = path.replace('node-webkit', 'nwjs') + url = path file_name = setting.save_file_path(self.selected_version(), location) diff --git a/files/images/icon.png b/files/images/icon.png index 89139a9..6bfef5f 100644 Binary files a/files/images/icon.png and b/files/images/icon.png differ diff --git a/files/images/icon.svg b/files/images/icon.svg new file mode 100644 index 0000000..519c719 --- /dev/null +++ b/files/images/icon.svg @@ -0,0 +1,98 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/files/nw-versions.txt b/files/nw-versions.txt index 89bba11..cafd67a 100644 --- a/files/nw-versions.txt +++ b/files/nw-versions.txt @@ -1,3 +1,9 @@ +0.12.0-rc1 +0.12.0-alpha3 +0.12.0-alpha2 +0.12.0-alpha1 +0.12.0 +0.11.6 0.11.5 0.11.4 0.11.3 diff --git a/files/settings.cfg b/files/settings.cfg index 55db954..35d2ca4 100644 --- a/files/settings.cfg +++ b/files/settings.cfg @@ -212,6 +212,7 @@ linux_64_dir_prefix = 'node-webkit-v{}-linux-x64' '%(win_32_dir_prefix)s/ffmpegsumo.dll', '%(win_32_dir_prefix)s/libGLESv2.dll', '%(win_32_dir_prefix)s/d3dcompiler_46.dll', + '%(win_32_dir_prefix)s/d3dcompiler_47.dll', '%(win_32_dir_prefix)s/pdf.dll' ]""" dest_files="""['nw.exe', @@ -221,6 +222,7 @@ linux_64_dir_prefix = 'node-webkit-v{}-linux-x64' 'ffmpegsumo.dll', 'libGLESv2.dll', 'd3dcompiler_46.dll', + 'd3dcompiler_47.dll', 'pdf.dll' ]""" [[windows-x64]] @@ -234,6 +236,7 @@ linux_64_dir_prefix = 'node-webkit-v{}-linux-x64' '%(win_64_dir_prefix)s/ffmpegsumo.dll', '%(win_64_dir_prefix)s/libGLESv2.dll', '%(win_64_dir_prefix)s/d3dcompiler_46.dll', + '%(win_64_dir_prefix)s/d3dcompiler_47.dll', '%(win_64_dir_prefix)s/pdf.dll' ]""" dest_files="""['nw.exe', @@ -243,6 +246,7 @@ linux_64_dir_prefix = 'node-webkit-v{}-linux-x64' 'ffmpegsumo.dll', 'libGLESv2.dll', 'd3dcompiler_46.dll', + 'd3dcompiler_47.dll', 'pdf.dll' ]""" diff --git a/icon.png b/icon.png index 89139a9..6bfef5f 100644 Binary files a/icon.png and b/icon.png differ diff --git a/main.py b/main.py index 7e587da..4b4df0f 100644 --- a/main.py +++ b/main.py @@ -1,8 +1,9 @@ from utils import log, open_folder_in_explorer -__gui_version__ = "v0.1.16b" +__gui_version__ = "v0.1.17b" import os +import re import glob import sys @@ -364,10 +365,18 @@ class MainWindow(QtGui.QWidget, CommandBase): def download_file(self, path, setting): version_file = self.settings['base_url'].format(self.selected_version()) - self.progress_text = 'Downloading {}'.format(path.replace(version_file, '')) location = self.get_setting('download_dir').value + versions = re.findall('v(\d+)\.(\d+)\.(\d+)', path)[0] + + minor = int(versions[1]) + if minor >= 12: + path = path.replace('node-webkit', 'nwjs') + setting.url = path + + self.progress_text = 'Downloading {}'.format(path.replace(version_file, '')) + url = QUrl(path) file_name = setting.save_file_path(self.selected_version(), location) @@ -387,7 +396,7 @@ class MainWindow(QtGui.QWidget, CommandBase): self.out_file = QFile(file_name) if not self.out_file.open(QIODevice.WriteOnly): - error = self.out_file.error_string() + error = self.out_file.error().name self.show_error('Unable to save the file {}: {}.'.format(file_name, error)) self.out_file = None