diff --git a/.gitignore b/.gitignore index c81b8776..83b50794 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ -.pyc -.pyo +*.pyc +*.pyo .exe .settings .spyderproject @@ -19,3 +19,5 @@ MANIFEST Thumbs.db *~ *.swp +.gitignore +basedir*/ diff --git a/make.py b/make.py index 92009a99..4c5fd7d2 100644 --- a/make.py +++ b/make.py @@ -39,7 +39,7 @@ def get_nsis_exe(): """Return NSIS executable""" localdir = osp.join(sys.prefix, os.pardir, os.pardir) for drive in get_drives(): - for dirname in (r'C:\Program Files', r'C:\Program Files (x86)', + for dirname in (r'C:\Program Files', r'C:\Program Files (x86)',r'C:\Users\user\Desktop\NSISPortable', drive+r'PortableApps\NSISPortableANSI', drive+r'PortableApps\NSISPortable', osp.join(localdir, 'NSISPortableANSI'), @@ -517,26 +517,26 @@ def _copy_dev_docs(self): def _create_launchers(self): """Create launchers""" self._print("Creating launchers") - self.create_launcher('WinPython Command Prompt.exe', 'cmd.ico', + self.create_launcher('Python{0}Portable.exe'.format(self.python_version), 'cmd.ico', command='$SYSDIR\cmd.exe', args='/k', workdir='${WINPYDIR}') - self.create_launcher('WinPython Interpreter.exe', 'python.ico') - self.create_launcher('IDLE (Python GUI).exe', 'python.ico', + self.create_launcher('Python{0}InterpreterPortable.exe'.format(self.python_version), 'python.ico') + self.create_launcher('IDLE{0}Portable.exe'.format(self.python_version), 'python.ico', args='idle.pyw', workdir='${WINPYDIR}\Lib\idlelib') settingspath = osp.join('.spyder2', '.spyder.ini') - self.create_launcher('Spyder.exe', 'spyder.ico', + self.create_launcher('Spyder{0}Portable.exe'.format(self.python_version), 'spyder.ico', command='${WINPYDIR}\python.exe', args='-m spyderlib.start_app', workdir='${WINPYDIR}\Scripts', settingspath=settingspath) - self.create_launcher('Spyder (light).exe', 'spyder_light.ico', + self.create_launcher('SpyderLight{0}Portable.exe'.format(self.python_version), 'spyder_light.ico', command='${WINPYDIR}\python.exe', args='-m spyderlib.start_app --light', workdir='${WINPYDIR}\Scripts', settingspath=settingspath) - self.create_launcher('WinPython Control Panel.exe', 'winpython.ico', + self.create_launcher('Python{0}ControlPanelPortable.exe'.format(self.python_version), 'winpython.ico', command='${WINPYDIR}\pythonw.exe', args='-m winpython.controlpanel', workdir='${WINPYDIR}\Scripts') @@ -548,7 +548,7 @@ def _create_launchers(self): Qt4_dir = r'${WINPYDIR}\Lib\site-packages\PyQt4' Qt5_dir = r'${WINPYDIR}\Lib\site-packages\PyQt5' - self.create_launcher('Qt Demo.exe', 'qt.ico', + self.create_launcher('QtDemo{0}Portable.exe'.format(self.python_version), 'qt.ico', command=r'${WINPYDIR}\pythonw.exe', args='qtdemo.pyw', workdir=Qt4_dir+r'\examples\%s' % r'demos\qtdemo', @@ -556,49 +556,49 @@ def _create_launchers(self): betterargs='qtdemo.py', betterworkdir=Qt5_dir+r'\examples\%s' % r'qtdemo') - self.create_launcher('Qt Assistant.exe', 'qtassistant.ico', + self.create_launcher('QtAssistant{0}Portable.exe'.format(self.python_version), 'qtassistant.ico', command=Qt4_dir + r'\assistant.exe', workdir=r'${WINPYDIR}', bettercommand=Qt5_dir + r'\assistant.exe') - self.create_launcher('Qt Designer.exe', 'qtdesigner.ico', + self.create_launcher('QtDesigner{0}Portable.exe'.format(self.python_version), 'qtdesigner.ico', command=Qt4_dir + r'\designer.exe', workdir=r'${WINPYDIR}', bettercommand=Qt5_dir + r'\designer.exe') - self.create_launcher('Qt Linguist.exe', 'qtlinguist.ico', + self.create_launcher('QtLinguist{0}Portable.exe'.format(self.python_version), 'qtlinguist.ico', command=(Qt4_dir + r'\linguist.exe'), workdir=r'${WINPYDIR}', bettercommand=Qt5_dir + r'\linguist.exe') # Jupyter launchers - if osp.isfile(osp.join(self.python_dir, 'Scripts', 'jupyter.exe')): - self.create_launcher('IPython Qt Console.exe', 'ipython.ico', - command='${WINPYDIR}\Scripts\%s' % - 'jupyter-qtconsole.exe', - workdir=r'${WINPYDIR}\..\notebooks') + #if osp.isfile(osp.join(self.python_dir, 'Scripts', 'jupyter.exe')): + self.create_launcher('IPython{0}QtConsolePortable.exe'.format(self.python_version), 'ipython.ico', + command='${WINPYDIR}\Scripts\%s' % + 'jupyter-qtconsole.exe', + workdir=r'${WINPYDIR}\..\notebooks') - self.create_launcher('Jupyter Notebook.exe', 'jupyter.ico', - command='${WINPYDIR}\Scripts\%s' % - 'jupyter-notebook.exe', - workdir=r'${WINPYDIR}\..\notebooks') + self.create_launcher('Jupyter{0}NotebookPortable.exe'.format(self.python_version), 'jupyter.ico', + command='${WINPYDIR}\Scripts\%s' % + 'jupyter-notebook.exe', + workdir=r'${WINPYDIR}\..\notebooks') # R console launchers r_exe = self.R_PATH + r"\i386\R.exe" - if osp.isfile(self.winpydir + r_exe): - self.create_launcher('R Console32.exe', 'r.ico', - command='${WINPYDIR}\..' + r_exe, - workdir=r'${WINPYDIR}\..\notebooks') + #if osp.isfile(self.winpydir + r_exe): + self.create_launcher('R{0}Console32Portable.exe'.format(self.python_version), 'r.ico', + command='${WINPYDIR}\..' + r_exe, + workdir=r'${WINPYDIR}\..\notebooks') r_exe = self.R_PATH + r"\x64\R.exe" - if osp.isfile(self.winpydir + r_exe): - self.create_launcher('R Console64.exe', 'r.ico', - command='${WINPYDIR}\..' + r_exe, - workdir=r'${WINPYDIR}\..\notebooks') + #if osp.isfile(self.winpydir + r_exe): + self.create_launcher('R{0}Console64Portable.exe'.format(self.python_version), 'r.ico', + command='${WINPYDIR}\..' + r_exe, + workdir=r'${WINPYDIR}\..\notebooks') # Julia console launcher julia_exe = self.JULIA_PATH + r"\julia.exe" - if osp.isfile(self.winpydir + julia_exe): - self.create_launcher('Julia Console.exe', 'julia.ico', - command='${WINPYDIR}\..'+ julia_exe, - workdir=r'${WINPYDIR}\..\notebooks') + #if osp.isfile(self.winpydir + julia_exe): + self.create_launcher('Julia{0}ConsolePortable.exe'.format(self.python_version), 'julia.ico', + command='${WINPYDIR}\..'+ julia_exe, + workdir=r'${WINPYDIR}\..\notebooks') self._print_done() @@ -768,8 +768,9 @@ def make(self, remove_existing=True, requirements=None): #, find_links=None): if self.simulation: print("WARNING: this is just a simulation!", file=sys.stderr) - self.python_fname = self.get_package_fname( - r'python-([0-9\.rc]*)((\.|\-)amd64)?\.(msi|zip)') + #self.python_fname = self.get_package_fname( + # r'python-([0-9\.rc]*)((\.|\-)amd64)?\.(msi|zip)') + self.python_fname = 'python-3.5.0.msi' self.python_name = osp.basename(self.python_fname)[:-4] distname = 'win%s' % self.python_name vlst = re.match(r'winpython-([0-9\.]*)', distname @@ -793,7 +794,19 @@ def make(self, remove_existing=True, requirements=None): #, find_links=None): # is creating the directory automatically) os.mkdir(osp.join(self.winpydir, 'settings')) self._print_done() - + + self.python_name='python' + self.python_version='3.4' + self.python_fullversion='3.4.3' + self.distribution=wppm.BasePackage('32') + self.distribution.architecture=32 + self._create_batch_scripts_initial() + self._create_batch_scripts() # which set mingwpy as compiler + #self._run_complement_batch_scripts("run_required_first.bat") + self._create_launchers() + print('done') + exit() + if remove_existing and not self.simulation: self._extract_python() self.distribution = wppm.Distribution(self.python_dir, @@ -1005,7 +1018,7 @@ def make_all(build_number, release_level, pyver, install_options = install_options.split() print('install_options', install_options) basedir = utils.get_basedir(pyver, rootdir=rootdir) - rebuild_winpython(basedir=basedir, archis=archis) + #rebuild_winpython(basedir=basedir, archis=archis) for architecture in archis: make_winpython(build_number, release_level, architecture, basedir, verbose, remove_existing, create_installer, simulation, @@ -1025,12 +1038,12 @@ def make_all(build_number, release_level, pyver, # install_options=r'--no-index --pre --trusted-host=None', # find_links=r'D:\Winpython\basedir34\packages.srcreq') - make_all(1, release_level='build3', pyver='3.5', rootdir=r'D:\Winpython', verbose=True, - archis=(64, ), flavor='Slim', + make_all(99, release_level='', pyver='3.5', rootdir=r'D:\Winpython', verbose=True, + archis=(32, ), flavor='Portable', requirements=r'D:\Winpython\basedir35\slim_requirements.txt', install_options=r'--no-index --pre --trusted-host=None', find_links=r'D:\Winpython\basedir34\packages.srcreq', source_dirs=r'D:\WinPython\basedir34\packages.src D:\WinPython\basedir35\packages.win-amd64', toolsdirs=r'D:\WinPython\basedir34\Tools.Slim', - docsdirs=r'D:\WinPython\basedir34\docs.Slim' -) + docsdirs=r'D:\WinPython\basedir34\docs.Slim') + diff --git a/portable/installer.nsi b/portable/installer.nsi index 6e5e7764..4e26f616 100644 --- a/portable/installer.nsi +++ b/portable/installer.nsi @@ -74,7 +74,7 @@ SectionEnd ;------------------------------------------------------------------------------ Function .onInit ; Check if an instance of this installer is already running - System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${ID}") i .r1 ?e' + System::Call 'kernel32::CreateMutex(i 0, i 0, t "${ID}") i .r1 ?e' Pop $R0 StrCmp $R0 0 +3 MessageBox MB_OK|MB_ICONEXCLAMATION "Installer is already running." diff --git a/portable/launcher.nsi b/portable/launcher.nsi index 8eacaf90..b95b379a 100644 --- a/portable/launcher.nsi +++ b/portable/launcher.nsi @@ -92,14 +92,14 @@ workdir: SetOutPath "${WORKDIR}" end_workdir: -System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("WINPYDIR", "${WINPYDIR}").r0' -System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("WINPYVER", "${WINPYVER}").r0' +System::Call 'Kernel32::SetEnvironmentVariable(t, t) i("WINPYDIR", "${WINPYDIR}").r0' +System::Call 'Kernel32::SetEnvironmentVariable(t, t) i("WINPYVER", "${WINPYVER}").r0' ; Addition of R_HOME Environment Variable if %R_Home%\bin exists StrCmp "${R_HOME}" "" end_Rsettings IfFileExists "${R_HOME}\bin\*.*" 0 end_Rsettings -System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("R_HOME", "${R_HOME}").r0' +System::Call 'Kernel32::SetEnvironmentVariable(t, t) i("R_HOME", "${R_HOME}").r0' end_Rsettings: @@ -107,36 +107,36 @@ end_Rsettings: StrCmp "${JULIA}" "" end_Julia_settings IfFileExists "${JULIA}" 0 end_Julia_settings -System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("JULIA", "${JULIA}").r0' +System::Call 'Kernel32::SetEnvironmentVariable(t, t) i("JULIA", "${JULIA}").r0' StrCmp "${JULIA_HOME}" "" end_Julia_settings IfFileExists "${JULIA_HOME}\*.*" 0 end_Julia_settings -System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("JULIA_HOME", "${JULIA_HOME}").r0' +System::Call 'Kernel32::SetEnvironmentVariable(t, t) i("JULIA_HOME", "${JULIA_HOME}").r0' ; Addition for JULIA_PKGDIR StrCmp "${JULIA_PKGDIR}" "" end_Julia_settings IfFileExists "${JULIA_PKGDIR}\*.*" 0 end_Julia_settings -System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("JULIA_PKGDIR", "${JULIA_PKGDIR}").r0' +System::Call 'Kernel32::SetEnvironmentVariable(t, t) i("JULIA_PKGDIR", "${JULIA_PKGDIR}").r0' end_Julia_settings: ; Addition for QT_API=pyqt5 if Qt5 detected IfFileExists "${WINPYDIR}\Lib\site-packages\PyQt5\*.*" 0 end_QT_API_settings -System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("QT_API", "pyqt5").r0' +System::Call 'Kernel32::SetEnvironmentVariable(t, t) i("QT_API", "pyqt5").r0' end_QT_API_settings: ; jupyter StrCmp "${JUPYTER_DATA_DIR}" "" end_jupyter_data_setting -System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("JUPYTER_DATA_DIR", "${JUPYTER_DATA_DIR}").r0' +System::Call 'Kernel32::SetEnvironmentVariable(t, t) i("JUPYTER_DATA_DIR", "${JUPYTER_DATA_DIR}").r0' end_jupyter_data_setting: ;================================================================ ; Settings directory IfFileExists "$EXEDIR\settings\*.*" 0 end_settings -System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("HOME", "$EXEDIR\settings").r0' +System::Call 'Kernel32::SetEnvironmentVariable(t, t) i("HOME", "$EXEDIR\settings").r0' StrCmp "${SETTINGSDIR}" "" end_settings CreateDirectory "$EXEDIR\settings\${SETTINGSDIR}" ; Handle portability in Spyder's settings @@ -180,7 +180,7 @@ ReadINIStr $R7 $R6 "debug" "state" StrCmp $R7 "" no_debug StrCmp $R7 "disabled" no_debug StrCpy $R7 "enabled" -System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("WINPYDEBUG", "True").r0' +System::Call 'Kernel32::SetEnvironmentVariable(t, t) i("WINPYDEBUG", "True").r0' no_debug: @@ -198,7 +198,7 @@ envvar_loop: ${StrFilter} $1 "+" "" " " $1 ; Upper case + remove trailing spaces StrCmp $1 "PATH" found_path - System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("$1", "$2").r0' + System::Call 'Kernel32::SetEnvironmentVariable(t, t) i("$1", "$2").r0' Goto end_found_path found_path: @@ -212,7 +212,7 @@ envvar_loop: envvar_done: StrCpy $R0 "${PREPATH};$R0;${POSTPATH}" -System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("PATH", R0).r0' +System::Call 'Kernel32::SetEnvironmentVariable(t, t) i("PATH", R0).r0' ;================================================================