ale5000-git / tingle

Tingle - Android patcher
http://forum.xda-developers.com/showthread.php?t=3438764
GNU General Public License v3.0
160 stars 11 forks source link

7za-win32.exe is wrong version for 64-bit Windows #27

Closed georgedorn closed 6 years ago

georgedorn commented 7 years ago

If you get a message like this on windows:

 *** OS: Windows 10 (win32)
 *** Mode: 2
 *** Working dir: c:\users\myuser\appdata\local\temp\Tingle-q_ewlx
 *** Decompressing framework...
      DEBUG: Decompressing framework.jar
Traceback (most recent call last):
  File "main.py", line 408, in <module>
    decompress("framework.jar", "framework/")
  File "main.py", line 289, in decompress
    subprocess.check_output(decomp_cmd)
  File "c:\Python27\lib\subprocess.py", line 212, in check_output
    process = Popen(stdout=PIPE, *popenargs, **kwargs)
  File "c:\Python27\lib\subprocess.py", line 390, in __init__
    errread, errwrite)
  File "c:\Python27\lib\subprocess.py", line 640, in _execute_child
    startupinfo)
WindowsError: [Error 5] Access is denied

This is because the included 7za-win32.exe only runs on 32-bit windows. Despite the message at the top (Windows 10 (win32)) I'm running on x64.

A workaround for anybody else running into this problem:

  1. Download and install 7Zip. The portable version is fine.
  2. Look in the 7Zip install dir for 7z.exe
  3. Copy 7z.exe to tingle\tools
  4. Rename it to 7za-win32.exe so that the python script will find it.
ale5000-git commented 7 years ago

Any 64-bit version of Windows that I know is able to run 32-bit executables. I also use it from a 64-bit version of Windows.

There must be a different problem, more related to permissions. I will look at it.

georgedorn commented 7 years ago

That is the case here, yeah. It is set to 'Read' for Everyone, but not 'Read & execute'. So not a 64/32-bit issue, though I have seen the same error when trying to run certain especially naive 32-bit executables in the past.

So the alternate workaround is to set the executable permission on 7za-win32.exe, either via Properties or chmod if you have a bash shell (like Cygwin).

ale5000-git commented 6 years ago

@georgedorn I have fixed the permission. Now it also use the 64-bit 7za if Tingle is executed under 64-bit Python. So everything should work perfectly now.

Please test it and report back.