author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Mon, 24 Sep 2018 20:52:34 +0100 | |
branch | jv |
changeset 1579 | e6c2667b4692 |
parent 1563 | c29b69fe8082 |
child 1586 | e174b1111c7c |
permissions | -rwxr-xr-x |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1 |
@ECHO OFF |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
2 |
|
1537
c9aea063a34e
Issue: #172 StX fails to start on Windows when launcher script is run from different directory
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1527
diff
changeset
|
3 |
:: _____ _ _ _ _ _ ____ __ |
c9aea063a34e
Issue: #172 StX fails to start on Windows when launcher script is run from different directory
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1527
diff
changeset
|
4 |
:: / ___| | | | | | | | / /\ \ / / |
c9aea063a34e
Issue: #172 StX fails to start on Windows when launcher script is run from different directory
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1527
diff
changeset
|
5 |
:: \ `--. _ __ ___ __ _| | | |_ __ _| | | __ / / \ V / |
c9aea063a34e
Issue: #172 StX fails to start on Windows when launcher script is run from different directory
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1527
diff
changeset
|
6 |
:: `--. \ '_ ` _ \ / _` | | | __/ _` | | |/ / / / / \ |
c9aea063a34e
Issue: #172 StX fails to start on Windows when launcher script is run from different directory
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1527
diff
changeset
|
7 |
:: /\__/ / | | | | | (_| | | | || (_| | | < / / / /^\ \ |
c9aea063a34e
Issue: #172 StX fails to start on Windows when launcher script is run from different directory
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1527
diff
changeset
|
8 |
:: \____/|_| |_| |_|\__,_|_|_|\__\__,_|_|_|\_\/_/ \/ \/ |
c9aea063a34e
Issue: #172 StX fails to start on Windows when launcher script is run from different directory
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1527
diff
changeset
|
9 |
:: |
c9aea063a34e
Issue: #172 StX fails to start on Windows when launcher script is run from different directory
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1527
diff
changeset
|
10 |
:: _ _ _ _ _ |
c9aea063a34e
Issue: #172 StX fails to start on Windows when launcher script is run from different directory
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1527
diff
changeset
|
11 |
:: | | | (_) | | | | |
c9aea063a34e
Issue: #172 StX fails to start on Windows when launcher script is run from different directory
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1527
diff
changeset
|
12 |
:: | | | |_ _ __ ______ | | __ _ _ _ _ __ ___| |__ ___ _ __ |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
13 |
:: | |/\| | | '_ \ |______| | | / _` | | | | '_ \ / __| '_ \ / _ \ '__| |
1537
c9aea063a34e
Issue: #172 StX fails to start on Windows when launcher script is run from different directory
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1527
diff
changeset
|
14 |
:: \ /\ / | | | | | |___| (_| | |_| | | | | (__| | | | __/ | |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
15 |
:: \/ \/|_|_| |_| \_____/\__,_|\__,_|_| |_|\___|_| |_|\___|_| |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
16 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
17 |
:: ================================== |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
18 |
:: The startup script for smalltalk = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
19 |
:: ================================== |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
20 |
:: This script is vastly improved previous smalltalk.bat. |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
21 |
:: In previous versions, smalltalk used to be the executable itself. |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
22 |
:: This lead to problems on systems, where things like the PATH or STX_LIBDIR should be set in advance. |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
23 |
:: Now, here is a place to do such things ... |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
24 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
25 |
:: ========== |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
26 |
:: Contents = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
27 |
:: ========== |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
28 |
:: Every section is separated by these words: Next section follows = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
29 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
30 |
:: 1 - Versions; batch files switches; setting on ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
31 |
:: 2 - Configuration |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
32 |
:: 3 - PowerShell detection |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
33 |
:: 4 - Timer section |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
34 |
:: 5 - Adjusting according to the configuration |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
35 |
:: 6 - Checking variable and logic consistency |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
36 |
:: 7 - Verify existence of paths and files from configuration |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
37 |
:: 8 - A work-flow based on the configuration |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
38 |
:: 9 - Running the command |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
39 |
:: 10 - User defined functions |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
40 |
:: 11 - Support information (like help, about, version) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
41 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
42 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
43 |
:: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
1537
c9aea063a34e
Issue: #172 StX fails to start on Windows when launcher script is run from different directory
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1527
diff
changeset
|
44 |
:: Next section follows |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
45 |
:: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
46 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
47 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
48 |
:: ******************************************************************************************* |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
49 |
:: Beginning * |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
50 |
:: ******************************************************************************************* |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
51 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
52 |
:: ========== |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
53 |
:: Versions = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
54 |
:: ========== |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
55 |
:: This script |
1554
43b993b853cf
Win32 launcher (v 1.6.8): powershell comments cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1553
diff
changeset
|
56 |
SET "batch_script_version=1.6.8" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
57 |
:: Smalltalk/X |
1563
c29b69fe8082
Set `STX_VERSION_DEFAULT` in launcher scripts to 8.0.0
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1554
diff
changeset
|
58 |
SET "stx_version_default=8.0.0" |
1539
f31be43f0fa7
Win32 launcher (v 1.5.2): adding stx_version_default as placeholder and adding stx_packagepath variable
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1537
diff
changeset
|
59 |
:: Do not change following line, $STX_VERSION_DEFAULT serves |
1542
0f3705d5dca6
Win32 launcher (v 1.6.1): fixing stx_version_default value and adding information to version
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1541
diff
changeset
|
60 |
:: as placeholder and it's being replaced during installation |
1539
f31be43f0fa7
Win32 launcher (v 1.5.2): adding stx_version_default as placeholder and adding stx_packagepath variable
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1537
diff
changeset
|
61 |
:: process (`rake install`) |
1550
df383905babc
Win32 launcher (v 1.6.5): fixing batch code iregularietes after adding double quotes (especially with ^%%A etc.)
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1549
diff
changeset
|
62 |
SET "stx_version=%stx_version_default%" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
63 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
64 |
:: ==================== |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
65 |
:: Comments and style = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
66 |
:: ==================== |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
67 |
:: USING :: instead of REM is a hack for now supported and it makes the bat execution much faster |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
68 |
:: The reason is: REM is a command that has to be processed by cmd.exe, but the :: is a sign followed |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
69 |
:: by :. The first : makes the interpreter ignore the line altogether. |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
70 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
71 |
:: If Microsoft should drop support of :: hack. Change you have to change all :: back to REM |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
72 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
73 |
:: ========================================= |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
74 |
:: Batch file accepts following parameters = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
75 |
:: ========================================= |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
76 |
:: Enclosing the input parameter with double quotes is a correct way how to do it |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
77 |
|
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
78 |
IF "%~1"=="--help" ECHO: & ECHO "stx.com help, for the laucher use --help-launcher." & ECHO: & GOTO stx_help |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
79 |
IF "%~1"=="-h" ECHO: & ECHO "stx.com help, for the laucher use --help-launcher." & ECHO: & GOTO stx_help |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
80 |
IF "%~1"=="/h" ECHO: & ECHO "stx.com help, for the laucher use --help-launcher." & GOTO stx_help |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
81 |
IF "%~1"=="/?" ECHO: & ECHO "stx.com help, for the laucher use --help-launcher." & GOTO stx_help |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
82 |
|
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
83 |
IF "%~1"=="--help-launcher" ECHO: & GOTO stx_help_launcher |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
84 |
IF "%~1"=="-h-l" ECHO: & GOTO stx_help_launcher |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
85 |
IF "%~1"=="/h-l" ECHO: & GOTO stx_help_launcher |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
86 |
|
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
87 |
IF "%~1"=="--about" ( |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
88 |
ECHO: & CALL :stx_about %batch_script_version% %stx_version% |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
89 |
GOTO :EOF |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
90 |
) |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
91 |
IF "%~1"=="-a" ( |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
92 |
ECHO: & CALL :stx_about %batch_script_version% %stx_version% |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
93 |
GOTO :EOF |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
94 |
) |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
95 |
IF "%~1"=="/a" ( |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
96 |
ECHO: & CALL :stx_about %batch_script_version% %stx_version% |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
97 |
GOTO :EOF |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
98 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
99 |
|
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
100 |
IF "%~1"=="--version" ( |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
101 |
ECHO: & CALL :stx_version %batch_script_version% %stx_version% |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
102 |
GOTO :EOF |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
103 |
) |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
104 |
IF "%~1"=="-v" ( |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
105 |
ECHO: & CALL :stx_version %batch_script_version% %stx_version% |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
106 |
GOTO :EOF |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
107 |
) |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
108 |
IF "%~1"=="/v" ( |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
109 |
ECHO: & CALL :stx_version %batch_script_version% %stx_version% |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
110 |
GOTO :EOF |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
111 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
112 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
113 |
:: ================== |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
114 |
:: Batch file flags = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
115 |
:: ================== |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
116 |
:: Here for the correct deletion of the filled variables when script finishes |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
117 |
:: ENABLEEXTENSIONS - enable or disable command processor extensions. These |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
118 |
:: arguments takes precedence over the CMD /E:ON or /E:OFF |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
119 |
:: ENABLEDELAYEDEXPANSION - enable or disable delayed environment variable |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
120 |
:: expansion. These arguments takes precedence over the CMD /V:ON or /V:OFF switches. |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
121 |
VERIFY OTHER 2>nul |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
122 |
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
123 |
IF ERRORLEVEL 1 ( |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
124 |
REM No color as expansion is not yet enabled |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
125 |
ECHO "Unable to enable extensions. Fix it." |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
126 |
SET "exit_value=1" |
1537
c9aea063a34e
Issue: #172 StX fails to start on Windows when launcher script is run from different directory
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1527
diff
changeset
|
127 |
GOTO exit_sequence |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
128 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
129 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
130 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
131 |
:: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
1537
c9aea063a34e
Issue: #172 StX fails to start on Windows when launcher script is run from different directory
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1527
diff
changeset
|
132 |
:: Next section follows |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
133 |
:: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
134 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
135 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
136 |
:: ******************************************************************************************* |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
137 |
:: Configuration * |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
138 |
:: ******************************************************************************************* |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
139 |
:: Now all the variables except the for configuration file are in the configuration file. |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
140 |
:: For more see variable configuration_file_path |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
141 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
142 |
:: ================================== |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
143 |
:: Clearing the shell prior the run = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
144 |
:: ================================== |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
145 |
::CLS |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
146 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
147 |
:: =========================================== |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
148 |
:: Reading variables from external .cfg file = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
149 |
:: =========================================== |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
150 |
:: The only variable that can not be validated (be careful when changing it^!) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
151 |
:: The reason is that it is before the validation process |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
152 |
SET "configuration_file_path=%~dp0" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
153 |
SET "configuration_file=smalltalk.cfg" |
1520
14d8a421b84c
Issue: #172 StX fails to start on Windows when launcher script is run from different directory
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1518
diff
changeset
|
154 |
SET "configuration_file_with_path=!configuration_file_path!!configuration_file!" |
14d8a421b84c
Issue: #172 StX fails to start on Windows when launcher script is run from different directory
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1518
diff
changeset
|
155 |
IF NOT EXIST !configuration_file_with_path! ( |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
156 |
SET "message="Smalltalk configuration file: !configuration_file! not found. Fix it."" |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
157 |
SET "__numeric.exit_value=1" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
158 |
CALL :exit_sequence !message! |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
159 |
GOTO :EOF |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
160 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
161 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
162 |
:: EOL stops comments from being parsed |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
163 |
:: otherwise split lines at the = char into two tokens |
1520
14d8a421b84c
Issue: #172 StX fails to start on Windows when launcher script is run from different directory
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1518
diff
changeset
|
164 |
FOR /F "EOL=# delims== tokens=1,*" %%A IN (!configuration_file_with_path!) DO ( |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
165 |
REM proper lines have both a and b set |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
166 |
REM if okay, assign property to some kind of namespace |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
167 |
REM so some.property becomes test.some.property in batch-land |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
168 |
IF NOT "%%A"=="" IF NOT "%%B"=="" SET "stx.%%A=%%B" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
169 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
170 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
171 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
172 |
:: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
1537
c9aea063a34e
Issue: #172 StX fails to start on Windows when launcher script is run from different directory
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1527
diff
changeset
|
173 |
:: Next section follows |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
174 |
:: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
175 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
176 |
:: ============= |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
177 |
:: Start timer = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
178 |
:: ============= |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
179 |
IF "!stx.__binary.use_timer!"=="TRUE" ( |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
180 |
CALL :time_in_seconds __start |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
181 |
ECHO: |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
182 |
ECHO "[INFO] Start timer. START at: !__start! [seconds]" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
183 |
ECHO: |
1537
c9aea063a34e
Issue: #172 StX fails to start on Windows when launcher script is run from different directory
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1527
diff
changeset
|
184 |
|
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
185 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
186 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
187 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
188 |
:: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
1537
c9aea063a34e
Issue: #172 StX fails to start on Windows when launcher script is run from different directory
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1527
diff
changeset
|
189 |
:: Next section follows |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
190 |
:: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
191 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
192 |
:: To see stx. namespace uncomment below |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
193 |
:: SET "stx." |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
194 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
195 |
:: ================================================= |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
196 |
:: Expanding variables from the configuration file = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
197 |
:: ================================================= |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
198 |
:: Variable needs expanding if shell pseudo-variable is used e.g. ...dp0 |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
199 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
200 |
:: =================== |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
201 |
:: Stx bin directory = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
202 |
:: =================== |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
203 |
IF NOT "!stx.stx_bin_dir!"=="" ( |
1516 | 204 |
CALL :expand_path !stx.stx_bin_dir! stx.stx_bin_dir |
205 |
IF ERRORLEVEL 1 ( |
|
206 |
ECHO "[ERROR] -> stx.stx_bin_dir <- variable error in check your configuration file -> !stx.stx_bin_dir! <-" |
|
1537
c9aea063a34e
Issue: #172 StX fails to start on Windows when launcher script is run from different directory
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1527
diff
changeset
|
207 |
GOTO :EOF |
1516 | 208 |
) |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
209 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
210 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
211 |
:: =================================== |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
212 |
:: Stx quick start and image details = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
213 |
:: =================================== |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
214 |
IF NOT "!stx.image_path!"=="" ( |
1516 | 215 |
CALL :expand_path !stx.image_path! stx.image_path |
216 |
IF ERRORLEVEL 1 ( |
|
217 |
ECHO "[ERROR] -> stx.image_path <- variable error in check your configuration file -> !stx.image_path! <-" |
|
1537
c9aea063a34e
Issue: #172 StX fails to start on Windows when launcher script is run from different directory
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1527
diff
changeset
|
218 |
GOTO :EOF |
1516 | 219 |
) |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
220 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
221 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
222 |
:: ============= |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
223 |
:: Stx logging = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
224 |
:: ============= |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
225 |
IF NOT "!stx.log_directory!"=="" ( |
1516 | 226 |
CALL :expand_path !stx.log_directory! stx.log_directory |
227 |
IF ERRORLEVEL 1 ( |
|
228 |
ECHO "[ERROR] -> stx.log_directory <- variable error in check your configuration file -> !stx.log_directory! <-" |
|
1537
c9aea063a34e
Issue: #172 StX fails to start on Windows when launcher script is run from different directory
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1527
diff
changeset
|
229 |
GOTO :EOF |
1516 | 230 |
) |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
231 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
232 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
233 |
:: ================================================================================== |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
234 |
:: Script's internal variables = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
235 |
:: WARNING: DO NOT TOUCH THE SET VALUES BELOW UNLESS YOU KNOW WHAT YOU ARE DOING!!! = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
236 |
:: ================================================================================== |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
237 |
:: minimal powershell version, otherwise fall-back is triggered |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
238 |
:: The path for powershell contains v1.0 for all powershell versions!!!! |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
239 |
SET "minimal_powershell_version=2.0" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
240 |
:: this variable is directly accessed also in powershell file |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
241 |
SET "powershell_version_all_functionality=3.0" |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
242 |
SET "PowerShellVersion=""" |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
243 |
SET "RuntimeVersion=""" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
244 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
245 |
:: Setting powershell script path and filename |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
246 |
SET "powershell_script_path=%~dp0" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
247 |
SET "powershell_file=smalltalk.ps1" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
248 |
SET "powershell_script_file=!powershell_script_path!!powershell_file!" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
249 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
250 |
:: Fallback option must be always active |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
251 |
SET "__binary.powershell_detected=FALSE" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
252 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
253 |
:: Default value is not to use stx command-line switches |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
254 |
SET "stx_manual_switch_detected=FALSE" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
255 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
256 |
:: default script exit value ^(^=0 - everything OK, ^<^>0 - not OK^) |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
257 |
SET "__numeric.exit_value=0" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
258 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
259 |
:: Make sure variable is undefined |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
260 |
SET "internal_runtime_options=" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
261 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
262 |
:: Used for switches enter by user at command-line, |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
263 |
:: making sure variable is undefined at the beginning |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
264 |
:: This variable is accessed directly from powershell file |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
265 |
SET "stx_switch=" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
266 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
267 |
:: Make sure variable is undefined |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
268 |
SET "stx_date_time=" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
269 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
270 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
271 |
:: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
1537
c9aea063a34e
Issue: #172 StX fails to start on Windows when launcher script is run from different directory
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1527
diff
changeset
|
272 |
:: Next section follows |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
273 |
:: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
274 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
275 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
276 |
:: ******************************************************************************************* |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
277 |
:: PowerShell detection * |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
278 |
:: ******************************************************************************************* |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
279 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
280 |
:: ============================================= |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
281 |
:: Calling user function :powershell_detection = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
282 |
:: ============================================= |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
283 |
CALL :powershell_detection __binary.powershell_detected PowerShellVersion RuntimeVersion |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
284 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
285 |
:: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
1537
c9aea063a34e
Issue: #172 StX fails to start on Windows when launcher script is run from different directory
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1527
diff
changeset
|
286 |
:: Next section follows |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
287 |
:: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
288 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
289 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
290 |
:: ******************************************************************************************* |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
291 |
:: Adjusting according to the configuration * |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
292 |
:: ******************************************************************************************* |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
293 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
294 |
:: ============= |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
295 |
:: Shell Color = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
296 |
:: ============= |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
297 |
IF "!stx.__binary.colored_stdout!"=="TRUE" ( |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
298 |
IF "!__binary.powershell_detected!"=="TRUE" ( |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
299 |
SET "use_color=TRUE" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
300 |
) ELSE ( |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
301 |
SET "use_color=FALSE" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
302 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
303 |
) ELSE ( |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
304 |
SET "use_color=FALSE" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
305 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
306 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
307 |
:: ============ |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
308 |
:: Image name = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
309 |
:: ============ |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
310 |
SET "default_image_name="!stx.image_name:"=!!stx.image_suffix:"=!"" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
311 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
312 |
:: ============================ |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
313 |
:: Add encoding to the suffix = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
314 |
:: ============================ |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
315 |
:: Allowed values ASCII, UTF8 (default), UTF16 (in Microsoft world that is called Unicode), UTF32 |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
316 |
:: Note: If UTF16 is used you can view log file while StX is running, in all other cases you have to close StX before viewing the file |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
317 |
IF "!stx.log_file_encoding!"=="ASCII" ( |
1516 | 318 |
SET "stx.log_suffix="_ascii!stx.log_suffix:"=!"" |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
319 |
) ELSE IF "!stx.log_file_encoding!"=="UTF8" ( |
1516 | 320 |
SET "stx.log_suffix="_utf8!stx.log_suffix:"=!"" |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
321 |
) ELSE IF "!stx.log_file_encoding!"=="UTF16" ( |
1516 | 322 |
SET "stx.log_suffix="_utf16!stx.log_suffix:"=!"" |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
323 |
) ELSE IF "!stx.log_file_encoding!"=="UTF32" ( |
1516 | 324 |
SET "stx.log_suffix="_utf32!stx.log_suffix:"=!"" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
325 |
) ELSE ( |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
326 |
SET "message="Invalid log file encoding: !stx.log_file_encoding!. Fix it and run the script again."" |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
327 |
SET "__numeric.exit_value=1" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
328 |
CALL :exit_sequence !message! |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
329 |
GOTO :EOF |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
330 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
331 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
332 |
:: ================================================= |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
333 |
:: UTF16 alias Microsoft's Unicode name conversion = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
334 |
:: ================================================= |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
335 |
IF "!stx.log_file_encoding!"=="UTF16" ( |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
336 |
SET "stx.log_file_encoding=Unicode" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
337 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
338 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
339 |
:: ================= |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
340 |
:: Log file format = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
341 |
:: ================= |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
342 |
:: Using wmic os get as it is probably the only locales independent way to get time on Windows |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
343 |
:: Date: Using date ISO 8601 format YYYY-MM-DD with time part |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
344 |
:: Time: Using time and date format independent of locales |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
345 |
:: Note: back ticks are there for powershell compatibility |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
346 |
IF "!stx.__binary.log_add_datepart!"=="TRUE" ( |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
347 |
FOR /F %%A IN ('wmic os get LocalDateTime ^| find "."') DO SET "dts=%%A" |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
348 |
SET "stx_date_time=!dts:~0,4!-!dts:~4,2!-!dts:~6,2!" |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
349 |
IF "!stx.__binary.log_add_timepart!"=="TRUE" ( |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
350 |
SET "stx_date_time=!stx_date_time!_!dts:~8,2!"`;"!dts:~10,2!"`;"!dts:~12,2!" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
351 |
) |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
352 |
SET "log_filename="!stx.log_name:"=!_!stx_date_time!!stx.log_suffix:"=!"" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
353 |
) ELSE ( |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
354 |
FOR /F %%A IN ('wmic os get LocalDateTime ^| find "."') DO SET "dts=%%A" |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
355 |
IF "!stx.__binary.log_add_timepart!"=="TRUE" ( |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
356 |
SET "stx_date_time=!dts:~8,2!"`;"!dts:~10,2!"`;"!dts:~12,2!" |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
357 |
SET "log_filename="!stx.log_name:"=!_!stx_date_time!!stx.log_suffix:"=!"" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
358 |
) ELSE ( |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
359 |
SET "log_filename="!stx.log_name:"=!!stx.log_suffix:"=!"" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
360 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
361 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
362 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
363 |
:: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
1537
c9aea063a34e
Issue: #172 StX fails to start on Windows when launcher script is run from different directory
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1527
diff
changeset
|
364 |
:: Next section follows |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
365 |
:: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
366 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
367 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
368 |
:: ******************************************************************************************* |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
369 |
:: Checking variable and logic consistency * |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
370 |
:: ******************************************************************************************* |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
371 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
372 |
:: ============================================== |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
373 |
:: Checking the PowerShell file (.ps1) presence = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
374 |
:: ============================================== |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
375 |
IF NOT EXIST "!powershell_script_file!" ( |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
376 |
SET "message="PowerShell file missing: !powershell_script_path!smalltalk.ps1. Fix it."" |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
377 |
SET "__numeric.exit_value=1" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
378 |
CALL :exit_sequence !message! |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
379 |
GOTO :EOF |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
380 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
381 |
|
1516 | 382 |
|
383 |
:: ======================= |
|
384 |
:: Variables' validation = |
|
385 |
:: ======================= |
|
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
386 |
IF "!stx.verify_variables_syntax!"=="TRUE" ( |
1516 | 387 |
REM must be used (inside IF^^!) |
388 |
REM ===================================================================== |
|
389 |
REM Validate __binary for TRUE^/FALSE and if it does not contain spaces = |
|
390 |
REM ===================================================================== |
|
391 |
REM Checks if the variable contains correctly written TRUE^/FALSE |
|
392 |
REM additionally it also checks if additional space was not added by mistake |
|
393 |
REM var -7 extracts the last 7 characters from var |
|
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
394 |
FOR /F "tokens=3 delims=^." %%A IN ('SET stx.__binary.') DO ( |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
395 |
SET "temp_test=%%A" |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
396 |
IF "!temp_test:~-5!"=="=TRUE" ( |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
397 |
IF NOT "!temp_test!"=="!temp_test: =!" ( |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
398 |
SET "__numeric.exit_value=1" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
399 |
SET "first_message="Incorrect configuration additional space detected."" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
400 |
SET "first_message="Correct the variable: __binary.!temp_test!"" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
401 |
CALL :exit_sequence !first_message! !second_message! |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
402 |
GOTO :EOF |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
403 |
) |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
404 |
) ELSE IF "!temp_test:~-6!"=="=FALSE" ( |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
405 |
IF NOT "!temp_test!"=="!temp_test: =!" ( |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
406 |
SET "__numeric.exit_value=1" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
407 |
SET "first_message="Incorrect configuration additional space detected."" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
408 |
SET "second_message="Correct the variable: __binary.!temp_test!"" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
409 |
CALL :exit_sequence !first_message! !second_message! |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
410 |
GOTO :EOF |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
411 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
412 |
) ELSE ( |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
413 |
IF NOT "!temp_test!"=="!temp_test: =!" ( |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
414 |
SET "__numeric.exit_value=1" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
415 |
SET "first_message="Incorrect configuration additional space detected."" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
416 |
SET "second_message="Correct the variable: __binary.!temp_test!"" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
417 |
CALL :exit_sequence !first_message! !second_message! |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
418 |
GOTO :EOF |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
419 |
) ELSE ( |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
420 |
SET "first_message="Incorrect configuration mistake in TRUE^/FALSE detected."" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
421 |
SET "second_message="Correct the variable: __binary.!temp_test!"" |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
422 |
SET "__numeric.exit_value=1" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
423 |
CALL :exit_sequence !first_message! !second_message! |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
424 |
GOTO :EOF |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
425 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
426 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
427 |
) |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
428 |
|
1517 | 429 |
REM must be used (inside IF^^!) |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
430 |
REM =================================================================== |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
431 |
REM Validate if __binary values are numeric and do not contain spaces = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
432 |
REM =================================================================== |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
433 |
REM 1. FOR - variable extraction bla value |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
434 |
REM 2. FOR - extracting integer value |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
435 |
REM 3. FOR - testing integer |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
436 |
FOR /F "tokens=3 delims=^." %%A IN ('SET stx.__numeric.') DO ( |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
437 |
SET "temp_test=%%A" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
438 |
FOR /F "tokens=2 delims==" %%B IN ("!temp_test!") DO SET "test_integer=%%B" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
439 |
SET "ugh="&FOR /F "delims=0123456789" %%C IN ("!test_integer!") DO SET "ugh=%%~C" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
440 |
IF defined ugh ( |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
441 |
IF NOT "!temp_test!"=="!temp_test: =!" ( |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
442 |
SET "__numeric.exit_value=1" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
443 |
SET "first_message="Incorrect configuration additional space detected."" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
444 |
SET "second_message="Correct the variable: __binary.!temp_test!"" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
445 |
CALL :exit_sequence !first_message! !second_message! |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
446 |
GOTO :EOF |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
447 |
) ELSE ( |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
448 |
SET "__numeric.exit_value=1" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
449 |
SET "message="Incorrect configuration detected - integer value is not an integer."" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
450 |
CALL :exit_sequence !message! |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
451 |
GOTO :EOF |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
452 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
453 |
) ELSE ( |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
454 |
IF NOT "!temp_test!"=="!temp_test: =!" ( |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
455 |
SET "__numeric.exit_value=1" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
456 |
SET "first_message="Incorrect configuration additional space detected."" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
457 |
SET "second_message="Correct the variable: __binary.!temp_test!"" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
458 |
CALL :exit_sequence !first_message! !second_message! |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
459 |
GOTO :EOF |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
460 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
461 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
462 |
) |
1516 | 463 |
REM must be used (inside IF^^!) |
464 |
REM =============================================================== |
|
465 |
REM Validate path variables to contain double quotes or backslash = |
|
466 |
REM =============================================================== |
|
467 |
||
468 |
REM ======================================================== |
|
469 |
REM Check beginning of the string to contain double quotes = |
|
470 |
REM ======================================================== |
|
471 |
REM Checking image variables |
|
472 |
SET "correct_substring=!stx.image_name:~0,1!" |
|
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
473 |
IF NOT !correct_substring!==^" ( |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
474 |
SET "__numeric.exit_value=1" |
1516 | 475 |
SET "message="Incorrect configuration detected missing double quotes at stx.image_name variable: - !stx.image_name! -"" |
476 |
CALL :exit_sequence !message! |
|
477 |
GOTO :EOF |
|
478 |
) |
|
479 |
SET "correct_substring=!stx.image_suffix:~0,1!" |
|
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
480 |
IF NOT !correct_substring!==^" ( |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
481 |
SET "__numeric.exit_value=1" |
1516 | 482 |
SET "message="Incorrect configuration detected missing double quotes at stx.image_suffix variable: - !stx.image_suffix! -"" |
483 |
CALL :exit_sequence !message! |
|
484 |
GOTO :EOF |
|
485 |
) |
|
486 |
||
487 |
REM Checking logging variables |
|
488 |
SET "correct_substring=!stx.log_name:~0,1!" |
|
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
489 |
IF NOT !correct_substring!==^" ( |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
490 |
SET "__numeric.exit_value=1" |
1516 | 491 |
SET "message="Incorrect configuration detected missing double quotes at stx.log_name variable: - !stx.log_name! -"" |
492 |
CALL :exit_sequence !message! |
|
493 |
GOTO :EOF |
|
494 |
) |
|
495 |
SET "correct_substring=!stx.log_suffix:~0,1!" |
|
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
496 |
IF NOT !correct_substring!==^" ( |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
497 |
SET "__numeric.exit_value=1" |
1516 | 498 |
SET "message="Incorrect configuration detected missing double quotes at stx.log_suffix variable: - !stx.log_suffix! -"" |
499 |
CALL :exit_sequence !message! |
|
500 |
GOTO :EOF |
|
501 |
) |
|
502 |
SET "correct_substring=!log_filename:~0,1!" |
|
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
503 |
IF NOT !correct_substring!==^" ( |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
504 |
SET "__numeric.exit_value=1" |
1516 | 505 |
SET "message="Incorrect configuration detected missing double quotes at log_filename variable: - !log_filename! -"" |
506 |
CALL :exit_sequence !message! |
|
507 |
GOTO :EOF |
|
508 |
) |
|
509 |
REM clearing temp variable |
|
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
510 |
SET "correct_substring=" |
1537
c9aea063a34e
Issue: #172 StX fails to start on Windows when launcher script is run from different directory
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1527
diff
changeset
|
511 |
|
1516 | 512 |
REM =========================================================================================== |
513 |
REM Checking string's end to contain either backslash and double quotes or just double quotes = |
|
514 |
REM =========================================================================================== |
|
515 |
REM Checking image variables |
|
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
516 |
IF NOT !stx.stx_bin_dir:~-2!==\^" ( |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
517 |
SET "__numeric.exit_value=1" |
1516 | 518 |
SET "message="Incorrect configuration detected. Missing backslash at variable stx.stx_bin_dir: - !stx.stx_bin_dir! -"" |
519 |
CALL :exit_sequence !message! |
|
520 |
GOTO :EOF |
|
521 |
) |
|
522 |
||
523 |
REM Checking image variables |
|
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
524 |
IF NOT !stx.image_path:~-2!==\^" ( |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
525 |
SET "__numeric.exit_value=1" |
1516 | 526 |
SET "message="Incorrect configuration detected. Missing backslash at variable stx.image_path: - !stx.image_path! -"" |
527 |
CALL :exit_sequence !message! |
|
528 |
GOTO :EOF |
|
529 |
) |
|
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
530 |
IF NOT !stx.image_name:~-1!==^" ( |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
531 |
SET "__numeric.exit_value=1" |
1516 | 532 |
SET "message="Incorrect configuration detected missing double quotes at stx.image_name variable: - !stx.image_name! -"" |
533 |
CALL :exit_sequence !message! |
|
534 |
GOTO :EOF |
|
535 |
) |
|
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
536 |
IF NOT !stx.image_suffix:~-1!==^" ( |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
537 |
SET "__numeric.exit_value=1" |
1516 | 538 |
SET "message="Incorrect configuration detected missing double quotes at stx.image_suffix variable: - !stx.image_suffix! -"" |
539 |
CALL :exit_sequence !message! |
|
540 |
GOTO :EOF |
|
541 |
) |
|
542 |
||
543 |
REM Checking logging variables |
|
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
544 |
IF NOT !stx.log_directory:~-2!==\^" ( |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
545 |
SET "__numeric.exit_value=1" |
1516 | 546 |
SET "message="Incorrect configuration detected. Missing backslash at variable stx.log_directory: - !stx.log_directory! -"" |
547 |
CALL :exit_sequence !message! |
|
548 |
GOTO :EOF |
|
549 |
) |
|
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
550 |
IF NOT !stx.log_name:~-1!==^" ( |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
551 |
SET "__numeric.exit_value=1" |
1516 | 552 |
SET "message="Incorrect configuration detected missing double quotes at stx.log_name variable: - !stx.log_name! -"" |
553 |
CALL :exit_sequence !message! |
|
554 |
GOTO :EOF |
|
555 |
) |
|
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
556 |
IF NOT !stx.log_suffix:~-1!==^" ( |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
557 |
SET "__numeric.exit_value=1" |
1516 | 558 |
SET "message="Incorrect configuration detected missing double quotes at stx.log_suffix variable: - !stx.log_suffix! -"" |
559 |
CALL :exit_sequence !message! |
|
560 |
GOTO :EOF |
|
561 |
) |
|
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
562 |
IF NOT !log_filename:~-1!==^" ( |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
563 |
SET "__numeric.exit_value=1" |
1516 | 564 |
SET "message="Incorrect configuration detected missing double quotes at log_filename variable: - !log_filename! -"" |
565 |
CALL :exit_sequence !message! |
|
566 |
GOTO :EOF |
|
567 |
) |
|
568 |
REM must be used (inside IF^^!) |
|
569 |
REM =========================================== |
|
570 |
REM Print validation message if user wants to = |
|
571 |
REM =========================================== |
|
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
572 |
IF "!stx.verify_print_message!"=="TRUE" ( |
1515 | 573 |
CALL :print_message !use_color! !stx.stdout_VerboseBackgroundColor! !stx.stdout_VerboseForegroundColor! "===============================" "Variable syntax validated. =" "===============================" |
574 |
ECHO: |
|
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
575 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
576 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
577 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
578 |
:: ============= |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
579 |
:: Quick start = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
580 |
:: ============= |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
581 |
:: Note: quick start should not be used with image functionality |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
582 |
:: If there is a mistake in image functionality (start_with_image=FALSE and list_available_images=TRUE) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
583 |
:: THEN quick start is used |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
584 |
IF "!stx.__binary.stx_quick_start!"=="TRUE" ( |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
585 |
IF "!stx.__binary.start_with_image!"=="TRUE" ( |
1517 | 586 |
CALL :print_message !use_color! !stx.stdout_WarningBackgroundColor! !stx.stdout_WarningForegroundColor! "[WARN] Your configuration flawed - compensating." "[WARN] stx_quick_start=TRUE AND start_with_image=TRUE which makes no sense." |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
587 |
ECHO: |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
588 |
SET "stx.__binary.stx_quick_start=FALSE" |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
589 |
) ELSE IF "!stx.__binary.list_available_images!"=="TRUE" ( |
1515 | 590 |
CALL :print_message !use_color! !stx.stdout_WarningBackgroundColor! !stx.stdout_WarningForegroundColor! "[WARN] Your configuration flawed - compensating." "[WARN] start_with_image=FALSE, list_available_images=TRUE, AND stx_quick_start=TRUE which makes no sense." "[WARN] Using only stx_quick_start=TRUE" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
591 |
ECHO: |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
592 |
SET "stx.__binary.list_available_images=FALSE" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
593 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
594 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
595 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
596 |
:: ========================================================================== |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
597 |
:: Pair stx.__binary.start_with_image ^& stx.__binary.list_available_images = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
598 |
:: ========================================================================== |
1515 | 599 |
:: NOTE: not using :print_message -> sending too many messages |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
600 |
IF "!stx.__binary.start_with_image!"=="FALSE" ( |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
601 |
IF "!stx.__binary.list_available_images!"=="TRUE" ( |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
602 |
IF "!use_color!"=="TRUE" ( |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
603 |
CALL :printInColor !stx.stdout_WarningBackgroundColor! !stx.stdout_WarningForegroundColor! "[WARN] Your configuration flawed - compensating." |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
604 |
CALL :printInColor !stx.stdout_WarningBackgroundColor! !stx.stdout_WarningForegroundColor! "[WARN] start_with_image=FALSE AND list_available_images=TRUE which makes no sense." |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
605 |
CALL :printInColor !stx.stdout_WarningBackgroundColor! !stx.stdout_WarningForegroundColor! "[WARN] Setting list_available_images=FALSE." |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
606 |
CALL :printInColor !stx.stdout_WarningBackgroundColor! !stx.stdout_WarningForegroundColor! "[WARN] To fix it either set start_with_image=TRUE or list_available_images=FALSE" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
607 |
) ELSE ( |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
608 |
ECHO "[WARN] Your configuration flawed - compensating." |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
609 |
ECHO "[WARN] start_with_image=FALSE AND list_available_images=TRUE which makes no sense." |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
610 |
ECHO "[WARN] Setting list_available_images=FALSE." |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
611 |
ECHO "[WARN] To fix it either set start_with_image=TRUE or list_available_images=FALSE" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
612 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
613 |
ECHO: |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
614 |
SET "stx.__binary.list_available_images=FALSE" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
615 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
616 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
617 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
618 |
:: ============================================================================================ |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
619 |
:: Pair variables (work together) stx.__binary.record_log_file and stx.__binary.append_to_log = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
620 |
:: ============================================================================================ |
1515 | 621 |
:: NOTE: not using :print_message -> sending too many messages |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
622 |
IF "!stx.__binary.record_log_file!"=="FALSE" ( |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
623 |
IF "!stx.__binary.append_to_log!"=="TRUE" ( |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
624 |
ECHO: |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
625 |
IF "!use_color!"=="TRUE" ( |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
626 |
CALL :printInColor !stx.stdout_WarningBackgroundColor! !stx.stdout_WarningForegroundColor! "[WARN] Your configuration flawed - compensating." |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
627 |
CALL :printInColor !stx.stdout_WarningBackgroundColor! !stx.stdout_WarningForegroundColor! "[WARN] record_log_file=FALSE AND append_to_log=TRUE which makes no sense." |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
628 |
CALL :printInColor !stx.stdout_WarningBackgroundColor! !stx.stdout_WarningForegroundColor! "[WARN] Setting append_to_log=FALSE." |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
629 |
CALL :printInColor !stx.stdout_WarningBackgroundColor! !stx.stdout_WarningForegroundColor! "[WARN] To fix it either set record_log_file=TRUE or append_to_log=FALSE" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
630 |
) ELSE ( |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
631 |
ECHO "[WARN] Your configuration flawed - compensating." |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
632 |
ECHO "[WARN] record_log_file=FALSE AND append_to_log=TRUE which makes no sense." |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
633 |
ECHO "[WARN] Setting append_to_log=FALSE." |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
634 |
ECHO "[WARN] To fix it either set record_log_file=TRUE or append_to_log=FALSE" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
635 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
636 |
ECHO: |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
637 |
SET "stx.__binary.append_to_log=FALSE" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
638 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
639 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
640 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
641 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
642 |
:: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
1537
c9aea063a34e
Issue: #172 StX fails to start on Windows when launcher script is run from different directory
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1527
diff
changeset
|
643 |
:: Next section follows |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
644 |
:: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
645 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
646 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
647 |
:: ******************************************************************************************* |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
648 |
:: Verify existence of paths and files from configuration * |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
649 |
:: ******************************************************************************************* |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
650 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
651 |
:: =================================================== |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
652 |
:: Selecting an executable = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
653 |
:: Checking for a presence of %smalltalk_executable% = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
654 |
:: =================================================== |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
655 |
:: Your path to smalltalk & and exec (bat,cmd,com,exe, etc.) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
656 |
:: change the line below, if the support stuff is not found in the |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
657 |
:: directory where stx-bin.com / stx.com resides. (exe is for GUI only) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
658 |
:: STX_LIB_DIR=<path_to_support_files> |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
659 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
660 |
:: Change to the specified bin directory |
1516 | 661 |
pushd "!stx.stx_bin_dir!" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
662 |
IF EXIST "stx-bin.com" ( |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
663 |
IF "!stx.__binary.run_via_shell!"=="TRUE" ( |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
664 |
SET "selected_executable=stx-bin.com" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
665 |
) ELSE ( |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
666 |
SET "selected_executable=stx-bin.exe" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
667 |
) |
1516 | 668 |
SET "stx_home=!stx.stx_bin_dir:"=!.." |
669 |
SET "stx_topdir=!stx.stx_bin_dir:"=!..\lib\smalltalkx\!stx_version!" |
|
670 |
SET "stx_libdir=!stx.stx_bin_dir:"=!..\lib\smalltalkx\!stx_version!\lib" |
|
1539
f31be43f0fa7
Win32 launcher (v 1.5.2): adding stx_version_default as placeholder and adding stx_packagepath variable
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1537
diff
changeset
|
671 |
SET "stx_packagepath=!stx.stx_bin_dir:"=!..\lib\smalltalkx\!stx_version!\packages" |
1516 | 672 |
SET "smalltalk_executable=!stx.stx_bin_dir:"=!!selected_executable!" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
673 |
) ELSE IF EXIST "stx.com" ( |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
674 |
IF "!stx.__binary.run_via_shell!"=="TRUE" ( |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
675 |
SET "selected_executable=stx.com" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
676 |
) ELSE ( |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
677 |
SET "selected_executable=stx.exe" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
678 |
) |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
679 |
SET "smalltalk_executable="!stx.stx_bin_dir:"=!!selected_executable!"" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
680 |
) ELSE ( |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
681 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
682 |
SET "message="The executable stx-bin^.com;exe perhaps stx^.com;exe NOT found."" |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
683 |
SET "__numeric.exit_value=1" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
684 |
CALL :exit_sequence !message! |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
685 |
GOTO :EOF |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
686 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
687 |
:: return back |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
688 |
popd |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
689 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
690 |
:: ========================================================================================== |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
691 |
:: Checking if the image at the path really exists. = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
692 |
:: using temporary variable due to the fact that NOT exists needs already expanded variable = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
693 |
:: ========================================================================================== |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
694 |
SET "temp_stx.image_path=!stx.image_path:"=!!default_image_name:"=!" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
695 |
|
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
696 |
IF "!stx.__binary.start_with_image!"=="TRUE" ( |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
697 |
IF "!stx.__binary.list_available_images!"=="FALSE" ( |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
698 |
IF NOT EXIST "!temp_stx.image_path!" ( |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
699 |
REM TOO DEEP MUST FIX |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
700 |
REM CALL :colorEcho stx.stdout_cmd_warning "[WARN] The default image: !stx.image_path:"=!!default_image_name:"=! was not found." |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
701 |
REM CALL :colorEcho stx.stdout_cmd_warning "[WARN] No image will loaded. If you want to load from image fix your path or image name." |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
702 |
ECHO: |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
703 |
SET "stx.__binary.start_with_image=FALSE" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
704 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
705 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
706 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
707 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
708 |
:: clearing temp variable |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
709 |
SET "temp_stx.image_path=" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
710 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
711 |
:: =============================================================================== |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
712 |
:: Checking existence of logging directory, if not found all logging is disabled = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
713 |
:: =============================================================================== |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
714 |
IF NOT EXIST "!stx.log_directory!" ( |
1515 | 715 |
CALL :print_message !use_color! !stx.stdout_WarningBackgroundColor! !stx.stdout_WarningForegroundColor! "[WARN] The logging path: !stx.log_directory! NOT found." "[WARN] Logging will be DISABLED." |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
716 |
ECHO: |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
717 |
SET "stx.__binary.start_with_image=FALSE" |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
718 |
SET "stx.__binary.append_to_log=FALSE" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
719 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
720 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
721 |
:: ================================================================ |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
722 |
:: Checking existence of log file if not found append is disabled = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
723 |
:: ================================================================ |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
724 |
IF NOT EXIST "!log_filename!" ( |
1515 | 725 |
CALL :print_message !use_color! !stx.stdout_VerboseBackgroundColor! !stx.stdout_VerboseForegroundColor! "[INFO] No log file found turning off the append mode." |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
726 |
ECHO: |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
727 |
SET "stx.__binary.append_to_log=FALSE" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
728 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
729 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
730 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
731 |
:: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
1537
c9aea063a34e
Issue: #172 StX fails to start on Windows when launcher script is run from different directory
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1527
diff
changeset
|
732 |
:: Next section follows |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
733 |
:: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
734 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
735 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
736 |
:: ******************************************************************************************* |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
737 |
:: A work-flow based on the configuration * |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
738 |
:: ******************************************************************************************* |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
739 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
740 |
:: ================================================================= |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
741 |
:: If powershell detected, get powershell executable from registry = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
742 |
:: ================================================================= |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
743 |
:: FINDSTR is there for Windows XP compatibility |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
744 |
IF "!__binary.powershell_detected!"=="TRUE" ( |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
745 |
(FOR /F "tokens=3" %%A IN ('REG QUERY "HKLM\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell" /v path ^| FINDSTR "^.*\.exe$"') DO ( |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
746 |
SET "powershell_exec=%%A" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
747 |
)) || REM |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
748 |
IF ERRORLEVEL 1 ( |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
749 |
SET "first_message="[ERROR] Powershell detected, but executable !powershell_exec! not found."" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
750 |
SET "second_message="Fix your system."" |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
751 |
SET "__numeric.exit_value=1" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
752 |
CALL :exit_sequence !first_message! !second_message! |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
753 |
GOTO :EOF |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
754 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
755 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
756 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
757 |
:: =================================================== |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
758 |
:: Powershell detected? (so we can log into a file?) = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
759 |
:: =================================================== |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
760 |
IF "!stx.__binary.record_log_file!"=="TRUE" ( |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
761 |
IF "!__binary.powershell_detected!"=="FALSE" ( |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
762 |
SET "stx.__binary.record_log_file=FALSE" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
763 |
SET "stx.__binary.append_to_log=FALSE" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
764 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
765 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
766 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
767 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
768 |
:: ===================================================== |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
769 |
:: Adding all parameters available to the %stx_switch% = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
770 |
:: Making sure previous switches are taken in account = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
771 |
:: ===================================================== |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
772 |
:: Cycle all command-line switches entered in the shell by the user |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
773 |
:: Encircle all switches (both - and --) by double-quotes |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
774 |
:: Ignore the command-line switches already with double quotes |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
775 |
:: Replace single quotes with double quotes if such switch is found |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
776 |
REM IF "%1" NEQ "" will cause problems if %1 is enclosed in quotes itself. |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
777 |
REM and you must have the extensions turn on |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
778 |
|
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
779 |
IF NOT "%~1"=="" ( |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
780 |
SET "stx_manual_switch_detected=TRUE" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
781 |
SET "detect_double_switch=--" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
782 |
SET "detect_single_switch=-" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
783 |
SET "detect_double_quote="-" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
784 |
SET "detect_single_quote='-" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
785 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
786 |
FOR %%A IN (%*) DO ( |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
787 |
SET "temp_string=%%~A" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
788 |
IF DEFINED stx_switch ( |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
789 |
REM Detect if "" around a switch are used and leave the switch alone |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
790 |
IF "!temp_string:~0,2!"=="!detect_double_quote!" ( |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
791 |
SET "stx_switch=!stx_switch! %%A" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
792 |
REM Detect if '' around a switch are used and convert them to "" |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
793 |
) ELSE IF "!temp_string:~0,2!"=="!detect_single_quote!" ( |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
794 |
SET "changed_string=!temp_string:'="!" |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
795 |
SET "stx_switch=!stx_switch! !changed_string!" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
796 |
REM if -- found encircle it with double quotes |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
797 |
) ELSE IF "!temp_string:~0,2!"=="!detect_double_switch!" ( |
1550
df383905babc
Win32 launcher (v 1.6.5): fixing batch code iregularietes after adding double quotes (especially with ^%%A etc.)
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1549
diff
changeset
|
798 |
SET stx_switch=!stx_switch! ^"%%~A^" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
799 |
REM checks a string for "-" if it contains it it will add double-quotes |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
800 |
) ELSE IF "!temp_string:~0,1!"=="!detect_single_switch!" ( |
1550
df383905babc
Win32 launcher (v 1.6.5): fixing batch code iregularietes after adding double quotes (especially with ^%%A etc.)
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1549
diff
changeset
|
801 |
SET stx_switch=!stx_switch! ^"%%~A^" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
802 |
) ELSE ( |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
803 |
SET "stx_switch=!stx_switch! %%A" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
804 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
805 |
REM stx_switch is not yet defined - first run |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
806 |
) ELSE ( |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
807 |
REM Detect if "" around a switch are used |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
808 |
IF "!temp_string:~0,2!"=="!detect_double_quote!" ( |
1550
df383905babc
Win32 launcher (v 1.6.5): fixing batch code iregularietes after adding double quotes (especially with ^%%A etc.)
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1549
diff
changeset
|
809 |
SET stx_switch=!stx_switch! %%A |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
810 |
REM Detect if '' around a switch are used and convert them to "" |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
811 |
) ELSE IF "!temp_string:~0,2!"=="!detect_single_quote!" ( |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
812 |
SET "changed_string=!temp_string:'="!" |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
813 |
SET "stx_switch=!stx_switch! !changed_string!" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
814 |
REM All other options |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
815 |
) ELSE ( |
1550
df383905babc
Win32 launcher (v 1.6.5): fixing batch code iregularietes after adding double quotes (especially with ^%%A etc.)
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1549
diff
changeset
|
816 |
SET stx_switch=^"%%A^" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
817 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
818 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
819 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
820 |
REM clearing used variables |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
821 |
SET "detect_switch_double=" |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
822 |
SET "detect_single_switch=" |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
823 |
SET "detect_double_quote=" |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
824 |
SET "detect_single_quote=" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
825 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
826 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
827 |
:: ====================================================== |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
828 |
:: Block CMD PowerShell mode from using manual Switches = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
829 |
:: ====================================================== |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
830 |
IF "!stx_manual_switch_detected!"=="TRUE" ( |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
831 |
IF "!stx.__binary.cmd_in_powershell!"=="TRUE" ( |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
832 |
ECHO: |
1515 | 833 |
CALL :print_message !use_color! !stx.stdout_WarningBackgroundColor! !stx.stdout_WarningForegroundColor! "[WARN] You can not simultaneously pass command-line switches to stx.com and log using CMD PowerShell mode - __binary.cmd_in_powershell=TRUE" "[WARN] Switching off LOGGING and executing only via cmd.exe." |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
834 |
ECHO: |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
835 |
SET "stx.__binary.record_log_file=FALSE" |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
836 |
SET "stx.__binary.append_to_log=FALSE" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
837 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
838 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
839 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
840 |
:: ================================= |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
841 |
:: Three ways to start Smalltalk/X = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
842 |
:: ================================= |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
843 |
:: TRUE;TRUE - User will be asked for input; with which image to start |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
844 |
:: TRUE;FALSE - Stx will start with the default image configured |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
845 |
:: FALSE;FALSE - Quick start - StX will start without an image |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
846 |
IF "!stx.__binary.start_with_image!"=="TRUE" ( |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
847 |
IF "!stx.__binary.list_available_images!"=="TRUE" ( |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
848 |
REM USER INPUT |
1517 | 849 |
CALL :user_menu !stx.image_path! stx.image_name !stx.image_suffix! |
850 |
CALL :print_message !use_color! !stx.stdout_VerboseBackgroundColor! !stx.stdout_VerboseForegroundColor! "[INFO] Loading selected image !stx.image_name!" |
|
851 |
SET "user_selected_image=!stx.image_name!" |
|
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
852 |
IF DEFINED internal_runtime_options ( |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
853 |
SET "stx_switch=!stx_switch! !internal_runtime_options! "--image" !user_selected_image!" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
854 |
) ELSE ( |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
855 |
SET "stx_switch=!stx_switch! "--image" !user_selected_image!" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
856 |
) |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
857 |
SET "user_selected_image=" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
858 |
) ELSE ( |
1515 | 859 |
CALL :print_message !use_color! !stx.stdout_VerboseBackgroundColor! !stx.stdout_VerboseForegroundColor! "[INFO] DEFAULT IMAGE: !stx.image_path:"=!!default_image_name:"=! starts" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
860 |
IF DEFINED internal_runtime_options ( |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
861 |
SET "stx_switch="--image" !default_image_name! !internal_runtime_options! !stx_switch!" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
862 |
) ELSE ( |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
863 |
SET "stx_switch="--image" !default_image_name! !stx_switch!" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
864 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
865 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
866 |
) ELSE ( |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
867 |
IF "!stx.__binary.stx_quick_start!"=="TRUE" ( |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
868 |
IF "!stx_manual_switch_detected!"=="TRUE" ( |
1515 | 869 |
CALL :print_message !use_color! !stx.stdout_VerboseBackgroundColor! !stx.stdout_VerboseForegroundColor! "[INFO] Manual switch detected - configuration is ignored" |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
870 |
SET "stx_switch= !stx_switch!" |
1515 | 871 |
) ELSE IF DEFINED internal_runtime_options ( |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
872 |
SET "stx_switch="--ignoreImage" !stx_switch! !internal_runtime_options! "--quick"" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
873 |
) ELSE ( |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
874 |
SET "stx_switch="--ignoreImage" !stx_switch! "--quick"" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
875 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
876 |
REM clearing configured values |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
877 |
SET "stx.image_path=" |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
878 |
SET "default_image_name=" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
879 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
880 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
881 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
882 |
:: ======================================= |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
883 |
:: Check if user wants to command prompt = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
884 |
:: ======================================= |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
885 |
:: note: cmd /U causes the output to pipes or file to be Unicode |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
886 |
IF "!stx.__binary.close_shell!"=="TRUE" ( |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
887 |
SET "cmd_close=/U /C" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
888 |
) ELSE ( |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
889 |
SET "cmd_close=/U /K" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
890 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
891 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
892 |
:: ============================================================================= |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
893 |
:: Check if the log file is not too big (with jumping into log file directory) = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
894 |
:: ============================================================================= |
1515 | 895 |
:: NOTE: not using :print_message -> sending too many messages |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
896 |
:: Changing to log directory |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
897 |
pushd "!stx.log_directory!" |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
898 |
IF "!stx.__binary.append_to_log!"=="TRUE" ( |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
899 |
(FOR %%A IN (!log_filename!) DO ( |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
900 |
SET "file_size=%%~zA" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
901 |
)) || REM |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
902 |
IF ERRORLEVEL 1 ( |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
903 |
SET "message="Error checking size of the file: !log_filename:"=!."" |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
904 |
SET "__numeric.exit_value=1" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
905 |
CALL :exit_sequence !message! |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
906 |
GOTO :EOF |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
907 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
908 |
IF !file_size! GEQ !stx.__numeric.warning_logfile_size! ( |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
909 |
ECHO: |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
910 |
IF "!use_color!"=="TRUE" ( |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
911 |
CALL :printInColor !stx.stdout_WarningBackgroundColor! !stx.stdout_WarningForegroundColor! "===================================================================================================================" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
912 |
CALL :printInColor !stx.stdout_WarningBackgroundColor! !stx.stdout_WarningForegroundColor! "[WARN] BIG_FAT_WARNING: your log file !log_filename:"=! is larger than !stx.__numeric.warning_logfile_size! Bytes. " |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
913 |
CALL :printInColor !stx.stdout_WarningBackgroundColor! !stx.stdout_WarningForegroundColor! "[WARN] This can slow down your StX." |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
914 |
CALL :printInColor !stx.stdout_WarningBackgroundColor! !stx.stdout_WarningForegroundColor! "===================================================================================================================" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
915 |
) ELSE ( |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
916 |
ECHO "=====================================================================================================================" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
917 |
ECHO "[WARN] BIG_FAT_WARNING: your log file !log_filename:"=! is larger than !stx.__numeric.warning_logfile_size! Bytes. " |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
918 |
ECHO "[WARN] This can slow down your StX." |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
919 |
ECHO "=====================================================================================================================" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
920 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
921 |
ECHO: |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
922 |
PAUSE |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
923 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
924 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
925 |
:: Return back from the log directory |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
926 |
popd |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
927 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
928 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
929 |
:: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
1537
c9aea063a34e
Issue: #172 StX fails to start on Windows when launcher script is run from different directory
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1527
diff
changeset
|
930 |
:: Next section follows |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
931 |
:: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
932 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
933 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
934 |
:: ******************************************************************************************* |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
935 |
:: Running the command * |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
936 |
:: ******************************************************************************************* |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
937 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
938 |
:: ================================= |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
939 |
:: Preparing command for execution = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
940 |
:: ================================= |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
941 |
IF "!stx.__binary.record_log_file!"=="TRUE" ( |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
942 |
REM -WindowStyle Normal Sets the window style to Normal, Minimized, Maximized or Hidden. |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
943 |
REM -NoProfile - launches without a profile |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
944 |
REM -ExecutionPolicy Bypass - does not ask for passwords if used privileged command. |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
945 |
SET exec_command$=CALL !powershell_exec! -WindowStyle Normal -nologo -noninteractive -NoProfile -ExecutionPolicy Bypass -Command "& {!powershell_script_file! -executable '!smalltalk_executable:"=!' -log_file '!stx.log_directory:"=!!log_filename:"=!' -log_file_encoding '!stx.log_file_encoding!' -append_to_log '!stx.__binary.append_to_log!' -cmd_close '!cmd_close!' -PowerShellVersion '!PowerShellVersion!' -cmd_in_powershell '!stx.__binary.cmd_in_powershell!' -stx_manual_switch_detected '!stx_manual_switch_detected!'};" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
946 |
) ELSE ( |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
947 |
ECHO: |
1515 | 948 |
CALL :print_message !use_color! !stx.stdout_WarningBackgroundColor! !stx.stdout_WarningForegroundColor! "[WARN] NO LOGGING" |
949 |
ECHO: |
|
950 |
CALL :print_message !use_color! !stx.stdout_VerboseBackgroundColor! !stx.stdout_VerboseForegroundColor! "[INFO] User disabled or limitation applies." "[INFO] Executing: cmd.exe !cmd_close:"=! CALL !smalltalk_executable:"=! !stx_switch!" |
|
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
951 |
SET "exec_command$=cmd.exe !cmd_close! CALL !smalltalk_executable:"=! !stx_switch!" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
952 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
953 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
954 |
:: =========== |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
955 |
:: Execution = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
956 |
:: =========== |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
957 |
:: An alternative working too |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
958 |
REM START /B /W !exec_command$! |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
959 |
|
1537
c9aea063a34e
Issue: #172 StX fails to start on Windows when launcher script is run from different directory
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1527
diff
changeset
|
960 |
:: An alternatives NOT working properly (for unknown reason) - as a warning |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
961 |
REM ECHO " "exec: !%exec_command%!" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
962 |
REM CALL %%exec_command%% |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
963 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
964 |
:: Calling the dynamic variable exec_command$ this way works 100% |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
965 |
:: The suffix $ at the variable is to make sure there is no variable collision with the current environment |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
966 |
CALL !exec_command$! |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
967 |
:: To view error level even from PowerShell |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
968 |
:: ECHO "Errorlevel: !errorlevel!" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
969 |
:: PAUSE |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
970 |
IF NOT "%ERRORLEVEL%"=="0" ( |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
971 |
SET "message="The command !exec_command$! was executed incorrectly."" |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
972 |
SET "__numeric.exit_value=1" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
973 |
CALL :exit_sequence !message! |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
974 |
GOTO :EOF |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
975 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
976 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
977 |
:: ================================== |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
978 |
:: Correctly ending the application = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
979 |
:: ================================== |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
980 |
IF "__binary.close_shell"=="FALSE" ( |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
981 |
ECHO: |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
982 |
IF "!use_color!"=="TRUE" ( |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
983 |
CALL :printInColor !stx.stdout_VerboseBackgroundColor! !stx.stdout_VerboseForegroundColor! "[INFO] End. Waiting till final exit." |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
984 |
) ELSE ( |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
985 |
ECHO "[INFO] End. Waiting till final exit." |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
986 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
987 |
PAUSE |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
988 |
) ELSE ( |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
989 |
ECHO: |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
990 |
IF "!use_color!"=="TRUE" ( |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
991 |
CALL :printInColor !stx.stdout_VerboseBackgroundColor! !stx.stdout_VerboseForegroundColor! "[INFO] End. Exiting correctly." |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
992 |
) ELSE ( |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
993 |
ECHO "[INFO] End. Exiting correctly." |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
994 |
) |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
995 |
IF "!stx.__binary.use_timer!"=="TRUE" ( |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
996 |
REM =========================== |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
997 |
REM End timer and show result = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
998 |
REM =========================== |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
999 |
CALL :time_in_seconds __end |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1000 |
ECHO "[INFO] timer end. Duration: !__end! [seconds]" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1001 |
ECHO: |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1002 |
SET /A "_elapsed=!__end!-!__start!" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1003 |
ECHO "[INFO] Timer: !_elapsed! seconds." |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1004 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1005 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1006 |
ENDLOCAL |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1007 |
EXIT /B 0 |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1008 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1009 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1010 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1011 |
:: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
1537
c9aea063a34e
Issue: #172 StX fails to start on Windows when launcher script is run from different directory
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1527
diff
changeset
|
1012 |
:: Next section follows |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1013 |
:: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1014 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1015 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1016 |
:: ******************************************************************************************* |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1017 |
:: User defined functions * |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1018 |
:: ******************************************************************************************* |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1019 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1020 |
:exit_sequence |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1021 |
IF NOT "!__numeric.exit_value!"=="0" ( |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1022 |
IF NOT "%~1"=="" ( |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1023 |
ECHO: |
1515 | 1024 |
CALL :print_message !use_color! !stx.stdout_ErrorForegroundColor! !stx.stdout_ErrorBackgroundColor! "[ERROR] "%1"" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1025 |
) |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1026 |
IF NOT "%~2"=="" ( |
1515 | 1027 |
CALL :print_message !use_color! !stx.stdout_ErrorForegroundColor! !stx.stdout_ErrorBackgroundColor! "[ERROR] "%2"" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1028 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1029 |
ECHO: |
1515 | 1030 |
CALL :print_message !use_color! !stx.stdout_ErrorForegroundColor! !stx.stdout_ErrorBackgroundColor! "[ERROR] Exiting with error. Script __numeric.exit_value: !__numeric.exit_value!." "[ERROR] Batch errorlevel: !ERRORLEVEL!" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1031 |
PAUSE |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1032 |
REM Cleanup namespace stx. |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1033 |
REM nul redirection stops error output if no stx. var is set |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1034 |
FOR /F "tokens=1 delims==" %%V IN ('SET stx. 2^>NUL') DO ( |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1035 |
SET "%%V=" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1036 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1037 |
REM Deallocate variables |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1038 |
ENDLOCAL |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1039 |
EXIT /B 1 |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1040 |
) ELSE ( |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1041 |
ECHO: |
1515 | 1042 |
CALL :print_message !use_color! !stx.stdout_VerboseBackgroundColor! !stx.stdout_VerboseForegroundColor! "[INFO] Exiting correctly." |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1043 |
REM Cleanup namespace stx. |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1044 |
REM nul redirection stops error output if no stx. var is set |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1045 |
FOR /F "tokens=1 delims==" %%V IN ('SET stx. 2^>NUL') DO ( |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1046 |
SET "%%V=" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1047 |
) |
1537
c9aea063a34e
Issue: #172 StX fails to start on Windows when launcher script is run from different directory
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1527
diff
changeset
|
1048 |
|
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1049 |
call :cleanupColorPrint |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1050 |
REM Deallocate variables |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1051 |
ENDLOCAL |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1052 |
EXIT /B 0 |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1053 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1054 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1055 |
:: ============================= |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1056 |
:: Detect available powershell = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1057 |
:: ============================= |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1058 |
:powershell_detection |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1059 |
|
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1060 |
SET "registry_path="HKLM\SOFTWARE\Microsoft\PowerShell"" |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1061 |
SET "latest_powershell_version=0" |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1062 |
SET "runtime_version=""" |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1063 |
SET /A "counter=1" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1064 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1065 |
:: Check if registry path to PowerShell exists |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1066 |
REG QUERY !registry_path!>NUL |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1067 |
IF /I NOT "!ERRORLEVEL!"=="0" ( |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1068 |
ECHO: |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1069 |
ECHO "[ERROR] Registry path: !registry_path! does not exist." |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1070 |
ECHO "[ERROR] Powershell NOT detected." |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1071 |
SET "powershell_detected=FALSE" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1072 |
GOTO end_powershell_detection |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1073 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1074 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1075 |
:: ~ expands the given variable |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1076 |
:: The ^ escapes (protects) the pipe during the initial batch parsing. |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1077 |
:: double %% is there as holder for FOR. |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1078 |
:: :"= replaces all the double quotes in the variable with nothing |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1079 |
:: The '\\' in regexp is included for WindowsXP compatibility - req query returns also its version in the query |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1080 |
(FOR /F "delims=" %%A IN ('REG QUERY "!registry_path!" ^| FINDSTR "^.*\\[0-9]$"') DO ( |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1081 |
REM "ECHO "DEBUG:__PowerShellRegistryVersion.!counter!=%%~A" |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1082 |
SET "__PowerShellRegistryVersion.!counter!=%%~A" |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1083 |
SET /A "counter+=1" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1084 |
)) || REM |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1085 |
IF ERRORLEVEL 1 ( |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1086 |
ECHO: |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1087 |
ECHO "[ERROR] Query: REG QUERY "!registry_path!" ^| FINDSTR "^.*\\[0-9]$" probably error in registry." |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1088 |
SET "powershell_detected=FALSE" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1089 |
PAUSE |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1090 |
GOTO end_powershell_detection |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1091 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1092 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1093 |
:: Found powershell registry token=2* takes 'counter=registry path'. delims== selects everything right of "="; ending with only registry path. |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1094 |
(FOR /F "tokens=2* delims==" %%A IN ('SET __PowerShellRegistryVersion.') DO ( |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1095 |
(FOR /F "tokens=3" %%R IN ('REG QUERY %%~A /v Install ^| FIND "Install"') DO ( |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1096 |
SET "PowerShellInstalled=%%~R" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1097 |
)) || REM |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1098 |
IF ERRORLEVEL 1 ( |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1099 |
ECHO: |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1100 |
ECHO "[ERROR] Query: REG QUERY "REG QUERY %%~A /v Install ^| FIND "Install" did not find any Install key. probably error in registry." |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1101 |
SET "powershell_detected=FALSE" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1102 |
PAUSE |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1103 |
GOTO end_powershell_detection |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1104 |
) |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1105 |
IF NOT "!PowerShellInstalled!"=="0x1" ( |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1106 |
ECHO: |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1107 |
ECHO "[INFO] The PowerShell PSCompatibleVersion ^(1.0 or 2.0^) is not installed." |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1108 |
SET "powershell_detected=FALSE" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1109 |
GOTO end_powershell_detection |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1110 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1111 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1112 |
(FOR /F "tokens=3" %%P IN ('REG QUERY "%%~A\PowerShellEngine" /v PowerShellVersion ^| FIND "PowerShellVersion"') DO ( |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1113 |
SET "PowerShellVersion=%%~P" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1114 |
)) || REM |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1115 |
IF ERRORLEVEL 1 ( |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1116 |
ECHO: |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1117 |
ECHO "[ERROR] Query: REG QUERY "REG QUERY "%%~A\PowerShellEngine" /v PowerShellVersion ^| FIND "PowerShellVersion"" did not find any PowerShellVersion key. probably error in registry." |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1118 |
SET "powershell_detected=FALSE" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1119 |
PAUSE |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1120 |
GOTO end_powershell_detection |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1121 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1122 |
REM GEQ - greater than or equal |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1123 |
IF "!PowerShellVersion!" GEQ "!minimal_powershell_version!" ( |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1124 |
SET "powershell_detected=TRUE" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1125 |
) ELSE ( |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1126 |
SET "powershell_detected=FALSE" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1127 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1128 |
|
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1129 |
FOR /F "tokens=3" %%V IN ('REG QUERY "%%~A\PowerShellEngine" /v RuntimeVersion ^| FIND "RuntimeVersion"') DO SET "RuntimeVersion=%%~V" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1130 |
IF "!latest_powershell_version!" LSS "!PowerShellVersion!" ( |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1131 |
SET "latest_powershell_version=!PowerShellVersion!" |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1132 |
SET "runtime_version=!RuntimeVersion!" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1133 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1134 |
)) || REM |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1135 |
IF ERRORLEVEL 1 ( |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1136 |
ECHO: |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1137 |
ECHO "[ERROR] Command SET __PowerShellRegistryVersion. Something wrong with your shell (command prompt)." |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1138 |
SET "powershell_detected=FALSE" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1139 |
PAUSE |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1140 |
GOTO end_powershell_detection |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1141 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1142 |
|
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1143 |
IF "!powershell_detected!"=="TRUE" ( |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1144 |
ECHO: |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1145 |
ECHO "[INFO] PowerShell detected: ->!powershell_detected!<-. |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1146 |
ECHO "[INFO] The latest latest_powershell_version found: !latest_powershell_version!." |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1147 |
ECHO "[INFO] With the runtime being: !runtime_version!." |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1148 |
) ELSE ( |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1149 |
ECHO: |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1150 |
ECHO "[INFO] PowerShell NOT detected. Fallback mode activated. |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1151 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1152 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1153 |
:end_powershell_detection |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1154 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1155 |
SET "%~1=!powershell_detected!" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1156 |
SET "%~2=!latest_powershell_version!" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1157 |
SET "%~3=!runtime_version!" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1158 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1159 |
EXIT /B |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1160 |
|
1517 | 1161 |
:: ================== |
1162 |
:: Create user menu = |
|
1163 |
:: ================== |
|
1164 |
:user_menu |
|
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1165 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1166 |
:: Normal path can be with or without double quotes. If the path contains spaces it must be enclosed by double quotes. |
1517 | 1167 |
SET "input_image_path=%~1" |
1168 |
SET "input_image_suffix=%~3" |
|
1169 |
||
1170 |
:: Init |
|
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1171 |
SET /A "counter_get_answer=1" |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1172 |
SET /A "counter_get_file=1" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1173 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1174 |
:: %%A - double %% due to FOR loop and %A as an array |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1175 |
:: within FOR filename with suffix: %%~nxA |
1537
c9aea063a34e
Issue: #172 StX fails to start on Windows when launcher script is run from different directory
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1527
diff
changeset
|
1176 |
:: For does not change ERRORLEVEL but uses exit_code for more see: http://stackoverflow.com/questions/34987885/what-are-the-errorlevel-values-set-by-internal-cmd-exe-commands |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1177 |
:: However, the '|| REM' trick captures the ERRORLEVEL from the DIR executed as for command. |
1517 | 1178 |
:: -DN - order by date (the newest first) and in alphabetic order |
1179 |
ECHO "--------------- User input ------------------------------------------------------------------------------------" |
|
1180 |
ECHO "Select your stx image (sorted from the newest; if files of same then alphabetic order is used):" |
|
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1181 |
ECHO: |
1517 | 1182 |
(FOR /F "delims=" %%A IN ('dir !input_image_path!^*^.!input_image_suffix! /B /O^:-DN 2^>NUL') DO ( |
1183 |
SET "__stx_image_path.%counter_get_answer%=%%~dpnxA" |
|
1184 |
ECHO "[!counter_get_answer!] => !__stx_image_path.%counter_get_answer%! |
|
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1185 |
SET /A "counter_get_answer+=1" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1186 |
)) || REM |
1517 | 1187 |
IF ERRORLEVEL 1 ( |
1188 |
ECHO "No files with mask !input_image_path:"=!^*^.!input_image_suffix:"=!" |
|
1189 |
ECHO "Will exit now." |
|
1190 |
PAUSE |
|
1191 |
REM This is a "trick" to exit directly the function |
|
1192 |
REM (GOTO) 2^^>NUL behaves nearly same as exit /B but executes the block behind it |
|
1193 |
(GOTO) 2>NUL & ENDLOCAL & EXIT /B |
|
1194 |
) |
|
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1195 |
ECHO: |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1196 |
ECHO "[0] Exit" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1197 |
ECHO: |
1517 | 1198 |
ECHO "---------------------------------------------------------------------------------------------------------------" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1199 |
ECHO: |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1200 |
|
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1201 |
SET /P "user_input="Enter a choice: "" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1202 |
:: ----------------------------- |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1203 |
:: prevent hijacking the input - |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1204 |
:: ----------------------------- |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1205 |
:: ECHO "DEBUG: .!user_input!. |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1206 |
:: ECHO "DEBUG: strip quotes: .!user_input:"=!. |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1207 |
SET "user_input=!user_input:"=!" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1208 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1209 |
:: If you really want to reject the variable with any quotation mark... |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1210 |
:: FIND /V- Displays all lines NOT containing the specified string. |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1211 |
SET user_input | FIND /V """" >NUL |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1212 |
IF ERRORLEVEL 1 ( |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1213 |
SET "user_input=" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1214 |
ECHO "[ERROR] You are trying to hijack the input. Exiting." |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1215 |
ECHO "[ERROR] Batch errorlevel: !ERRORLEVEL!" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1216 |
PAUSE |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1217 |
REM This is a "trick" to exit directly the function |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1218 |
REM (GOTO) 2^^>NUL behaves nearly same as exit /B but executes the block behind it |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1219 |
(GOTO) 2>NUL & ENDLOCAL & EXIT /B 1 |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1220 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1221 |
:: --------------------------------- |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1222 |
:: END prevent hijacking the input - |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1223 |
:: --------------------------------- |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1224 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1225 |
:: User choose to exit |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1226 |
IF "!user_input!"=="0" ( |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1227 |
ECHO "[INFO] You have selected to exit voluntary. Goodbye." |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1228 |
(GOTO) 2>NUL & ENDLOCAL & EXIT /B 0 |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1229 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1230 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1231 |
REM A solution for unknown number of options at the time asking the question |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1232 |
REM ugh must not be used anywhere else! |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1233 |
REM Verification that user has entered a number from the given selection |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1234 |
SET "ugh="&FOR /F "delims=0123456789" %%I IN ("!user_input!") DO SET "ugh=%%~I" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1235 |
IF defined ugh ( |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1236 |
ECHO: |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1237 |
ECHO "[INFO] The input -> !user_input! <- was outside the given choices." |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1238 |
SET "ugh=" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1239 |
PAUSE |
1517 | 1240 |
GOTO user_menu |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1241 |
) ELSE ( |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1242 |
IF "!user_input!" GTR "0" ( |
1517 | 1243 |
IF "!user_input!" LSS "!counter_get_answer!" ( |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1244 |
REM ECHO "DEBUG: Your answer is: -> %user_input% <-." |
1517 | 1245 |
SET "verified_user_input=!user_input!" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1246 |
) ELSE ( |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1247 |
ECHO: |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1248 |
ECHO "[INFO] The input2 -> !user_input! <- was outside the given choices." |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1249 |
PAUSE |
1517 | 1250 |
GOTO user_menu |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1251 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1252 |
) ELSE ( |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1253 |
ECHO: |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1254 |
ECHO "[INFO] The input3 -> !user_input! <- was outside the given choices." |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1255 |
PAUSE |
1517 | 1256 |
GOTO user_menu |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1257 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1258 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1259 |
|
1517 | 1260 |
:: Getting path and file name from user answer |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1261 |
SET "stx_break=" |
1517 | 1262 |
(FOR /F "delims=" %%A IN ('dir !input_image_path!^*^.!input_image_suffix! /B /O^:-DN 2^>NUL') DO IF NOT DEFINED stx_break ( |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1263 |
IF "!verified_user_input!"=="!counter_get_file!" ( |
1517 | 1264 |
SET "__stx_image_path="%%~dpnxA"" |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1265 |
SET "stx_break=yes" |
1517 | 1266 |
) ELSE IF "!counter_get_answer!" LSS "!counter_get_file!" ( |
1518
2d2ecaa57521
version 1.5.0 Removing unneeded variable (in menu) and adding error message for user
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1517
diff
changeset
|
1267 |
SET "__stx_image_path="Unknown path"" |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1268 |
SET "stx_break=yes" |
1517 | 1269 |
) |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1270 |
SET /A "counter_get_file+=1" |
1517 | 1271 |
)) || REM |
1272 |
IF ERRORLEVEL 1 ( |
|
1273 |
ECHO "Error converting the user answer ->!verified_user_input! to path." |
|
1274 |
PAUSE |
|
1275 |
REM This is a "trick" to exit directly the function |
|
1276 |
REM (GOTO) 2^^>NUL behaves nearly same as exit /B but executes the block behind it |
|
1277 |
(GOTO) 2>NUL & ENDLOCAL & EXIT /B |
|
1278 |
) |
|
1279 |
:: Clearing |
|
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1280 |
SET "stx_break=" |
1517 | 1281 |
|
1282 |
SET "%2=!__stx_image_path!" |
|
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1283 |
SET "__stx_image_path=" |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1284 |
SET "verified_user_input=" |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1285 |
SET "input_image_path=" |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1286 |
SET "input_image_suffix=" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1287 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1288 |
EXIT /B |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1289 |
|
1517 | 1290 |
:: ====================================== |
1291 |
:: Printing stdout messages with colors = |
|
1292 |
:: ====================================== |
|
1515 | 1293 |
:print_message |
1294 |
SET "use_color=%1" |
|
1295 |
SET "stdout_VerboseBackgroundColor=%2" |
|
1296 |
SET "stdout_VerboseForegroundColor=%3" |
|
1517 | 1297 |
|
1515 | 1298 |
SET "message1=%4" |
1299 |
SET "message2=%5" |
|
1300 |
SET "message3=%6" |
|
1524
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1301 |
|
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1302 |
IF "%use_color%"=="TRUE" ( |
1515 | 1303 |
IF DEFINED message1 ( |
1304 |
CALL :printInColor %stdout_VerboseBackgroundColor% %stdout_VerboseForegroundColor% %message1% |
|
1305 |
) ELSE ( |
|
1306 |
CALL :printInColor %stdout_VerboseBackgroundColor% %stdout_VerboseForegroundColor% "[ERROR] No message defined." |
|
1307 |
) |
|
1308 |
IF DEFINED message2 ( |
|
1309 |
CALL :printInColor %stdout_VerboseBackgroundColor% %stdout_VerboseForegroundColor% %message2% |
|
1310 |
IF DEFINED message3 ( |
|
1311 |
CALL :printInColor %stdout_VerboseBackgroundColor% %stdout_VerboseForegroundColor% %message2% |
|
1312 |
) |
|
1313 |
) |
|
1314 |
) ELSE ( |
|
1315 |
IF DEFINED message1 ( |
|
1316 |
ECHO "%message1%" |
|
1317 |
) ELSE ( |
|
1318 |
ECHO "[ERROR] No message defined." |
|
1319 |
) |
|
1320 |
IF DEFINED message2 ( |
|
1321 |
ECHO "%message2%" |
|
1322 |
IF DEFINED message3 ( |
|
1323 |
ECHO "%message3%" |
|
1324 |
) |
|
1325 |
) |
|
1326 |
) |
|
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1327 |
GOTO :EOF |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1328 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1329 |
:: ====================================== |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1330 |
:: Native Shell coloring for Windows 10 = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1331 |
:: ====================================== |
1517 | 1332 |
:: just stub - NOT FINISHED!!! |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1333 |
:printInColorWin10 |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1334 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1335 |
:: Windows 10 detection |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1336 |
::FOR /F "tokens=2 delims=[" %%I IN ('ver') DO ( |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1337 |
:: ECHO %%I |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1338 |
:: FOR /F "tokens=2-3 delims=. " %%V IN ("%%I") DO ( |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1339 |
:: SET version=%%V.%%W |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1340 |
:: IF "!version!" LSS "10.0" ( |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1341 |
:: ECHO "Older windows than Windows 10" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1342 |
:: ) ELSE ( |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1343 |
:: ECHO "Windows 10 or newer" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1344 |
:: ) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1345 |
:: ) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1346 |
::) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1347 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1348 |
:: ANSI Colors for Windows 10 |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1349 |
REM ECHO [101;93m STYLES [0m |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1350 |
REM ECHO ^<ESC^>[0m [0mReset[0m |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1351 |
REM ECHO ^<ESC^>[1m [1mBold[0m |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1352 |
REM ECHO ^<ESC^>[4m [4mUnderline[0m |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1353 |
REM ECHO ^<ESC^>[7m [7mInverse[0m |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1354 |
REM ECHO. |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1355 |
REM ECHO [101;93m NORMAL FOREGROUND COLORS [0m |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1356 |
REM ECHO ^<ESC^>[30m [30mBlack[0m (black) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1357 |
REM ECHO ^<ESC^>[31m [31mRed[0m |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1358 |
REM ECHO ^<ESC^>[32m [32mGreen[0m |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1359 |
REM ECHO ^<ESC^>[33m [33mYellow[0m |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1360 |
REM ECHO ^<ESC^>[34m [34mBlue[0m |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1361 |
REM ECHO ^<ESC^>[35m [35mMagenta[0m |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1362 |
REM ECHO ^<ESC^>[36m [36mCyan[0m |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1363 |
REM ECHO ^<ESC^>[37m [37mWhite[0m |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1364 |
REM ECHO. |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1365 |
REM ECHO [101;93m NORMAL BACKGROUND COLORS [0m |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1366 |
REM ECHO ^<ESC^>[40m [40mBlack[0m |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1367 |
REM ECHO ^<ESC^>[41m [41mRed[0m |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1368 |
REM ECHO ^<ESC^>[42m [42mGreen[0m |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1369 |
REM ECHO ^<ESC^>[43m [43mYellow[0m |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1370 |
REM ECHO ^<ESC^>[44m [44mBlue[0m |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1371 |
REM ECHO ^<ESC^>[45m [45mMagenta[0m |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1372 |
REM ECHO ^<ESC^>[46m [46mCyan[0m |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1373 |
REM ECHO ^<ESC^>[47m [47mWhite[0m (white) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1374 |
REM ECHO. |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1375 |
REM ECHO [101;93m STRONG FOREGROUND COLORS [0m |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1376 |
REM ECHO ^<ESC^>[90m [90mWhite[0m |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1377 |
REM ECHO ^<ESC^>[91m [91mRed[0m |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1378 |
REM ECHO ^<ESC^>[92m [92mGreen[0m |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1379 |
REM ECHO ^<ESC^>[93m [93mYellow[0m |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1380 |
REM ECHO ^<ESC^>[94m [94mBlue[0m |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1381 |
REM ECHO ^<ESC^>[95m [95mMagenta[0m |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1382 |
REM ECHO ^<ESC^>[96m [96mCyan[0m |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1383 |
REM ECHO ^<ESC^>[97m [97mWhite[0m |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1384 |
REM ECHO. |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1385 |
REM ECHO [101;93m STRONG BACKGROUND COLORS [0m |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1386 |
REM ECHO ^<ESC^>[100m [100mBlack[0m |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1387 |
REM ECHO ^<ESC^>[101m [101mRed[0m |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1388 |
REM ECHO ^<ESC^>[102m [102mGreen[0m |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1389 |
REM ECHO ^<ESC^>[103m [103mYellow[0m |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1390 |
REM ECHO ^<ESC^>[104m [104mBlue[0m |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1391 |
REM ECHO ^<ESC^>[105m [105mMagenta[0m |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1392 |
REM ECHO ^<ESC^>[106m [106mCyan[0m |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1393 |
REM ECHO ^<ESC^>[107m [107mWhite[0m |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1394 |
REM ECHO. |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1395 |
REM ECHO [101;93m COMBINATIONS [0m |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1396 |
REM ECHO ^<ESC^>[31m [31mred foreground color[0m |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1397 |
REM ECHO ^<ESC^>[7m [7minverse foreground ^<-^> background[0m |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1398 |
REM ECHO ^<ESC^>[7;31m [7;31minverse red foreground color[0m |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1399 |
REM ECHO ^<ESC^>[7m and nested ^<ESC^>[31m [7mbefore [31mnested[0m |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1400 |
REM ECHO ^<ESC^>[31m and nested ^<ESC^>[7m [31mbefore [7mnested[0m |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1401 |
GOTO :EOF |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1402 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1403 |
:: ============================================ |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1404 |
:: Coloring of information text in Batch file = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1405 |
:: ============================================ |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1406 |
:: There is no native support for ANSI colors on the console till Windows 10 (excluded). |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1407 |
:: It is rather tricky to color only one line just via CMD - any hack does not work properly with this complex batch file |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1408 |
:: The best way till Windows 10 is actually to use PowerShell! In Windows 10 the proper use is to use native ANSI colors (not done yet). |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1409 |
:printInColor |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1410 |
SET "background=%1" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1411 |
SET "foreground=%2" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1412 |
SET "message=%3" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1413 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1414 |
REM Message was "'%*'" but now since we are passing colors we have to limit it |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1415 |
:: Saves original color and then sets the new color for the message |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1416 |
SET long_command= ^ |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1417 |
$window_private_data = (Get-Host).PrivateData;^ |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1418 |
$saved_background_color = $window_private_data.VerboseBackgroundColor;^ |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1419 |
$saved_foreground_color = $window_private_data.VerboseForegroundColor;^ |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1420 |
$window_private_data.VerboseBackgroundColor = "'%background%'";^ |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1421 |
$window_private_data.VerboseForegroundColor = "'%foreground%'";^ |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1422 |
Write-Verbose -Message "'%message%'" -Verbose;^ |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1423 |
$window_private_data.VerboseBackgroundColor = $saved_background_color;^ |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1424 |
$window_private_data.VerboseForegroundColor = $saved_foreground_color; |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1425 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1426 |
CALL powershell -nologo -noninteractive -NoProfile -ExecutionPolicy Bypass -Command %long_command% |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1427 |
GOTO :EOF |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1428 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1429 |
:time_in_seconds |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1430 |
FOR /F %%A IN ('wmic os get LocalDateTime ^| find "."') DO ( |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1431 |
SET "dts=%%A" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1432 |
REM Issue with octal representation (08 and 09 are invalid octal representation and others are too but are accepted) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1433 |
REM Workaround implemented below: |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1434 |
IF "!dts:~8,1!"=="0" ( |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1435 |
SET "hours=!dts:~9,1!" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1436 |
) ELSE ( |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1437 |
SET "hours=!dts:~8,2!" |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1438 |
) |
1550
df383905babc
Win32 launcher (v 1.6.5): fixing batch code iregularietes after adding double quotes (especially with ^%%A etc.)
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1549
diff
changeset
|
1439 |
SET /A _time_in_seconds=!hours!*3600^ |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1440 |
+!dts:~10,1!*10*60^ |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1441 |
+!dts:~11,1!*60^ |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1442 |
+!dts:~12,1!*10^ |
1550
df383905babc
Win32 launcher (v 1.6.5): fixing batch code iregularietes after adding double quotes (especially with ^%%A etc.)
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1549
diff
changeset
|
1443 |
+!dts:~13,1! >nul |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1444 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1445 |
SET "%~1=!_time_in_seconds!" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1446 |
GOTO :EOF |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1447 |
|
1516 | 1448 |
|
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1449 |
:: ============================================= |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1450 |
:: Expanding variables from configuration file = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1451 |
:: ============================================= |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1452 |
:: Must be last in this section |
1516 | 1453 |
:expand_path |
1454 |
SET "%2=%1" |
|
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1455 |
GOTO :EOF |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1456 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1457 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1458 |
REM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
1537
c9aea063a34e
Issue: #172 StX fails to start on Windows when launcher script is run from different directory
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1527
diff
changeset
|
1459 |
REM Next section follows |
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1460 |
REM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1461 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1462 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1463 |
:: ******************************************************************************************* |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1464 |
:: Support information (like help, about, version) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1465 |
:: ******************************************************************************************* |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1466 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1467 |
:: ============== |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1468 |
:: Help section = |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1469 |
:: ============== |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1470 |
:stx_help |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1471 |
IF EXIST "stx-bin.com" ( |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1472 |
CALL stx-bin.com --help |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1473 |
) ELSE IF EXIST "stx.com" ( |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1474 |
CALL stx.com --help |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1475 |
) ELSE ( |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1476 |
ECHO "[WARN] The executable stx-bin.^(com^|exe^) or stx.^(com^|exe^) NOT found."" |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1477 |
ECHO "[WARN] Exiting with error. Script __numeric.exit_value: 1." |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1478 |
PAUSE |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1479 |
GOTO :EOF |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1480 |
) |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1481 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1482 |
GOTO :EOF |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1483 |
|
1524
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1484 |
:stx_help_launcher |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1485 |
ECHO ==================== |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1486 |
ECHO The configuration: = |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1487 |
ECHO ==================== |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1488 |
ECHO Note: The configuration is done via .cfg file. The only configuration that can be done in the batch file |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1489 |
ECHO is for the configuration file itself. You can change the configuration path via configuration_file_path variable |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1490 |
ECHO and the configuration file name via configuration_file variable. |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1491 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1492 |
ECHO Note2: Notice that Microsoft is using Unicode as an alias for UTF16 (which is wrong but we have to deal with it). |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1493 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1494 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1495 |
ECHO ====================================== |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1496 |
ECHO The features of this advanced script = |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1497 |
ECHO ====================================== |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1498 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1499 |
ECHO -- Quick start (with close or leave open the shell after Smalltalk start) |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1500 |
ECHO -- Starting with default image on defined path |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1501 |
ECHO -- Starting with any image (user is prompted to select one via menu) on defined path |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1502 |
ECHO -- Logging into a file - either overwrite or append at start start (minimal PowerShell 2.0 is required) |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1503 |
ECHO - User can change the log file encoding to ASCII, UTF8 (default), UTF16, UTF32 |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1504 |
ECHO - User can decide if he wants a date and/or time part added to the log file |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1505 |
ECHO -- The script automatically detects PowerShell version and based on that decides which functionality will be available. |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1506 |
ECHO -- Error handling on the batch and PowerShell level - user is informed about the details of error |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1507 |
ECHO -- Batch file tries to exit gracefully, if possible |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1508 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1509 |
ECHO The advanced features: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1510 |
ECHO -- A warning limit is in place for the log file size. If it gets too large as it may slowdown the Smalltalk. |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1511 |
ECHO -- User can decide if there will be a shell opened for error messages or if Smalltalk will for from shell and |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1512 |
ECHO will not display any messages on the command prompt. |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1513 |
ECHO -- User can choose if the validation process is active and if the successful message is shown. |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1514 |
ECHO -- User can choose which redirect will be used in PowerShell - if the native one or cmd.exe one (little bit faster in most cases). |
1541
29481e235399
Win32 launcher (v 1.6.0): added System.Diagnostics.ProcessStartInfo for manual exection an dother fixes
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1540
diff
changeset
|
1515 |
ECHO -- When user enters his own switches then manual switches feature is used. Now the powershell uses System.Diagnostics.ProcessStartInfo |
29481e235399
Win32 launcher (v 1.6.0): added System.Diagnostics.ProcessStartInfo for manual exection an dother fixes
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1540
diff
changeset
|
1516 |
ECHO -- object to execute the stx executable. It brings two benefits: |
29481e235399
Win32 launcher (v 1.6.0): added System.Diagnostics.ProcessStartInfo for manual exection an dother fixes
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1540
diff
changeset
|
1517 |
ECHO -- a) stdout and stderrr are independent and asynchronous from the executable |
29481e235399
Win32 launcher (v 1.6.0): added System.Diagnostics.ProcessStartInfo for manual exection an dother fixes
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1540
diff
changeset
|
1518 |
ECHO -- b) all output is recorded correctly into the log file. |
1524
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1519 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1520 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1521 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1522 |
ECHO ------------------------------------------------------------------------------------------- |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1523 |
ECHO User settings |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1524 |
ECHO ------------------------------------------------------------------------------------------- |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1525 |
ECHO: =================== |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1526 |
ECHO Stx bin directory = |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1527 |
ECHO =================== |
1537
c9aea063a34e
Issue: #172 StX fails to start on Windows when launcher script is run from different directory
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1527
diff
changeset
|
1528 |
ECHO Setting: stx_bin_dir - |
1524
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1529 |
ECHO Impact: defines the directory containing the executable |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1530 |
ECHO Note: do not forget the last backslash ^(\^) and double quotes when changing to custom path |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1531 |
ECHO stx_bin_dir="%~dp0" |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1532 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1533 |
ECHO =================================== |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1534 |
ECHO Stx quick start and image details = |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1535 |
ECHO =================================== |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1536 |
ECHO Setting: __binary.stx_quick_start |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1537 |
ECHO Impact: Uses flags --ignoreImage and --quick start to start StX as fast as possible |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1538 |
ECHO TRUE - switches on the quick start |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1539 |
ECHO FALSE - skips this option |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1540 |
ECHO __binary.stx_quick_start=FALSE |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1541 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1542 |
ECHO Setting: image_path, image_name, image_suffix |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1543 |
ECHO Impact: variables are self-explanatory |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1544 |
ECHO Note: do not forget the last backslash ^(\^) and double quotes when changing to custom path |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1545 |
ECHO image_path="%~dp0" |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1546 |
ECHO Setting: image_name - how should the default image be named |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1547 |
ECHO image_name="st" |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1548 |
ECHO image_suffix=".img" |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1549 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1550 |
ECHO Impact: Pair variables (affect each other):__binary.start_with_image and __binary.list_available_images |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1551 |
ECHO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1552 |
ECHO note: Before using image functionality check image path, name, and suffix |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1553 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1554 |
ECHO Setting: __binary.start_with_image |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1555 |
ECHO Impact: Stx starts (or not) with image. |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1556 |
ECHO TRUE - image functionality will be used |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1557 |
ECHO FALSE - image functionality ignored |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1558 |
ECHO __binary.start_with_image=FALSE |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1559 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1560 |
ECHO Setting: __binary.list_available_images |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1561 |
ECHO Impact: User menu is show when used; it shows all images within the directory (excluding subdirectories) and users selects one. |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1562 |
ECHO If switched off only default image (see image_path, image_name, image_suffix) is used. |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1563 |
ECHO Note: IF start_with_image=FALSE and list_available_images=TRUE then a warning message is shown and append_to_log is set to FALSE automatically) |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1564 |
ECHO TRUE - Switches on the user menu |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1565 |
ECHO FALSE - no interaction from user required |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1566 |
ECHO __binary.list_available_images=FALSE |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1567 |
ECHO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1568 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1569 |
ECHO ================= |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1570 |
ECHO Stx logging = |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1571 |
ECHO ================= |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1572 |
ECHO Impact: Pair variables (affect each other): __binary.record_log_file and __binary.append_to_log |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1573 |
ECHO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1574 |
ECHO Setting: __binary.record_log_file |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1575 |
ECHO Impact: Both standard output and standard error are redirected to a log file |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1576 |
ECHO Note: At least PowerShell 2.0 is required (WindowsXP and newer) |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1577 |
ECHO TRUE - turns on the logging functionality |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1578 |
ECHO FALSE - turns off the logging |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1579 |
ECHO __binary.record_log_file=TRUE |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1580 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1581 |
ECHO Setting: __binary.append_to_log |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1582 |
ECHO Impact: Appends the log file. Uses a PowerShell when appending. |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1583 |
ECHO Note: IF record_log_file=FALSE and append_to_log=TRUE then a warning message is shown and append_to_log is set to FALSE automatically) |
1537
c9aea063a34e
Issue: #172 StX fails to start on Windows when launcher script is run from different directory
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1527
diff
changeset
|
1584 |
ECHO TRUE - if log file is found it will be appended. If not a new one will be created |
1524
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1585 |
ECHO FALSE - the append functionality is turned off (the log file will be overwritten every time StX is executed) |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1586 |
ECHO __binary.append_to_log=TRUE |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1587 |
ECHO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1588 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1589 |
ECHO Setting: log_directory, log_name, log_suffix |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1590 |
ECHO Impact: Directory sets a log file directory (others are self-explanatory) |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1591 |
ECHO If a change would be done, double quotes must be present: e.g. "C:\prg_sdk\Stx_stable\" |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1592 |
ECHO Note: do not forget the last backslash ^(\^) and double quotes when changing to custom path |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1593 |
ECHO log_directory="%~dp0" |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1594 |
ECHO Setting: log_name sets name for log file |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1595 |
ECHO log_name="smalltalk" |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1596 |
ECHO log_suffix=".log" |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1597 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1598 |
ECHO Setting: __binary.log_add_datepart |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1599 |
ECHO Impact: Adds a date part based on ISO 8601 to the log file; format YYYY-MM-DD ('-' as a separator) |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1600 |
ECHO TRUE - Switch on this option |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1601 |
ECHO FALSE - Skips this option |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1602 |
ECHO __binary.log_add_datepart=TRUE |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1603 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1604 |
ECHO Setting: __binary.log_add_timepart |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1605 |
ECHO Impact: Adds a time part to the log file; format hh;mm;ss (non-ISO ';' as a separator) |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1606 |
ECHO Note: the ISO 8601 separator is not compatible with file-system) |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1607 |
ECHO TRUE - Switch on this option |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1608 |
ECHO FALSE - Skips this option |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1609 |
ECHO __binary.log_add_timepart=FALSE |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1610 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1611 |
ECHO Setting: log_file_encoding |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1612 |
ECHO Impact: Changes log file encoding |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1613 |
ECHO Allowed values ASCII, UTF8 (default), UTF16 (in Microsoft world that is called Unicode), UTF32 |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1614 |
ECHO Note: only UTF16 is using Tee-Object which enables you to have all the features the developer envisioned for the logging process |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1615 |
ECHO you can simultaneously see the output in shell, view the log file while using StX and have the wished encoding |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1616 |
ECHO all other encodings carry some limitation due to the powershell tools limitation |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1617 |
ECHO log_file_encoding=UTF8 |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1618 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1619 |
ECHO ================= |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1620 |
ECHO Stx shell = |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1621 |
ECHO ================= |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1622 |
ECHO Setting: __binary.close_shell |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1623 |
ECHO Impact: When set to TRUE closes the shell upon StX exit |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1624 |
ECHO TRUE - Switch on this option |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1625 |
ECHO FALSE - Skips this option |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1626 |
ECHO __binary.close_shell=TRUE |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1627 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1628 |
ECHO Setting: __binary.run_via_shell |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1629 |
ECHO Impact: start with shell (.com) or just the GUI without shell (.exe) |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1630 |
ECHO TRUE - uses stx.com executable |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1631 |
ECHO FALSE - uses stx.exe executable |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1632 |
ECHO __binary.run_via_shell=TRUE |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1633 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1634 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1635 |
ECHO ------------------------------------------------------------------------------------------- |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1636 |
ECHO Advanced user settings |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1637 |
ECHO ------------------------------------------------------------------------------------------- |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1638 |
ECHO ==================== |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1639 |
ECHO Validate variables = |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1640 |
ECHO ==================== |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1641 |
ECHO: Setting: verify_variables_syntax |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1642 |
ECHO Impact: Verifies the syntax of the batch file variables - e.g. batch file is very picky on spaces |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1643 |
ECHO TRUE - active validation |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1644 |
ECHO FALSE - inactive validation (NOT recommended) |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1645 |
ECHO verify_variables_syntax=TRUE |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1646 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1647 |
ECHO Setting: verify_print_message |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1648 |
ECHO Impact: shows message when the verification is complete |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1649 |
ECHO TRUE - Switch on this option |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1650 |
ECHO FALSE - message is not shown |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1651 |
ECHO verify_print_message=FALSE |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1652 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1653 |
ECHO ======================= |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1654 |
ECHO Log file size warning = |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1655 |
ECHO ======================= |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1656 |
ECHO Setting: __numeric.warning_logfile_size - Above what file size should a log file warning be shown? |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1657 |
ECHO Impact: If the limit is reached a warning message is shown to the user |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1658 |
ECHO Print user waring if the log file is getting too big - for 32MB in bytes |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1659 |
ECHO the bigger log-file, the slower the logging process gets |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1660 |
ECHO __numeric.warning_logfile_size=33554432 |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1661 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1662 |
ECHO ==================== |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1663 |
ECHO Stdout redirection = |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1664 |
ECHO ==================== |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1665 |
ECHO Setting: cmd_in_powershell |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1666 |
ECHO Impact: The cmd.exe redirection is faster even when called from powershell |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1667 |
ECHO There could be unforeseen issues with it so there is a switch (no manual switches are allowed) |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1668 |
ECHO When no colors are used then black background and gray foreground is used (warning messages are still highlighted) |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1669 |
ECHO When colors are used then the same color schema is used |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1670 |
ECHO TRUE - uses cmd.exe for redirecting output |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1671 |
ECHO FALSE - uses powershell for redirection (default) |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1672 |
ECHO __binary.cmd_in_powershell=TRUE |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1673 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1674 |
ECHO ============= |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1675 |
ECHO Start timer = |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1676 |
ECHO ============= |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1677 |
ECHO Setting: use_timer |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1678 |
ECHO Impact: Measures time between start of the script and correct ending. Measurement unit are seconds. |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1679 |
ECHO TRUE - uses timer |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1680 |
ECHO FALSE - switches off timer |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1681 |
ECHO __binary.use_timer=FALSE |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1682 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1683 |
ECHO ============== |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1684 |
ECHO Colored text = |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1685 |
ECHO ============== |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1686 |
ECHO Setting: colored_stdout |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1687 |
ECHO Impact: Will adjust based on the color setting the stdout output from both batch and powershell |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1688 |
ECHO note: in powershell there are default colors used when setting is is turned off (FALSE. |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1689 |
ECHO TRUE - uses colored output |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1690 |
ECHO FALSE - uses default colors available |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1691 |
ECHO __binary.colored_stdout=TRUE |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1692 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1693 |
ECHO =================== |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1694 |
ECHO Stdout text color = |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1695 |
ECHO =================== |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1696 |
ECHO colors that can be used |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1697 |
ECHO Black, DarkBlue, DarkGreen, DarkCyan, DarkRedDarkMagenta, DarkYellow, |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1698 |
ECHO Gray, DarkGray, Blue, Green, Cyan, Red, Magenta, Yellow, White |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1699 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1700 |
ECHO - verbose text (this is color used for normal usually [INFO] messages) |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1701 |
ECHO stdout_VerboseBackgroundColor=Black |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1702 |
ECHO stdout_VerboseForegroundColor=DarkGreen |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1703 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1704 |
ECHO - warning text |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1705 |
ECHO stdout_WarningBackgroundColor=Black |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1706 |
ECHO stdout_WarningForegroundColor=Yellow |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1707 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1708 |
ECHO - error |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1709 |
ECHO stdout_ErrorBackgroundColor=White |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1710 |
ECHO stdout_ErrorForegroundColor=Red |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1711 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1712 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1713 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1714 |
ECHO =================== |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1715 |
ECHO Known limitations = |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1716 |
ECHO =================== |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1717 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1718 |
ECHO 1) For any logging you need to have at least PowerShell 2.0 |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1719 |
ECHO 2) User menu searches only the log_directory. The subdirectories are excluded from the search (doable but the script is already too complex) |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1720 |
ECHO 3) When logging user can chose to use colors or not. If user does not wish to have custom color then no color for batch file and native colors in powershell are used. |
1537
c9aea063a34e
Issue: #172 StX fails to start on Windows when launcher script is run from different directory
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1527
diff
changeset
|
1721 |
ECHO 4) When using "pure" powershell redirection an error is shown at the start of the log file that is a bug in powershell (produces error: FullyQualifiedErrorId : NativeCommandError ) |
1524
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1722 |
ECHO The error can be ignored. |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1723 |
ECHO 5) The .lnk files are tested on Windows 7 SP1 (known to not work on Windows XP, you have to use the batch file directly.) |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1724 |
ECHO 6) When using CMD PowerShell mode manual (user) switches can not be used. When used the batch file forces CMD only mode. |
1542
0f3705d5dca6
Win32 launcher (v 1.6.1): fixing stx_version_default value and adding information to version
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1541
diff
changeset
|
1725 |
ECHO 7) The launcher can have issues with double-quotes and quotes within - escape them when needed - e.g. use double double quotes to escape |
1549
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1726 |
ECHO 8) Issues with the "!" character to add it you have to use escape ^ character e.g. --eval "Transcript showCR: 'Bang^^^!'." |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1727 |
ECHO 9) Any switch containing question mark (?) will be ignored - batch file FOR limitation e.g. smalltalk -I --quick --eval "Transcript showCR: 'How are you?'." |
949b5e2dd7d5
Win32 launcher (v 1.6.4): batch file code cleanup
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1548
diff
changeset
|
1728 |
ECHO The whole "Transcript showCR: 'How are you?'." will be "eaten" by batches FOR statement. |
1524
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1729 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1730 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1731 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1732 |
ECHO usage: (%~nx0) [--help] [--help-launcher] [--about] [--version] [stx shell switches] |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1733 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1734 |
ECHO args to startup script: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1735 |
ECHO --help or -h or /h or /? ................ displays "stx.com" help |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1736 |
ECHO --help-launcher or -h-l or /h-l ......... displays "%~nx0" help |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1737 |
ECHO --about or -a or /a ................ shows about section |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1738 |
ECHO --version or -v or /v ................ version information about %~nx0 and Smalltalk/X |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1739 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1740 |
ECHO In the future: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1741 |
ECHO --ldd .................. show which shared libraries are used - NOT DONE YET |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1742 |
ECHO --gdb .................. run with gdb-Debugger - NOT DONE YET |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1743 |
ECHO --cgdb ................. run with cgdb-Debugger - NOT DONE YET |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1744 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1745 |
|
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1746 |
:: This section is commented out on purpose - There are tricks for batch files -> does not need to be part of the user help |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1747 |
|
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1748 |
:: " ==================================" |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1749 |
:: " Batch or Powershell Tip & tricks =" |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1750 |
:: " ==================================" |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1751 |
|
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1752 |
:: " ==============================================" |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1753 |
:: " Tee-Object, Add-Content, Out-File + encoding =" |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1754 |
:: " ==============================================" |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1755 |
::The 'Tee-object' and Add-Content was introduced in PowerShell 3.0 -> that the reason why there is such limitation. |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1756 |
:: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1757 |
::The reason why the script is using also different logging types than 'Tee-object' is the fact that 'Tee-Object' |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1758 |
::supports only UTF16 (alias Unicode in Microsoft world) encoding. |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1759 |
::Note: 'Tee-Object' append flag is '-a' (note: for 'tee' command it is '--append') |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1760 |
:: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1761 |
::'Add-content' can change encoding and you can view the messages in the shell but you can not view the file when StX is running (locked even for read) |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1762 |
::'Out-File' can also change encoding, but you will not see the messages in the shell (only in StX launcher). On the other hand you can view the file during |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1763 |
::StX session. |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1764 |
|
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1765 |
:: " ==============================================" |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1766 |
:: " Empty lines in batch files =" |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1767 |
:: " ==============================================" |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1768 |
:: NOTE: ECHO: is a reliable and fast way to print empty line. Other ways are: ECHO( ECHO/ |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1769 |
|
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1770 |
:: " ==============" |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1771 |
:: " Redirections =" |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1772 |
:: " ==============" |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1773 |
|
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1774 |
REM powershell ... cmd.exe /c command '2>&1' -> Let cmd.exe handle redirection |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1775 |
REM powershell ... cmd.exe /c command 2>&1 -> Let powershell.exe handle redirection |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1776 |
|
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1777 |
REM Details |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1778 |
REM PowerShell: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1779 |
REM cmd.exe /c command 2>&1 -> redirect error stream (2) to success stream (1) |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1780 |
REM fixes it when running from within PS but not the command prompt |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1781 |
|
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1782 |
REM Batch file: |
1537
c9aea063a34e
Issue: #172 StX fails to start on Windows when launcher script is run from different directory
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1527
diff
changeset
|
1783 |
REM ...cmd /c "ECHO "Hello from standard error 1>&2" 2>&1 | %{ "$_" } | tee... |
c9aea063a34e
Issue: #172 StX fails to start on Windows when launcher script is run from different directory
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1527
diff
changeset
|
1784 |
REM |
1524
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1785 |
|
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1786 |
:: " =====================" |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1787 |
:: " Exiting batch files =" |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1788 |
:: " =====================" |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1789 |
:: To require pressing ctrl+C from the user (alias force ctrl+C) |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1790 |
:: cmd /c exit -1073741510 |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1791 |
|
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1792 |
:: To directly exit user function (used via CALL) |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1793 |
:: This is a "trick" to exit directly the function |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1794 |
:: (GOTO) 2^^>NUL behaves nearly same as exit /B but executes the block behind it |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1795 |
:: (GOTO) 2>NUL & ENDLOCAL & EXIT /B 1 |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1796 |
|
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1797 |
:: " ========================" |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1798 |
:: " Miscellaneous in batch =" |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1799 |
:: " ========================" |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1800 |
:: A nice solution for printing out a known number of options: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1801 |
:: for %%I in (1 2 3 4 5 x) do if #%user_input%==#%%I goto run%%I |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1802 |
:: then you have to have label for every number e.g. :run1, :run2 |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1803 |
|
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1804 |
GOTO :EOF |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1805 |
|
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1806 |
:: =============== |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1807 |
:: About section = |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1808 |
:: =============== |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1809 |
:stx_about |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1810 |
ECHO " _____ _ _ _ _ _ ____ __ " |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1811 |
ECHO "/ ___| | | | | | | | / /\ \ / / " |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1812 |
ECHO "\ `--. _ __ ___ __ _| | | |_ __ _| | | __ / / \ V / " |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1813 |
ECHO " `--. \ '_ ` _ \ / _` | | | __/ _` | | |/ / / / / \ " |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1814 |
ECHO "/\__/ / | | | | | (_| | | | || (_| | | < / / / /^\ \ " |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1815 |
ECHO "\____/|_| |_| |_|\__,_|_|_|\__\__,_|_|_|\_\/_/ \/ \/ " |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1816 |
ECHO " " |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1817 |
ECHO " _ _ _ _ _ " |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1818 |
ECHO "| | | (_) | | | | " |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1819 |
ECHO "| | | |_ _ __ ______ | | __ _ _ _ _ __ ___| |__ ___ _ __ " |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1820 |
ECHO "| |/\| | | '_ \ |______| | | / _` | | | | '_ \ / __| '_ \ / _ \ '__|" |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1821 |
ECHO "\ /\ / | | | | | |___| (_| | |_| | | | | (__| | | | __/ | " |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1822 |
ECHO " \/ \/|_|_| |_| \_____/\__,_|\__,_|_| |_|\___|_| |_|\___|_| " |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1823 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1824 |
ECHO Author: Patrik Svestka |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1825 |
ECHO Contact: "patrik.svestka|dot|gmail<dot>com" |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1826 |
ECHO Alias: tukanos |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1827 |
ECHO You can find me at: Bitbucket(https://bitbucket.org/-tukanos-/) or github (https://github.com/tukanos/) |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1828 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1829 |
ECHO License: MIT License (more at https://opensource.org/licenses/MIT) |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1830 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1831 |
ECHO Versions: The %~nx0 executed is at version: "=>%~1<=" |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1832 |
ECHO Smalltalk/X is at version: "=>%~2<=" |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1833 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1834 |
ECHO Special thanks: Jan Vrany - for Smalltalk and VM support during writing of this script |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1835 |
ECHO Claus Gittinger - for creating all Smalltalk/X environment |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1836 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1837 |
ECHO Rob van der Woude - for having great pages about batch files (http://http://www.robvanderwoude.com) |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1838 |
ECHO Simon Sheppard - for having great catalog at (https://ss64.com/nt/) |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1839 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1840 |
ECHO This script was tested on: Windows 7 SP1 x64 (enterprise), Windows XP SP3 x86 (stx-bin), |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1841 |
ECHO Windows 10 Pro (10.0.14393), (thanks Jan), Window 2008 R2 SP1 x64 (enterprise) |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1842 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1843 |
ECHO Short description: This file enables you to run stx(-bin).com(exe) with additional features like: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1844 |
ECHO Logging, quick start, starting via image (default or with user interaction), etc. |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1845 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1846 |
ECHO To find out more on how to run this .bat file with --help-launcher switch |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1847 |
|
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1848 |
GOTO :EOF |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1849 |
|
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1850 |
:: ================= |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1851 |
:: Version section = |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1852 |
:: ================= |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1853 |
:stx_version |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1854 |
ECHO The %~nx0 executed is at version: "=>%~1<=" |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1855 |
ECHO: |
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1856 |
ECHO Smalltalk/X is at version: "=>%~2<=" |
1542
0f3705d5dca6
Win32 launcher (v 1.6.1): fixing stx_version_default value and adding information to version
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1541
diff
changeset
|
1857 |
ECHO: |
0f3705d5dca6
Win32 launcher (v 1.6.1): fixing stx_version_default value and adding information to version
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1541
diff
changeset
|
1858 |
ECHO The stx(-bin).com version output: |
0f3705d5dca6
Win32 launcher (v 1.6.1): fixing stx_version_default value and adding information to version
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1541
diff
changeset
|
1859 |
IF EXIST "stx-bin.com" ( |
0f3705d5dca6
Win32 launcher (v 1.6.1): fixing stx_version_default value and adding information to version
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1541
diff
changeset
|
1860 |
CALL stx-bin.com --version |
0f3705d5dca6
Win32 launcher (v 1.6.1): fixing stx_version_default value and adding information to version
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1541
diff
changeset
|
1861 |
) ELSE IF EXIST "stx.com" ( |
0f3705d5dca6
Win32 launcher (v 1.6.1): fixing stx_version_default value and adding information to version
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1541
diff
changeset
|
1862 |
CALL stx.com --version |
0f3705d5dca6
Win32 launcher (v 1.6.1): fixing stx_version_default value and adding information to version
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1541
diff
changeset
|
1863 |
) ELSE ( |
0f3705d5dca6
Win32 launcher (v 1.6.1): fixing stx_version_default value and adding information to version
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1541
diff
changeset
|
1864 |
ECHO "[WARN] The executable stx-bin.^(com^|exe^) or stx.^(com^|exe^) NOT found."" |
0f3705d5dca6
Win32 launcher (v 1.6.1): fixing stx_version_default value and adding information to version
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1541
diff
changeset
|
1865 |
ECHO "[WARN] Exiting with error. Script __numeric.exit_value: 1." |
0f3705d5dca6
Win32 launcher (v 1.6.1): fixing stx_version_default value and adding information to version
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1541
diff
changeset
|
1866 |
PAUSE |
0f3705d5dca6
Win32 launcher (v 1.6.1): fixing stx_version_default value and adding information to version
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1541
diff
changeset
|
1867 |
GOTO :EOF |
0f3705d5dca6
Win32 launcher (v 1.6.1): fixing stx_version_default value and adding information to version
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1541
diff
changeset
|
1868 |
) |
1524
09ca0f1d4e64
Win32: export `STX_PACKAGEPATH` when running from "install" tree
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1520
diff
changeset
|
1869 |
|
1514
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1870 |
GOTO :EOF |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1871 |
|
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1872 |
:: ******************************************************************************************* |
4bdcdc52e55a
Windows launcher improvement - starting is still done via smalltalk.bat
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1508
diff
changeset
|
1873 |
:: End * |
1537
c9aea063a34e
Issue: #172 StX fails to start on Windows when launcher script is run from different directory
Patrik Svestka <patrik.svestka@gmail.com>
parents:
1527
diff
changeset
|
1874 |
:: ******************************************************************************************* |