Skip to content

Commit

Permalink
Push to 38 characters. Fix check length path.
Browse files Browse the repository at this point in the history
  • Loading branch information
ericpre committed Oct 25, 2018
1 parent 3f9d55b commit 89b4dc8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
17 changes: 12 additions & 5 deletions hspy_bundle/NSIS_installer_script.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
!include "nsDialogs.nsh"
!include "StrFunc.nsh"
!include "LogicLib.nsh"
!include "WinVer.nsh"
!include "FileFunc.nsh"
!include "X64.nsh"
!include "__DELETE_MACRO_NAME__.nsh"
Expand Down Expand Up @@ -97,12 +98,14 @@ RequestExecutionLevel user
Page custom InstModeSelectionPage_Create InstModeSelectionPage_Leave
!define MUI_PAGE_CUSTOMFUNCTION_PRE disableBack
!define MUI_DIRECTORYPAGE_TEXT_TOP "${APPNAME} ${APPVERSION} will be installed in the following folder. To install to a different folder, click Browse and select another folder."
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE checkLengthPath
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH

; ------- UAC functions -------------------------------------------------------
Var InstMode ;0=current, 1=portable, 2=all users,
Var InstDirLen

Function InstModeChanged
${If} $InstMode = 0 ; Current user
Expand Down Expand Up @@ -152,6 +155,15 @@ Function disableBack
${EndIf}
FunctionEnd

Function checkLengthPath
StrLen $InstDirLen "${APP_INSTDIR}"
${IfNot} ${AtLeastWin8}
${AndIf} $InstDirLen > 38
MessageBox MB_OK|MB_ICONSTOP "On Windows 7 and older, the installation path should be shorter than 38 characters."
Abort
${EndIf}
FunctionEnd

Function RemoveNextBtnShield
GetDlgItem $0 $hwndParent 1
SendMessage $0 ${BCM_SETSHIELD} 0 0
Expand Down Expand Up @@ -210,11 +222,6 @@ Function InstModeSelectionPage_Leave
${NSD_GetState} $0 $9
${NSD_GetState} $1 $8

StrLen $INSTDIRLEN $INSTDIR
${If} $INSTDIRLEN > 35 ${AndIfNot} ${AtLeastWin8}
MessageBox MB_OK "Installation path should be shorter than 35 characters."
${EndIf}

${If} $8 = 1
!insertmacro SetInstMode 1
${ElseIf} $9 = 1
Expand Down
9 changes: 6 additions & 3 deletions hspy_bundle/configure_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,12 @@ def __init__(self, dist_path, version, arch=("32", "64")):
if not isinstance(arch, (list, tuple)):
arch = (arch,)
self.arch = arch
self.wppath = dict((
(a, glob(os.path.join(dist_path, "WinPython-%s*" % a))[0])
for a in arch))
try:
self.wppath = dict((
(a, glob(os.path.join(dist_path, "WinPython-%s*" % a))[0])
for a in arch))
except IndexError:
raise RuntimeError("No Winpython distribution can be found.")
self.distributions = dict((
(a, winpython.wppm.Distribution(
self.get_full_paths("python-*", a)))
Expand Down

0 comments on commit 89b4dc8

Please sign in to comment.