Skip to content

Commit

Permalink
added 2.13.11 and 3.3.0 msi files
Browse files Browse the repository at this point in the history
  • Loading branch information
michelou committed Jul 31, 2023
1 parent 74bbf70 commit f753108
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 17 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ Concretely, <code>setenv.bat</code> in our GitHub projects which depend on Visua
[cpp_examples]: https://github.com/michelou/cpp-examples
[dart_examples]: https://github.com/michelou/dart-examples
[deno_examples]: https://github.com/michelou/deno-examples
[docker_examples]: https://github.com/michelou/docker-examples
[flix_examples]: https://github.com/michelou/flix-examples
[firegiant]: https://www.firegiant.com/
[git_docs]: https://git-scm.com/docs/git
Expand Down
24 changes: 24 additions & 0 deletions docs/relnotes/relnotes_scala-2.13.11.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
### Release notes &ndash; `scala-2.13.11.msi`

#### General informations
- `scala-2.13.11.msi` (96 MB) is a [*self-signed*](https://en.wikipedia.org/wiki/Self-signed_certificate) Windows installer built from [`scala-2.13.11.zip`](https://scala-lang.org/files/archive/) (23 MB) **and** [`scala-docs-2.13.11.zip`](https://scala-lang.org/files/archive/) (115 MB).
- The [installation context](https://docs.microsoft.com/en-us/windows/win32/msi/installation-context) is *per-machine*, **not** *per-user*.
- The installer targets 64-bit Windows systems (MS Windows 7 or newer); it was tested on Win10 Pro/Home and Win11 Pro.
- The project description is available on page [`README.md`](../../scala2-examples/README.md) (GitHub project [`michelou/wix-examples`](https://github.com/michelou/wix-examples)).

#### What if a Scala 2 installation is already present ?
The Windows installer behaves in *3 different ways* when it detects a [Scala 2](https://www.scala-lang.org/) installation on the user machine :
- if the version to be installed is ***newer than*** the version found on the machine then the Windows installer removes the old version and installs the new one.
- if the version to be installed is ***older than*** the version found on the machine then the [Windows installer does exit](../../scala2-examples/images/Scala2Features_LaterAlreadyInstalled.png).
- if the version to be installed is ***the same as*** the version found on the machine then the user is asked for a [change, repair or remove operation](../../scala2-examples/images/Scala2Features_ChangeOrRepair.png).

#### Running the Scala 2 Windows installer does...
- trigger an elevation of privileges (tested many times but "*usage at your own risk*" disclaimer).
- install the application files to the selected destination folder (*default* location is : `C:\Program Files\Scala 2\`).
- add the small wrapper script [`bin\repl.bat`](../../scala2-examples/Scala2First/src/resources/repl.bat) which gives direct access to the [Scala 2 REPL](../../scala2-examples/images/Scala2First_REPL.png).
- <small>[<b>&cross;</b>]</small> create shortcuts under the *Start Menu* folder "[Scala 2](../../scala2-examples/images/Scala2First_StartMenu.png)".
- <small>[<b>&cross;</b>]</small> add variable `SCALA_HOME` to the Windows *system environment*.
- <small>[<b>&cross;</b>]</small> append path `%SCALA_HOME%\bin\` to the system variable `PATH`.
- <small>[<b>&cross;</b>]</small> install the API documentation to the selected destination folder (default location is : `C:\Program Files\Scala 2\`).

<dl><dd><ins>Note</ins>: <small>[<b>&cross;</b>]</small> Optional feature <i>enabled</i> by default.</dd></dl>
24 changes: 24 additions & 0 deletions docs/relnotes/relnotes_scala3-3.3.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
### Release notes &ndash; `scala3-3.3.0.msi`

#### General informations
- `scala3-3.3.0.msi` (119 MB) is a [*self-signed*](https://en.wikipedia.org/wiki/Self-signed_certificate) Windows installer built from [`scala3-3.3.0.zip`](https://github.com/lampepfl/dotty/releases/tag/3.3.0) (33 MB), [`scala3-library_3-3.3.0-javadoc.jar`](https://repo1.maven.org/maven2/org/scala-lang/scala3-library_3/3.3.0/) **and** [`scala-library-2.13.10-javadoc.jar`](https://repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.10/).
- The [installation context](https://docs.microsoft.com/en-us/windows/win32/msi/installation-context) is *per-machine*, **not** *per-user*.
- The installer targets 64-bit Windows systems (MS Windows 7 or newer); it was tested on Win10 Pro/Home and Win11 Pro.
- The project description is available on page [`README.md`](../../scala3-examples/README.md) (GitHub project [`michelou/wix-examples`](https://github.com/michelou/wix-examples)).

#### What if a Scala 3 installation is already present ?
The Windows installer behaves in *3 different ways* when it detects a [Scala 3](https://dotty.epfl.ch) installation on the user machine :
- if the version to be installed is ***newer than*** the version found on the machine then the Windows installer removes the old version and installs the new one.
- if the version to be installed is ***older than*** the version found on the machine then the [Windows installer does exit](../../scala3-examples/images/Scala3Features_LaterAlreadyInstalled.png).
- if the version to be installed is ***the same as*** the version found on the machine then the user is asked for a [change, repair or remove operation](../../scala3-examples/images/Scala3Features_ChangeOrRepair.png).

#### Running the Scala 3 Windows installer does...
- trigger an elevation of privileges (tested many times but "*usage at your own risk*" disclaimer).
- install the application files to the selected destination folder (default location is : `C:\Program Files\Scala 3\`).
- add the small wrapper script [`bin\repl.bat`](../../scala3-examples/Scala3First/src/resources/repl.bat) which gives direct access to the [Scala 3 REPL](../../scala3-examples/images/Scala3First_REPL.png).
- <small>[<b>&cross;</b>]</small> create shortcuts under the Start Menu folder "[Scala 3](../../scala3-examples/images/Scala3First_Menu.png)".
- <small>[<b>&cross;</b>]</small> add variable `SCALA3_HOME` to the Windows *system environment*.
- <small>[<b>&cross;</b>]</small> append path `%SCALA3_HOME%\bin\` to the system variable `PATH`.
- <small>[<b>&cross;</b>]</small> install the API documentation to the selected destination folder (default location is : `C:\Program Files\Scala 3\`).

<dl><dd><ins>Note</ins>: <small>[<b>&cross;</b>]</small> Optional feature <i>enabled</i> by default.</dd></dl>
14 changes: 9 additions & 5 deletions scala3-examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
<a href="https://wixtoolset.org/" rel="external"><img style="border:0;width:120px;" src="../images/wixtoolset.png" alt="WiX Toolset" /></a>
</td>
<td style="border:0;padding:0;vertical-align:text-top;">
Directory <strong><code>scala3-examples\</code></strong> contains <a href="https://wixtoolset.org/" rel="external">WiX</a> examples written by ourself to create a <a href="https://dotty.epfl.ch/" rel="external">Scala 3</a> Windows installer.<br/>This work is mainly motivated by <a href="https://github.com/lampepfl/dotty/issues/12502">issue 12502</a> (<i>Distribute releases as .deb and .msi</i>) of the <a href="https://github.com/lampepfl/dotty" rel="external">Dotty project</a>.<br/>Follow <a href="../scala2-examples/README.md">this link</a> if you're looking for the Scala 2 Windows installer.
Directory <strong><code>scala3-examples\</code></strong> contains <a href="https://wixtoolset.org/" rel="external">WiX</a> examples written by ourself to create a <a href="https://dotty.epfl.ch/" rel="external">Scala 3</a> Windows installer.<br/>This work is mainly motivated by <a href="https://github.com/lampepfl/dotty/issues/12502">issue 12502</a> (<i>Distribute releases as .deb and .msi</i>) of the <a href="https://github.com/lampepfl/dotty" rel="external">Dotty project</a>.<br/>Follow <a href="https://github.com/michelou/wix-examples/blob/main/scala2-examples/README.md">this link</a> if you're looking for the Scala 2 Windows installer.
</td>
</tr>
</table>

The [WiX][wix_toolset] examples presented in the following sections
- *share* the same project organisation as the [WiX][wix_toolset] examples from page [`myexamples/README.md`](../myexamples/README.md).
- *differ* in several respects from the [WiX][wix_toolset] examples from page [`myexamples/README.md`](../myexamples/README.md), in particular :
- we *download* and extract the application files from the Zip archive (e.g. [`scala3-3.1.0.zip`][scala3_zip]) if they are not yet present in directory `app\`.
- we *download* and extract the application files from the Zip archive (e.g. [`scala3-3.3.0.zip`][scala3_zip]) if they are not yet present in directory `app\`.
- we *do not* maintain a source file `Fragments.wxs` in directory `src\`; the file `target\src_gen\Fragments.wxs` <sup id="anchor_01">[1](#footnote_01)</sup> ‒ which contains a *list of links* to the application files ‒ is generated on each run with GUID values inserted on the fly.

The [Scala 3][scala3] Windows installer behaves in *3 different ways* when it detects a [Scala 3][scala3] installation on the target machine (see [WiX element `MajorUpgrade`](https://wixtoolset.org/documentation/manual/v3/xsd/wix/majorupgrade.html)) :
Expand Down Expand Up @@ -50,7 +50,7 @@ Y:\scala3-examples\Scala3First

> **:mag_right:** During installation the batch file [`src\resources\repl.bat`](./Scala3First/src/resources/repl.bat) is added to the `bin\` directory; the goal of that wrapper script is to look for a Java installation <sup id="anchor_03">[3](#footnote_03)</sup> before starting the Scala 3 REPL (Scala commands require either variable **`JAVA_HOME`** or variable **`JAVACMD`** to be defined).
Command [`build link`](./Scala3First/build.bat) <sup id="anchor_04">[4](#footnote_04)</sup> generates the [Scala 3][scala3] Windows installer with file name `scala3-3.1.0.msi`.
Command [`build link`](./Scala3First/build.bat) <sup id="anchor_04">[4](#footnote_04)</sup> generates the [Scala 3][scala3] Windows installer with file name `scala3-3.3.0.msi`.

<pre style="font-size:80%;">
<b>&gt; <a href="./Scala3First/build.bat">build</a> clean link &amp;&amp; <a href="https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/tree">tree</a> /f target | <a href="https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/findstr">findstr</a> /v /b [a-z]</b>
Expand Down Expand Up @@ -137,6 +137,8 @@ Y:\scala3-examples\Scala3UI
│ │ <i>(files extracted from</i> <a href="https://github.com/lampepfl/dotty/releases/tag/3.0.2"><b>scala3-3.0.2.zip</b></a><i>)</i>
│ └───<b>scala3-3.1.0</b>
│ <i>(files extracted from</i> <a href="https://github.com/lampepfl/dotty/releases/tag/3.1.0"><b>scala3-3.1.0.zip</b></a><i>)</i>
│ └───<b>scala3-3.3.0</b>
│ <i>(files extracted from</i> <a href="https://github.com/lampepfl/dotty/releases/tag/3.3.0"><b>scala3-3.3.0.zip</b></a><i>)</i>
└───<a href="./Scala3UI/src/"><b>src</b></a>
│ <a href="./Scala3UI/src/Includes.wxi">Includes.wxi</a>
│ <a href="./Scala3UI/src/Scala3UI.wxs">Scala3UI.wxs</a>
Expand Down Expand Up @@ -210,6 +212,8 @@ Y:\scala3-examples\Scala3Localized
│ │ <i>(files extracted from</i> <a href="https://github.com/lampepfl/dotty/releases/tag/3.0.2"><b>scala3-3.0.2.zip</b></a><i>)</i>
│ └───<b>scala3-3.1.0</b>
│ <i>(files extracted from</i> <a href="https://github.com/lampepfl/dotty/releases/tag/3.1.0"><b>scala3-3.1.0.zip</b></a><i>)</i>
│ └───<b>scala3-3.3.0</b>
│ <i>(files extracted from</i> <a href="https://github.com/lampepfl/dotty/releases/tag/3.3.0"><b>scala3-3.3.0.zip</b></a><i>)</i>
└───<a href="./Scala3Localized/src/"><b>src</b></a>
│ <a href="./Scala3Localized/src/Includes.wxi">Includes.wxi</a>
│ <a href="./Scala3Localized/src/Scala3Localized.wxs">Scala3Localized.wxs</a>
Expand Down Expand Up @@ -366,7 +370,7 @@ C:\Program Files\Scala 3\bin\scala.bat
<b>&gt; <a href="https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/set_1">set</a> JAVA_HOME=c:\opt\jdk-bellsoft-1.8.0u312</b>
&nbsp;
<b>&gt; scala -version</b>
Scala code runner version 3.1.0 -- Copyright 2002-2021, LAMP/EPFL
Scala code runner version 3.3.0 -- Copyright 2002-2023, LAMP/EPFL
</pre></dd>
</dl>

Expand Down Expand Up @@ -483,7 +487,7 @@ Usage: build { &lt;option&gt; | &lt;subcommand&gt; }
[microsoft_powershell]: https://docs.microsoft.com/en-us/powershell/scripting/getting-started/getting-started-with-windows-powershell?view=powershell-6
[scala3]: https://dotty.epfl.ch
[scala3_releases]: https://github.com/lampepfl/dotty/releases
[scala3_zip]: https://github.com/lampepfl/dotty/releases/tag/3.1.0
[scala3_zip]: https://github.com/lampepfl/dotty/releases/tag/3.3.0
[windows_program_files]: https://en.wikipedia.org/wiki/Program_Files
[windows_settings]: https://support.microsoft.com/en-us/windows/find-settings-in-windows-10-6ffbef87-e633-45ac-a1e8-b7a834578ac6
[windows_start_menu]: https://support.microsoft.com/en-us/windows/see-what-s-on-the-start-menu-a8ccb400-ad49-962b-d2b1-93f453785a13
Expand Down
8 changes: 6 additions & 2 deletions scala3-examples/Scala3Features/build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ set _ARCH=x64

set _PRODUCT_SKU=scala3
set _PRODUCT_UPGRADE_CODE=
set _PRODUCT_VERSION=3.2.1
set _PRODUCT_VERSION=3.3.0

for /f %%i in ('powershell -c "Get-Date -format yyyy"') do set _COPYRIGHT_YEAR_RANGE=2002-%%i
set _COPYRIGHT_OWNER=EPFL
Expand Down Expand Up @@ -219,7 +219,11 @@ if "%_PRODUCT_VERSION:~0,3%"=="3.1" (
if !__BUILD_VERSION! lss 2 ( set _SCALA_BINARY_VERSION=2.13.8
) else ( set _SCALA_BINARY_VERSION=2.13.10
)
) else ( set _SCALA_BINARY_VERSION=2.13.6
) else if "%_PRODUCT_VERSION:~0,3%"=="3.3" (
set _SCALA_BINARY_VERSION=2.13.10
) else (
@rem use the latest available version
set _SCALA_BINARY_VERSION=2.13.11
)
goto :eof

Expand Down
44 changes: 34 additions & 10 deletions setenv.bat
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,9 @@ set _STRONG_BG_BLUE=
goto :eof

@rem input parameter: %*
@rem output parameters: _HELP, _VERBOSE
@rem output parameters: _BASH, _HELP, _VERBOSE
:args
set _BASH=0
set _HELP=0
set _VERBOSE=0
set __N=0
Expand All @@ -120,7 +121,8 @@ if not defined __ARG goto args_done

if "%__ARG:~0,1%"=="-" (
@rem option
if "%__ARG%"=="-debug" ( set _DEBUG=1
if "%__ARG%"=="-bash" ( set _BASH=1
) else if "%__ARG%"=="-debug" ( set _DEBUG=1
) else if "%__ARG%"=="-verbose" ( set _VERBOSE=1
) else (
echo %_ERROR_LABEL% Unknown option %__ARG% 1>&2
Expand All @@ -143,15 +145,18 @@ goto args_loop
call :drive_name "%_ROOT_DIR%"
if not %_EXITCODE%==0 goto :eof
if %_DEBUG%==1 (
echo %_DEBUG_LABEL% Options : _HELP=%_HELP% _VERBOSE=%_VERBOSE% 1>&2
echo %_DEBUG_LABEL% Variables: _DRIVE_NAME=%_DRIVE_NAME% 1>&2
echo %_DEBUG_LABEL% Options : _BASH=%_BASH% _VERBOSE=%_VERBOSE% 1>&2
echo %_DEBUG_LABEL% Subcommands: _HELP=%_HELP% 1>&2
echo %_DEBUG_LABEL% Variables : _DRIVE_NAME=%_DRIVE_NAME% 1>&2
)
goto :eof

@rem input parameter: %1: path to be substituted
@rem output parameter: _DRIVE_NAME
@rem output parameter: _DRIVE_NAME (2 characters: letter + ':')
:drive_name
set "__GIVEN_PATH=%~1"
@rem remove trailing path separator if present
if "%__GIVEN_PATH:~-1,1%"=="\" set "__GIVEN_PATH=%__GIVEN_PATH:~0,-1%"

@rem https://serverfault.com/questions/62578/how-to-get-a-list-of-drive-letters-on-a-system-through-a-windows-shell-bat-cmd
set __DRIVE_NAMES=F:G:H:I:J:K:L:M:N:O:P:Q:R:S:T:U:V:W:X:Y:Z:
Expand All @@ -168,7 +173,7 @@ for /f "tokens=1,2,*" %%f in ('subst') do (
set "__SUBST_DRIVE=%%f"
set "__SUBST_DRIVE=!__SUBST_DRIVE:~0,2!"
set "__SUBST_PATH=%%h"
if "!__SUBST_DRiVE!"=="!__GIVEN_PATH:~0,2!" (
if "!__SUBST_DRIVE!"=="!__GIVEN_PATH:~0,2!" (
set _DRIVE_NAME=!__SUBST_DRIVE:~0,2!
if %_DEBUG%==1 ( echo %_DEBUG_LABEL% Select drive !_DRIVE_NAME! for which a substitution already exists 1>&2
) else if %_VERBOSE%==1 ( echo Select drive !_DRIVE_NAME! for which a substitution already exists 1>&2
Expand Down Expand Up @@ -411,6 +416,12 @@ set _GIT_PATH=
set __GIT_CMD=
for /f %%f in ('where git.exe 2^>NUL') do set "__GIT_CMD=%%f"
if defined __GIT_CMD (
for /f "delims=" %%i in ("%__GIT_CMD%") do set "__GIT_BIN_DIR=%%~dpi"
for %%f in ("!__GIT_BIN_DIR!\.") do set "_GIT_HOME=%%~dpf"
@rem Executable git.exe is present both in bin\ and \mingw64\bin\
if not "!_GIT_HOME:mingw=!"=="!_GIT_HOME!" (
for %%f in ("!_GIT_HOME!\.") do set "_GIT_HOME=%%~dpf"
)
if %_DEBUG%==1 echo %_DEBUG_LABEL% Using path of Git executable found in PATH 1>&2
@rem keep _GIT_PATH undefined since executable already in path
goto :eof
Expand All @@ -427,6 +438,9 @@ if defined __GIT_CMD (
for /f %%f in ('dir /ad /b "!__PATH!\Git*" 2^>NUL') do set "_GIT_HOME=!__PATH!\%%f"
)
)
if defined _GIT_HOME (
if %_DEBUG%==1 echo %_DEBUG_LABEL% Using default Git installation directory "!_GIT_HOME!" 1>&2
)
)
if not exist "%_GIT_HOME%\bin\git.exe" (
echo %_ERROR_LABEL% Git executable not found ^(%_GIT_HOME%^) 1>&2
Expand Down Expand Up @@ -487,9 +501,14 @@ if %ERRORLEVEL%==0 (
)
where /q "%GIT_HOME%\usr\bin:diff.exe"
if %ERRORLEVEL%==0 (
for /f "tokens=1-3,*" %%i in ('"%GIT_HOME%\usr\bin\diff.exe" --version ^| findstr diff') do set "__VERSIONS_LINE3=%__VERSIONS_LINE3% diff %%l"
for /f "tokens=1-3,*" %%i in ('"%GIT_HOME%\usr\bin\diff.exe" --version ^| findstr diff') do set "__VERSIONS_LINE3=%__VERSIONS_LINE3% diff %%l"
set __WHERE_ARGS=%__WHERE_ARGS% "%GIT_HOME%\usr\bin:diff.exe"
)
where "%GIT_HOME%\bin:bash.exe"
if %ERRORLEVEL%==0 (
for /f "tokens=1-3,4,*" %%i in ('"%GIT_HOME%\bin\bash.exe" --version ^| findstr bash') do set "__VERSIONS_LINE2=%__VERSIONS_LINE2% bash %%l"
set __WHERE_ARGS=%__WHERE_ARGS% "%GIT_HOME%\bin:bash.exe"
)
echo Tool versions:
echo %__VERSIONS_LINE1%
echo %__VERSIONS_LINE2%
Expand Down Expand Up @@ -521,9 +540,14 @@ endlocal & (
if not defined WIX set "WIX=%_WIX_HOME%"
set "PATH=%PATH%%_SBT_PATH%%_WINSDK_PATH%%WIX_PATH%%_GIT_PATH%;%~dp0bin"
call :print_env %_VERBOSE%
if not "%CD:~0,2%"=="%_DRIVE_NAME%:" (
if %_DEBUG%==1 echo %_DEBUG_LABEL% cd /d %_DRIVE_NAME%: 1>&2
cd /d %_DRIVE_NAME%:
if not "%CD:~0,2%"=="%_DRIVE_NAME%" (
if %_DEBUG%==1 echo %_DEBUG_LABEL% cd /d %_DRIVE_NAME% 1>&2
cd /d %_DRIVE_NAME%
)
if %_BASH%==1 (
@rem see https://conemu.github.io/en/GitForWindows.html
if %_DEBUG%==1 echo %_DEBUG_LABEL% %_GIT_HOME%\usr\bin\bash.exe --login 1>&2
cmd.exe /c "%_GIT_HOME%\usr\bin\bash.exe --login"
)
)
if %_DEBUG%==1 echo %_DEBUG_LABEL% _EXITCODE=%_EXITCODE% 1>&2
Expand Down

0 comments on commit f753108

Please sign in to comment.