Skip to content

Commit

Permalink
Fixed compression not working in Windows 10.
Browse files Browse the repository at this point in the history
  • Loading branch information
jyapayne committed Jan 20, 2016
1 parent d7beb8d commit 270642f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Web2Exe.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,12 @@ Section "Web2Executable" SEC01
SectionIn RO
SetOutPath "$INSTDIR"
SetOverwrite try
File /r "Web2ExeWin\"
File /r /x compressors "Web2ExeWin\"

CreateDirectory "$LocalAppData\Web2Executable\Web2Executable\files\compressors"
SetOutPath "$LocalAppData\Web2Executable\Web2Executable\files\compressors"
File "Web2ExeWin\files\compressors\upx-win.exe"

; Shortcuts
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
CreateDirectory "$SMPROGRAMS\$ICONS_GROUP"
Expand Down
9 changes: 9 additions & 0 deletions command_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ def get_file(path):
independent_path = utils.path_join(CWD, *parts)
return independent_path

def is_installed():
uninst = get_file('uninst.exe')
return utils.is_windows() and os.path.exists(uninst)

__version__ = "v0.0.0"

with open(get_file('files/version.txt')) as f:
Expand Down Expand Up @@ -842,6 +846,7 @@ def compress_nw(self, nw_path):
compression = self.get_setting('nw_compression_level')
if compression.value == 0:
return

comp_dict = {'Darwin64bit': get_file('files/compressors/upx-mac'),
'Darwin32bit': get_file('files/compressors/upx-mac'),
'Linux64bit': get_file('files/compressors/upx-linux-x64'),
Expand All @@ -850,6 +855,10 @@ def compress_nw(self, nw_path):
'Windows32bit': get_file('files/compressors/upx-win.exe')
}

if is_installed():
comp_dict['Windows64bit'] = get_data_file_path('files/compressors/upx-win.exe')
comp_dict['Windows32bit'] = get_data_file_path('files/compressors/upx-win.exe')

plat = platform.system()+platform.architecture()[0]
upx_version = comp_dict.get(plat, None)

Expand Down

0 comments on commit 270642f

Please sign in to comment.