Skip to content

Commit

Permalink
post rc1fix
Browse files Browse the repository at this point in the history
  • Loading branch information
stonebig committed Jan 3, 2025
1 parent 22964b3 commit 9bfb105
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 8 deletions.
44 changes: 44 additions & 0 deletions portable/launcher_basic.nsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/* WinPython launcher template script
Copyright © 2012 Pierre Raybaut
Licensed under the terms of the MIT License
(see winpython/__init__.py for details)
*/
;================================================================
; These lines are automatically filled when winpython/make.py creates launchers:
!addincludedir ""
!define COMMAND ""
!define PARAMETERS ""
!define WORKDIR ""
Icon ""
OutFile ""
;================================================================
# Standard NSIS plugins
!include "WordFunc.nsh"
!include "FileFunc.nsh"

SilentInstall silent
AutoCloseWindow true
ShowInstDetails nevershow
RequestExecutionLevel user

Section ""
Call Execute
SectionEnd

Function Execute
;Set working Directory ===========================
StrCmp ${WORKDIR} "" 0 workdir
System::Call "kernel32::GetCurrentDirectory(i ${NSIS_MAX_STRLEN}, t .r0)"
SetOutPath $0
Goto end_workdir
workdir:
SetOutPath "${WORKDIR}"
end_workdir:
;Get Command line parameters =====================
${GetParameters} $R1
StrCmp "${PARAMETERS}" "" end_param 0
StrCpy $R1 "${PARAMETERS} $R1"
end_param:
;===== Execution =================================
Exec '"${COMMAND}" $R1'
FunctionEnd
2 changes: 1 addition & 1 deletion winpython/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
OTHER DEALINGS IN THE SOFTWARE.
"""

__version__ = '11.2.20241226'
__version__ = '11.2.20241228'
__license__ = __doc__
__project_url__ = 'http://winpython.github.io/'
14 changes: 7 additions & 7 deletions winpython/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def exec_run_cmd(args, path=None):
def get_r_version(path):
"""Return version of the R installed in *path*"""
return (
exec_shell_cmd('dir ..\README.R*', path)
exec_shell_cmd(r'dir ..\README.R*', path)
.splitlines()[-3]
.split("-")[-1]
)
Expand Down Expand Up @@ -373,11 +373,11 @@ def patch_shebang_line(
) # Python2.7
else:
shebang_line = re.compile(
b"(#!.*pythonw?\.exe)\"?"
rb"(#!.*pythonw?\.exe)\"?"
) # Python3+
if 'pypy3' in sys.executable:
shebang_line = re.compile(
b"(#!.*pypy3w?\.exe)\"?"
rb"(#!.*pypy3w?\.exe)\"?"
) # Pypy3+

target_dir = target_dir.encode('utf-8')
Expand Down Expand Up @@ -420,15 +420,15 @@ def patch_shebang_line_py(
# WinPython doesn't break running executable files.
return
if to_movable:
exec_path = '#!.\python.exe'
exec_path = r'#!.\python.exe'
if 'pypy3' in sys.executable: # PyPy !
exec_path = '#!.\pypy3.exe'
exec_path = r'#!.\pypy3.exe'
else:
exec_path = '#!' + sys.executable
for line in fileinput.input(fname, inplace=True):
if re.match('^#\!.*python\.exe$', line) is not None:
if re.match(r'^#\!.*python\.exe$', line) is not None:
print(exec_path)
elif re.match('^#\!.*pypy3\.exe$', line) is not None:# PyPy !
elif re.match(r'^#\!.*pypy3\.exe$', line) is not None:# PyPy !
print(exec_path)
else:
print(line, end='')
Expand Down

0 comments on commit 9bfb105

Please sign in to comment.