Skip to content

Commit 859f93d

Browse files
committed
Added exe launcher for DataLab
1 parent 0ed38f4 commit 859f93d

File tree

7 files changed

+80
-57
lines changed

7 files changed

+80
-57
lines changed

.vscode/tasks.json

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -25,33 +25,6 @@
2525
"clear": false
2626
}
2727
},
28-
{
29-
"label": "Distribute source",
30-
"type": "shell",
31-
"command": "cmd",
32-
"args": [
33-
"/c",
34-
"dist.bat"
35-
],
36-
"options": {
37-
"cwd": "scripts",
38-
"env": {
39-
"UNATTENDED": "1",
40-
}
41-
},
42-
"group": {
43-
"kind": "build",
44-
"isDefault": true
45-
},
46-
"presentation": {
47-
"echo": true,
48-
"reveal": "always",
49-
"focus": false,
50-
"panel": "shared",
51-
"showReuseMessage": true,
52-
"clear": false
53-
}
54-
},
5528
{
5629
"label": "Clean up",
5730
"type": "shell",
@@ -144,11 +117,15 @@
144117
},
145118
{
146119
"label": "Build all",
120+
"group": {
121+
"kind": "build",
122+
"isDefault": true
123+
},
147124
"dependsOrder": "sequence",
148125
"dependsOn": [
149126
"Clean up",
150127
"Create distribution",
151-
"Create installer"
128+
"Create installer",
152129
]
153130
}
154131
]

executables/DataLab.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
@echo off
2-
call "%~dp0scripts\env_for_icons.bat" %*
2+
call "%~dp0env_for_icons.bat" %*
33
cd/D "%WINPYWORKDIR1%"
44
"%WINPYDIR%\python.exe" -m cdl.app %*

nsis/installer.nsi

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/*
22
3+
DataLab-WinPython installer script
4+
----------------------------------
5+
36
Licensed under the terms of the BSD 3-Clause
47
(see ../LICENSE for details)
58
@@ -56,7 +59,7 @@ RequestExecutionLevel user
5659
!define MUI_FINISHPAGE_LINK "$(explore_str)"
5760
!define MUI_FINISHPAGE_LINK_LOCATION "$INSTDIR"
5861
!define MUI_FINISHPAGE_RUN
59-
!define MUI_FINISHPAGE_RUN_TEXT "$(wpcp_str)"
62+
!define MUI_FINISHPAGE_RUN_TEXT "$(datalab_str)"
6063
!define MUI_FINISHPAGE_RUN_FUNCTION "LaunchLink"
6164
!insertmacro MUI_PAGE_FINISH
6265
!insertmacro MUI_UNPAGE_WELCOME
@@ -67,10 +70,12 @@ RequestExecutionLevel user
6770
!insertmacro MUI_LANGUAGE "French"
6871
LangString welcome_str ${LANG_ENGLISH} "This will install ${PRODNAME} on your computer.$\r$\n${PRODNAME} deploys itself as a simple folder unzipping to a custom target directory. Installing this software has thus limited effect on the operating system and will not compromise any existing Python installation.$\r$\n$\r$\nPlease click on Next to continue."
6972
LangString welcome_str ${LANG_FRENCH} "Vous êtes sur le point d'installer ${PRODNAME} sur votre ordinateur.$\r$\n${PRODNAME} s'installe par une simple copie de fichiers dans un répertoire de destination paramétrable. L'installation n'est pas invasive et peut cohabiter (sans effet de bord) avec n'importe quelle autre distribution Python déjà installée sur cet ordinateur.$\r$\n$\r$\nCliquez sur Suivant pour continuer."
70-
LangString explore_str ${LANG_ENGLISH} "Browse target directory"
73+
LangString explore_str ${LANG_ENGLISH} "Browse installation directory"
7174
LangString explore_str ${LANG_FRENCH} "Explorer le dossier d'installation"
72-
LangString wpcp_str ${LANG_ENGLISH} "Open WinPython control panel"
73-
LangString wpcp_str ${LANG_FRENCH} "Démarrer le panneau de contrôle WinPython"
75+
LangString uninstall_str ${LANG_ENGLISH} "Uninstall ${PRODNAME}"
76+
LangString uninstall_str ${LANG_FRENCH} "Désinstaller ${PRODNAME}"
77+
LangString datalab_str ${LANG_ENGLISH} "Run DataLab"
78+
LangString datalab_str ${LANG_FRENCH} "Lancer DataLab"
7479
LangString busy_str ${LANG_ENGLISH} "Installer is already running"
7580
LangString busy_str ${LANG_FRENCH} "L'installeur est déjà en cours d'ex�cution"
7681
LangString uninst_str ${LANG_ENGLISH} "Permanantly remove ${PRODNAME}?"
@@ -110,8 +115,8 @@ Section "" SecWinPython
110115
${locate::Close} $0
111116
${locate::Unload}
112117

113-
createShortCut "$SMPROGRAMS\${PRODNAME}\Dossier d'installation.lnk" "$INSTDIR\"
114-
; createShortCut "$SMPROGRAMS\${PRODNAME}\Désinstaller.lnk" "$INSTDIR\uninstaller.exe"
118+
createShortCut "$SMPROGRAMS\${PRODNAME}\$(explore_str).lnk" "$INSTDIR\"
119+
createShortCut "$SMPROGRAMS\${PRODNAME}\$(uninstall_str).lnk" "$INSTDIR\uninstaller.exe"
115120
WriteRegStr HKCU "${UINSTREG}" "DisplayName" "${PRODNAME}"
116121
WriteRegStr HKCU "${UINSTREG}" "DisplayVersion" "${VERSIONPROD}"
117122
WriteRegStr HKCU "${UINSTREG}" "Publisher" "${PUBLISHER}"
@@ -150,7 +155,7 @@ Function .onInit
150155
${EndIf}
151156
FunctionEnd
152157
Function LaunchLink
153-
ExecShell "" "$INSTDIR\WinPython Control Panel.exe"
158+
ExecShell "" "$INSTDIR\DataLab.exe"
154159
FunctionEnd
155160

156161
; Descriptions

nsis/launcher.nsi

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
3+
DataLab-WinPython launcher script
4+
---------------------------------
5+
6+
Licensed under the terms of the BSD 3-Clause
7+
(see ../LICENSE for details)
8+
9+
*/
10+
11+
; !addincludedir "%NSIS_INCLUDEDIR%"
12+
!define COMMAND "$%NSIS_COMMAND%"
13+
!define PARAMETERS "$%NSIS_PARAMS%"
14+
!define WORKDIR "$%NSIS_WORKDIR%"
15+
!define FILENAME "$%NSIS_OUTFILE%"
16+
Icon "$%NSIS_ICON%"
17+
OutFile $%NSIS_OUTFILE%
18+
19+
!include "WordFunc.nsh"
20+
!include "FileFunc.nsh"
21+
22+
Unicode true
23+
SilentInstall silent
24+
AutoCloseWindow true
25+
ShowInstDetails nevershow
26+
RequestExecutionLevel user
27+
28+
Section ""
29+
Call Execute
30+
SectionEnd
31+
32+
Function Execute
33+
StrCmp ${WORKDIR} "" 0 workdir
34+
System::Call "kernel32::GetCurrentDirectory(i ${NSIS_MAX_STRLEN}, t .r0)"
35+
SetOutPath $0
36+
Goto end_workdir
37+
workdir:
38+
SetOutPath "${WORKDIR}"
39+
end_workdir:
40+
${GetParameters} $R1
41+
StrCmp "${PARAMETERS}" "" end_param 0
42+
StrCpy $R1 "${PARAMETERS} $R1"
43+
end_param:
44+
Exec '"${COMMAND}" $R1'
45+
FunctionEnd

scripts/build_distribution.bat

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,27 @@ del Pyzo.exe
2020
del Qt*.exe
2121
del Spyder*.exe
2222
del VS*.exe
23+
del IDLE*.exe
2324
del "WinPython Powershell Prompt.exe"
2425
rmdir /S /Q notebooks
2526
rmdir /S /Q t
2627
cd %ROOTPATH%
28+
@REM Install packages
2729
pip install --no-cache-dir --no-index --find-links=packages -r requirements.txt
2830

31+
@REM Create additional launchers
32+
@REM ===========================================================================
33+
@REM Iterate over all .bat files in "executables" folder:
34+
set NSIS_WORKDIR=$EXEDIR\scripts
35+
set NSIS_COMMAND=wscript.exe
36+
for %%f in (executables\*.bat) do (
37+
@REM Copy each .bat file to the "scripts" folder:
38+
copy "executables\%%~nxf" "%ROOTPATH%\%CI_WNM%\scripts"
39+
@REM Set NSIS_ICON, NSIS_OUTFILE and NSIS_PARAMS for each .bat file:
40+
set NSIS_ICON=%ROOTPATH%\executables\%%~nf.ico
41+
set NSIS_OUTFILE=%ROOTPATH%\%CI_WNM%\%%~nf.exe
42+
set NSIS_PARAMS=Noshell.vbs %%~nxf
43+
"C:\Program Files (x86)\NSIS\makensis.exe" nsis\launcher.nsi
44+
)
45+
2946
call %FUNC% EndOfScript

scripts/build_installer.bat

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ ren %CI_WNM% %CI_DST%
1313

1414
@REM Build installer
1515
@REM ===========================================================================
16-
copy "executables\*.ico" "%CI_DST%\scripts"
17-
copy "executables\*.bat" "%CI_DST%"
1816
set NSIS_DIST_PATH=%ROOTPATH%%CI_DST%
1917
set NSIS_PRODUCT_NAME=%CI_DST%
2018
set NSIS_PRODUCT_ID=%CI_DST%

scripts/dist.bat

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)