Skip to content

Commit 270642f

Browse files
committed
Fixed compression not working in Windows 10.
1 parent d7beb8d commit 270642f

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

Web2Exe.nsi

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,12 @@ Section "Web2Executable" SEC01
7878
SectionIn RO
7979
SetOutPath "$INSTDIR"
8080
SetOverwrite try
81-
File /r "Web2ExeWin\"
81+
File /r /x compressors "Web2ExeWin\"
8282

83+
CreateDirectory "$LocalAppData\Web2Executable\Web2Executable\files\compressors"
84+
SetOutPath "$LocalAppData\Web2Executable\Web2Executable\files\compressors"
85+
File "Web2ExeWin\files\compressors\upx-win.exe"
86+
8387
; Shortcuts
8488
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
8589
CreateDirectory "$SMPROGRAMS\$ICONS_GROUP"

command_line.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ def get_file(path):
6565
independent_path = utils.path_join(CWD, *parts)
6666
return independent_path
6767

68+
def is_installed():
69+
uninst = get_file('uninst.exe')
70+
return utils.is_windows() and os.path.exists(uninst)
71+
6872
__version__ = "v0.0.0"
6973

7074
with open(get_file('files/version.txt')) as f:
@@ -842,6 +846,7 @@ def compress_nw(self, nw_path):
842846
compression = self.get_setting('nw_compression_level')
843847
if compression.value == 0:
844848
return
849+
845850
comp_dict = {'Darwin64bit': get_file('files/compressors/upx-mac'),
846851
'Darwin32bit': get_file('files/compressors/upx-mac'),
847852
'Linux64bit': get_file('files/compressors/upx-linux-x64'),
@@ -850,6 +855,10 @@ def compress_nw(self, nw_path):
850855
'Windows32bit': get_file('files/compressors/upx-win.exe')
851856
}
852857

858+
if is_installed():
859+
comp_dict['Windows64bit'] = get_data_file_path('files/compressors/upx-win.exe')
860+
comp_dict['Windows32bit'] = get_data_file_path('files/compressors/upx-win.exe')
861+
853862
plat = platform.system()+platform.architecture()[0]
854863
upx_version = comp_dict.get(plat, None)
855864

0 commit comments

Comments
 (0)