Commit 3ba4fc27 authored by rgaudin's avatar rgaudin
Browse files

Fixed #206: Use Python64 to build 64b Windows builds

langcodes replaced by iso639 as langcodes depends on marisa-trie which fails on Winx64
parent 5617efb6
......@@ -3,6 +3,10 @@
* Supplied file (edupi_resource, logo, css, favicon) checked for existence
* Fixed JSON export on Windows [regression]
* Fixed ImDisk installation (Windows)
* Added Manual ImDisk Installation/Uninstallation
* Load/Save JSON always from the Home folder
* Admin Account now mandatory (not switch) with convenient defaults
* Fixed Windows 64b builds not being 64b
2.0-rc4
* Use decimal (GB) sizes for SD card selection
......
from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files('iso639')
#-----------------------------------------------------------------------------
# Copyright (c) 2013-2016, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files('langcodes')
......@@ -64,11 +64,14 @@ install:
- 7z.exe x ..\setup.exe
- set GIR=True
# note: we use python34 because it is the last supported by pygi-aio
- rcmd.exe /c setup.bat C:\Python34 GTK
- if %platform%==x86 rcmd.exe /c setup.bat C:\Python34 GTK
- if %platform%==x64 rcmd.exe /c setup.bat C:\Python34-x64 GTK
# note: we create a symbolic link for pyinstaller
- mklink /D C:\Python34\share C:\Python34\Lib\site-packages\gnome\share
- if %platform%==x86 mklink /D C:\Python34\share C:\Python34\Lib\site-packages\gnome\share
- if %platform%==x64 mklink /D C:\Python34-x64\share C:\Python34-x64\Lib\site-packages\gnome\share
- cd ..\..
- dir C:\Python34\Lib\site-packages\gi
- if %platform%==x86 dir C:\Python34\Lib\site-packages\gi
- if %platform%==x64 dir C:\Python34-x64\Lib\site-packages\gi
# Install gdk-pixbuf and add it to PATH because it is needed by pyinstaller
- if %platform%==x86 C:\msys64\usr\bin\bash --login -c "pacman -S mingw-w64-i686-gdk-pixbuf2 --noconfirm"
......@@ -78,9 +81,8 @@ install:
# Install pyinstaller and requirements
- cd C:\projects\pibox-installer
- C:\Python34\python.exe -m pip install pypiwin32==219
- C:\Python34\python.exe -m pip install pyinstaller==3.2.1
- C:\Python34\python.exe -m pip install -r requirements-windows.txt
- if %platform%==x86 C:\Python34\python.exe -m pip install pypiwin32==219 pyinstaller==3.2.1 -r requirements-windows.txt
- if %platform%==x64 C:\Python34-x64\python.exe -m pip install pypiwin32==219 pyinstaller==3.2.1 -r requirements-windows.txt
# Install qemu
- mkdir "C:\Program Files\qemu"
......@@ -114,7 +116,7 @@ install:
# Run pyinstaller and show warning
- cd C:\projects\pibox-installer
- if %platform%==x86 C:\Python34\python.exe C:\Python34\Scripts\pyinstaller-script.py --log-level=DEBUG pibox-installer-win32.spec
- if %platform%==x64 C:\Python34\python.exe C:\Python34\Scripts\pyinstaller-script.py --log-level=DEBUG pibox-installer-win64.spec
- if %platform%==x64 C:\Python34-x64\python.exe C:\Python34-x64\Scripts\pyinstaller-script.py --log-level=DEBUG pibox-installer-win64.spec
- if %platform%==x86 type build\pibox-installer-win32\warnpibox-installer-win32.txt
- if %platform%==x64 type build\pibox-installer-win64\warnpibox-installer-win64.txt
......
......@@ -30,10 +30,12 @@ def system_has_exfat():
if sys.platform == "win32":
imdiskinst = os.path.join(data_dir, 'imdiskinst')
system32 = os.path.join(os.environ['SystemRoot'], 'SysNative')
system = os.path.join(os.environ['SystemRoot'], 'SysWOW64') \
if 'PROGRAMFILES(X86)' in os.environ else system32
imdisk_exe = os.path.join(system, 'imdisk.exe')
# Windows holds 3 folders:
# - Sytem32: files of the system architecture: 32b on x86, 64b on x64
# - SysWOW64: 32b files on x64
# - SysNative: virt folder to access 64b files from 32b bins on x64
system32 = os.path.join(os.environ['SystemRoot'], 'System32')
imdisk_exe = os.path.join(system32, 'imdisk.exe')
elif sys.platform == "linux":
udisksctl_exe = '/usr/bin/udisksctl'
udisks_nou = '--no-user-interaction'
......@@ -85,16 +87,12 @@ def install_imdisk(logger, force=False):
return
logger.std("Imdisk IS NOT present. Installing...")
# disable integrity checks (allow install of unsigned driver)
subprocess_pretty_call([os.path.join(system32, 'bcdedit.exe'),
'/set', 'nointegritychecks', 'on'], logger)
# install the driver and files
cwd = os.getcwd()
try:
os.chdir(imdiskinst)
ret, _ = subprocess_pretty_call([
os.path.join(system, 'rundll32.exe'),
'rundll32.exe',
'setupapi.dll,InstallHinfSection',
'DefaultInstall', '132', '.\\imdisk.inf'], logger)
except Exception:
......@@ -104,7 +102,7 @@ def install_imdisk(logger, force=False):
if ret != 0:
raise OSError("Unable to install ImDisk driver. "
"Please reboot your computer and retry")
"Please install manually from the File menu.")
# start services
failed = []
......@@ -114,7 +112,7 @@ def install_imdisk(logger, force=False):
if failed:
raise OSError("ImDisk installed but some "
"service/driver failed to start: {}.\n"
"Please reboot your computer and retry"
"Please install manually from the File menu."
.format(" ".join(failed)))
assert os.path.exists(imdisk_exe)
......
......@@ -19,7 +19,7 @@ from util import get_free_space_in_dir
from util import relpathto
from util import b64encode, b64decode
import data
import langcodes
import iso639
import string
import humanfriendly
import webbrowser
......@@ -237,7 +237,7 @@ class Application:
"activate", self.activate_menu_help)
# imdisk menu is windows only
if sys.platform == "win32" or True:
if sys.platform == "win32":
self.component.menu_imdisk.set_visible(True)
self.component.menu_imdisk.connect(
"activate", self.activate_menu_imdisk)
......@@ -323,8 +323,13 @@ class Application:
url = value["url"]
description = value.get("description") or "none"
size = str(value["size"])
languages_iso = (value.get("language") or "Unkown language").split(",")
languages = set(map(lambda l: langcodes.Language.get(l).language_name(), languages_iso))
languages = []
for iso_code in (value.get("language") or "Unknown language").split(","):
try:
languages.append(iso639.languages.get(part3=iso_code).name)
except KeyError:
pass
languages = set(languages)
typ = value["type"]
version = str(value["version"])
formatted_size = human_readable_size(int(size))
......
......@@ -12,7 +12,7 @@ pyparsing==2.2.0
pytz==2017.2
PyYAML==3.12
six==1.10.0
langcodes==1.4.0
iso-639==0.4.5
path.py==11.0
psutil==5.4.5
humanfriendly==4.12
......
......@@ -11,7 +11,7 @@ pyparsing==2.2.0
pytz==2017.2
PyYAML==4.2b2
six==1.10.0
langcodes==1.4.0
iso-639==0.4.5
path.py==11.0
psutil==5.4.5
humanfriendly==4.12
......
......@@ -11,7 +11,7 @@ pyparsing==2.2.0
pytz==2017.2
PyYAML==3.12
six==1.10.0
langcodes==1.4.0
iso-639==0.4.5
path.py==11.0
psutil==5.4.5
humanfriendly==4.12
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment