diff --git a/.github/actions/build-khiops/action.yml b/.github/actions/build-khiops/action.yml index 9767adbf6..7d12efde1 100644 --- a/.github/actions/build-khiops/action.yml +++ b/.github/actions/build-khiops/action.yml @@ -16,6 +16,12 @@ runs: - name: Setup MPI (Windows) if: runner.os == 'Windows' uses: mpi4py/setup-mpi@v1 + with: + mpi: intelmpi + - name: debug info + shell: bash + run: | + echo "mpibindir=$mpibindir" - name: Setup MPI (macOS) if: runner.os == 'macOS' shell: bash diff --git a/.github/actions/test-khiops-install/action.yml b/.github/actions/test-khiops-install/action.yml index 55919e8e9..ab3224923 100644 --- a/.github/actions/test-khiops-install/action.yml +++ b/.github/actions/test-khiops-install/action.yml @@ -108,7 +108,7 @@ runs: echo --- Khiops environment with KHIOPS_PROC_NUMBER=%KHIOPS_PROC_NUMBER% call khiops_env --env call khiops_env - if not "%KHIOPS_MPI_COMMAND%". == "". ( + if defined KHIOPS_MPI_COMMAND ( echo "::error::MPI is used even though there are only 2 procs available" exit 1 ) @@ -117,11 +117,11 @@ runs: echo --- Khiops environment with KHIOPS_PROC_NUMBER=%KHIOPS_PROC_NUMBER% call khiops_env --env call khiops_env - if not "%KHIOPS_MPI_ERROR%".=="". ( + if defined KHIOPS_MPI_ERROR ( echo "::error::Unexpected MPI error: %KHIOPS_MPI_ERROR%" exit 1 ) - if "%KHIOPS_MPI_COMMAND%". == "". ( + if not defined KHIOPS_MPI_COMMAND ( echo "::error::KHIOPS_MPI_COMMAND is not set" exit 1 ) diff --git a/.github/workflows/pack-nsis.yml b/.github/workflows/pack-nsis.yml index 64c1f16d1..574894fa8 100644 --- a/.github/workflows/pack-nsis.yml +++ b/.github/workflows/pack-nsis.yml @@ -157,10 +157,11 @@ jobs: /DKHIOPS_REDUCED_VERSION=${{ env.KHIOPS_REDUCED_VERSION }} ` /DKHIOPS_WINDOWS_BUILD_DIR=..\..\..\build\windows-msvc-release ` /DJRE_PATH=..\..\..\assets\jre ` - /DMSMPI_INSTALLER_PATH=..\..\..\assets\${{ env.MSMPI_FILENAME }} ` - /DMSMPI_VERSION=${{ env.MSMPI_VERSION }} ` + /DINTEL_MPI_DIR="${{ env.I_MPI_ROOT }}\bin" ` /DKHIOPS_VIZ_INSTALLER_PATH=..\..\..\visualization\${{ env.KHIOPS_VIZ_FILENAME }} ` /DKHIOPS_SAMPLES_DIR=..\..\..\samples ` + /DINTEL_MPI_BIN_DIR=..\..\..\build\windows-msvc-release\tmp\mpi\bin ` + /DINTEL_MPI_LICENSES_DIR=..\THIRD-PARTY-LICENSES ` /DSIGN ` /DPATH_TO_JSIGN=D:\\jsign.jar ` /DSM_CERT_ALIAS=$Env:CERTIFICATE ` @@ -178,10 +179,11 @@ jobs: /DKHIOPS_REDUCED_VERSION=${{ env.KHIOPS_REDUCED_VERSION }} ` /DKHIOPS_WINDOWS_BUILD_DIR=..\..\..\build\windows-msvc-release ` /DJRE_PATH=..\..\..\assets\jre ` - /DMSMPI_INSTALLER_PATH=..\..\..\assets\${{ env.MSMPI_FILENAME }} ` - /DMSMPI_VERSION=${{ env.MSMPI_VERSION }} ` + /DINTEL_MPI_DIR="${{ env.I_MPI_ROOT }}\bin" ` /DKHIOPS_VIZ_INSTALLER_PATH=..\..\..\visualization\${{ env.KHIOPS_VIZ_FILENAME }} ` /DKHIOPS_SAMPLES_DIR=..\..\..\samples ` + /DINTEL_MPI_BIN_DIR=..\..\..\build\windows-msvc-release\tmp\mpi\bin ` + /DINTEL_MPI_LICENSES_DIR=..\THIRD-PARTY-LICENSES ` khiops.nsi - name: Sign installer uses: digicert/code-signing-software-trust-action@v1.2.1 diff --git a/.github/workflows/run-standard-tests.yml b/.github/workflows/run-standard-tests.yml index 378c677db..255a23410 100644 --- a/.github/workflows/run-standard-tests.yml +++ b/.github/workflows/run-standard-tests.yml @@ -133,6 +133,8 @@ jobs: - name: Setup MPI (windows) if: runner.os == 'Windows' uses: mpi4py/setup-mpi@v1 + with: + mpi: intelmpi - name: Setup MPI (macOS) if: runner.os == 'macOS' shell: bash diff --git a/CMakeLists.txt b/CMakeLists.txt index 616948426..9636160ad 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -219,12 +219,15 @@ if(MPI) endif() # Detects the mpi implementation -if(UNIX AND MPI) +if(MPI) include(get_mpi_implementation) get_mpi_implementation() - # Set MPI suffix if it is not defined with the environment variables (like on Fedora distros) - if(NOT MPI_SUFFIX AND MPI_IMPL) + # Set MPI suffix if it is not defined with the environment variables (like on Fedora distros) On Windows, the suffix + # is always empty + if(UNIX + AND NOT MPI_SUFFIX + AND MPI_IMPL) set(MPI_SUFFIX "_${MPI_IMPL}") endif() endif() diff --git a/packaging/install.cmake b/packaging/install.cmake index ae1749b81..0a4a3228b 100644 --- a/packaging/install.cmake +++ b/packaging/install.cmake @@ -278,6 +278,24 @@ else(IS_LINUX OR IS_MACOS) set(BIN_INSTALL_DIR "bin") endif() + if(IS_MSMPI) + file(READ packaging/windows/set_proc_number.cmd SET_PROC_NUMBER) + endif() + + # For Intel MPI, we need to copy the redistributable files to a staging directory and install them from there. We + # cannot directly + if(IS_INTEL_MPI + AND NOT IS_PIP + AND NOT IS_CONDA) + get_filename_component(INTEL_MPI_BIN_DIR "${MPIEXEC_EXECUTABLE}" DIRECTORY) + set(INTEL_MPI_STAGING_BIN_DIR "${TMP_DIR}/mpi/bin") + file(MAKE_DIRECTORY ${INTEL_MPI_STAGING_BIN_DIR}) + set(INTEL_MPI_REDISTRIBUTABLE_FILES hydra_bstrap_proxy.exe hydra_pmi_proxy.exe impi.dll mpiexec.exe) + foreach(INTEL_MPI_REDISTRIBUTABLE_FILE IN LISTS INTEL_MPI_REDISTRIBUTABLE_FILES) + configure_file(${INTEL_MPI_BIN_DIR}/${INTEL_MPI_REDISTRIBUTABLE_FILE} + ${INTEL_MPI_STAGING_BIN_DIR}/${INTEL_MPI_REDISTRIBUTABLE_FILE} COPYONLY) + endforeach() + endif() configure_file(${PROJECT_SOURCE_DIR}/packaging/windows/khiops_env.cmd.in ${TMP_DIR}/khiops_env.cmd @ONLY NEWLINE_STYLE CRLF) @@ -295,6 +313,22 @@ else(IS_LINUX OR IS_MACOS) install(TARGETS MODL MODL_Coclustering _khiopsgetprocnumber RUNTIME DESTINATION ${BIN_INSTALL_DIR} COMPONENT KHIOPS_CORE) + if(IS_INTEL_MPI + AND NOT IS_PIP + AND NOT IS_CONDA) + install( + FILES ${INTEL_MPI_STAGING_BIN_DIR}/hydra_bstrap_proxy.exe ${INTEL_MPI_STAGING_BIN_DIR}/hydra_pmi_proxy.exe + ${INTEL_MPI_STAGING_BIN_DIR}/impi.dll ${INTEL_MPI_STAGING_BIN_DIR}/mpiexec.exe + DESTINATION ${BIN_INSTALL_DIR} + COMPONENT KHIOPS_CORE) + # Install Intel MPI license files + install( + DIRECTORY ${PROJECT_SOURCE_DIR}/packaging/windows/THIRD-PARTY-LICENSES/ + DESTINATION licenses + COMPONENT KHIOPS_CORE + FILES_MATCHING + PATTERN "*.txt") + endif() install( PROGRAMS ${TMP_DIR}/khiops.cmd ${TMP_DIR}/khiops_coclustering.cmd ${TMP_DIR}/khiops_env.cmd DESTINATION ${BIN_INSTALL_DIR} diff --git a/packaging/linux/common/khiops.in b/packaging/linux/common/khiops.in index 848df5c09..48e63aa2b 100644 --- a/packaging/linux/common/khiops.in +++ b/packaging/linux/common/khiops.in @@ -96,7 +96,7 @@ main () { launch_khiops "$@" local _RETCODE=$? else - if [ "$_GUI_SUPPORTED" = true ] || [ -z "$DISPLAY" ]; then + if [ "$_GUI_SUPPORTED" = false ] || [ -z "$DISPLAY" ]; then error "GUI is not available, please use the '-b' flag" else if [ -z "$KHIOPS_JAVA_PATH" ]; then diff --git a/packaging/packaging.cmake b/packaging/packaging.cmake index 3f69e6e3a..2b412f241 100644 --- a/packaging/packaging.cmake +++ b/packaging/packaging.cmake @@ -107,7 +107,7 @@ set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS ON) set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS_PRIVATE_DIRS ${CMAKE_BINARY_DIR}/lib/) # We add mpi implementation to package name (khiops-core only) -if(MPI_IMPL) +if(UNIX AND MPI_IMPL) string(REPLACE "_" "-" PACKAGE_SUFFIX ${MPI_SUFFIX}) else() set(PACKAGE_SUFFIX "-serial") diff --git a/packaging/windows/THIRD-PARTY-LICENSES/Intel-MPI-LICENSE.txt b/packaging/windows/THIRD-PARTY-LICENSES/Intel-MPI-LICENSE.txt new file mode 100644 index 000000000..12f914d04 --- /dev/null +++ b/packaging/windows/THIRD-PARTY-LICENSES/Intel-MPI-LICENSE.txt @@ -0,0 +1,40 @@ +================================================================================ +Intel(R) MPI Library - Redistributable Components License +================================================================================ + +This license covers the following redistributable files included in Khiops: + - hydra_bstrap_proxy.exe + - hydra_pmi_proxy.exe + - impi.dll + - mpiexec.exe + +================================================================================ + +Intel Simplified Software License (Version October 2022) + +Intel(R) MPI Library: Copyright (C) 2009 Intel Corporation + +Use and Redistribution. You may use and redistribute the software, which is provided in binary form only, (the "Software"), without modification, provided the following conditions are met: + +* Redistributions must reproduce the above copyright notice and these terms of use in the Software and in the documentation and/or other materials provided with the distribution. +* Neither the name of Intel nor the names of its suppliers may be used to endorse or promote products derived from this Software without specific prior written permission. +* No reverse engineering, decompilation, or disassembly of the Software is permitted, nor any modification or alteration of the Software or its operation at any time, including during execution. + +No other licenses. Except as provided in the preceding section, Intel grants no licenses or other rights by implication, estoppel or otherwise to, patent, copyright, trademark, trade name, service mark or other intellectual property licenses or rights of Intel. + +Third party software. "Third Party Software" means the files (if any) listed in the "third-party-software.txt" or other similarly-named text file that may be included with the Software. Third Party Software, even if included with the distribution of the Software, may be governed by separate license terms, including without limitation, third party license terms, open source software notices and terms, and/or other Intel software license terms. These separate license terms solely govern Your use of the Third Party Software. + +DISCLAIMER. HIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE DISCLAIMED. THIS SOFTWARE IS NOT INTENDED FOR USE IN SYSTEMS OR APPLICATIONS WHERE FAILURE OF THE SOFTWARE MAY CAUSE PERSONAL INJURY OR DEATH AND YOU AGREE THAT YOU ARE FULLY RESPONSIBLE FOR ANY CLAIMS, COSTS, DAMAGES, EXPENSES, AND ATTORNEYS' FEES ARISING OUT OF ANY SUCH USE, EVEN IF ANY CLAIM ALLEGES THAT INTEL WAS NEGLIGENT REGARDING THE DESIGN OR MANUFACTURE OF THE SOFTWARE. + +LIMITATION OF LIABILITY. IN NO EVENT WILL INTEL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +No support. Intel may make changes to the Software, at any time without notice, and is not obligated to support, update or provide training for the Software. + +Termination. Your right to use the Software is terminated in the event of your breach of this license. + +Feedback. Should you provide Intel with comments, modifications, corrections, enhancements or other input ("Feedback") related to the Software, Intel will be free to use, disclose, reproduce, license or otherwise distribute or exploit the Feedback in its sole discretion without any obligations or restrictions of any kind, including without limitation, intellectual property rights or licensing obligations. + +Compliance with laws. You agree to comply with all relevant laws and regulations governing your use, transfer, import or export (or prohibition thereof) of the Software. + +Governing law. All disputes will be governed by the laws of the United States of America and the State of Delaware without reference to conflict of law principles and subject to the exclusive jurisdiction of the state or federal courts sitting in the State of Delaware, and each party agrees that it submits to the personal jurisdiction and venue of those courts and waives any objections. THE UNITED NATIONS CONVENTION ON CONTRACTS FOR THE INTERNATIONAL SALE OF GOODS (1980) IS SPECIFICALLY EXCLUDED AND WILL NOT APPLY TO THE SOFTWARE. +================================================================================ diff --git a/packaging/windows/THIRD-PARTY-LICENSES/README.txt b/packaging/windows/THIRD-PARTY-LICENSES/README.txt new file mode 100644 index 000000000..19faedfc0 --- /dev/null +++ b/packaging/windows/THIRD-PARTY-LICENSES/README.txt @@ -0,0 +1,15 @@ +Third-Party Software Licenses +============================== + +Khiops includes redistributable components from third-party software. +This directory contains the license files for these components. + +Contents: +- Intel-MPI-LICENSE.txt: Intel(R) MPI Library redistributable components + (hydra_bstrap_proxy.exe, hydra_pmi_proxy.exe, impi.dll, mpiexec.exe) +- Eclipse Adoptium/Temurin OpenJDK JRE 21 (packaged by JustJ) + License files are in the jre\legal\ directory of the installation. + Main license: GPL v2 with Classpath Exception (see jre\legal\java.base\LICENSE) + Source: https://adoptium.net/ + +For the Khiops main license, see LICENSE.txt in the installation directory. diff --git a/packaging/windows/khiops.cmd.in b/packaging/windows/khiops.cmd.in index 7c869111f..abb21ecee 100644 --- a/packaging/windows/khiops.cmd.in +++ b/packaging/windows/khiops.cmd.in @@ -31,7 +31,7 @@ for %%i in (%*) do ( ) :BREAK_LOOP -if "%KHIOPS_BATCH_MODE%" == "true" if not "%KHIOPS_JAVA_ERROR%". == "". goto ERR_JAVA +if "%KHIOPS_BATCH_MODE%" == "false" if not "%KHIOPS_JAVA_ERROR%". == "". goto ERR_JAVA if "%_KHIOPS_GUI%" == "false" if not "%KHIOPS_BATCH_MODE%" == "true" goto ERR_NO_GUI REM Set path diff --git a/packaging/windows/khiops_env.cmd.in b/packaging/windows/khiops_env.cmd.in index 104e31907..7f4517e38 100644 --- a/packaging/windows/khiops_env.cmd.in +++ b/packaging/windows/khiops_env.cmd.in @@ -84,18 +84,23 @@ set "KHIOPS_COCLUSTERING_PATH=%_KHIOPS_HOME%\@BIN_PATH@\MODL_Coclustering.exe" REM KHIOPS_LAST_RUN_DIR if "%KHIOPS_LAST_RUN_DIR%". == "". set "KHIOPS_LAST_RUN_DIR=%USERPROFILE%\khiops_data\lastrun" -REM KHIOPS_PROC_NUMBER -if "%KHIOPS_PROC_NUMBER%". == "". for /f %%i in ('"%~dp0_khiopsgetprocnumber"') do set "KHIOPS_PROC_NUMBER=%%i" -if "%KHIOPS_PROC_NUMBER%". == "". set "KHIOPS_PROC_NUMBER=1" +@SET_PROC_NUMBER@ -REM Set MPI binary (mpiexec) -if %KHIOPS_PROC_NUMBER% LEQ 2 goto MPI_DONE +REM Determine MPI usage based on KHIOPS_PROC_NUMBER +REM - If KHIOPS_PROC_NUMBER <= 2: sequential mode (no MPI) +REM - If KHIOPS_PROC_NUMBER is unset or > 2: set MPI command + +REM Set MPI command path goto @SET_MPI@ -:MPI_PARAMS -REM Add the MPI parameters -if not "%KHIOPS_MPI_COMMAND%." == "." set "KHIOPS_MPI_COMMAND="%KHIOPS_MPI_COMMAND%" -n %KHIOPS_PROC_NUMBER%" :MPI_DONE +REM Append proc number to MPI command if defined (only if MPI command is not empty) +if defined KHIOPS_PROC_NUMBER ( + if defined KHIOPS_MPI_COMMAND set "KHIOPS_MPI_COMMAND=%KHIOPS_MPI_COMMAND% -n %KHIOPS_PROC_NUMBER%" + REM If KHIOPS_PROC_NUMBER <= 2, clear MPI command (use serial mode) + if "%KHIOPS_PROC_NUMBER%"=="1" set "KHIOPS_MPI_COMMAND=" + if "%KHIOPS_PROC_NUMBER%"=="2" set "KHIOPS_MPI_COMMAND=" +) set _KHIOPS_GUI=@GUI_STATUS@ if "%_KHIOPS_GUI%" == "false" GOTO SKIP_GUI @@ -148,32 +153,22 @@ exit /b 0 REM Set mpiexec path for conda installation :SET_MPI_CONDA -set "KHIOPS_MPI_COMMAND=%_KHIOPS_HOME%\bin\mpiexec.exe" -if not exist "%KHIOPS_MPI_COMMAND%" goto ERR_MPI -goto MPI_PARAMS +set "KHIOPS_MPI_COMMAND="%_KHIOPS_HOME%\bin\mpiexec.exe"" +if not exist %KHIOPS_MPI_COMMAND% goto ERR_MPI +goto MPI_DONE REM Set mpiexec path for pip installation :SET_MPI_PIP -set "KHIOPS_MPI_COMMAND=%_KHIOPS_HOME%\Library\bin\mpiexec.exe" +set "KHIOPS_MPI_COMMAND="%_KHIOPS_HOME%\Library\bin\mpiexec.exe"" set "KHIOPS_MPI_DLL_PATH=%_KHIOPS_HOME%\Library\bin\" -if not exist "%KHIOPS_MPI_COMMAND%" goto ERR_MPI -goto MPI_PARAMS +if not exist %KHIOPS_MPI_COMMAND% goto ERR_MPI +goto MPI_DONE REM Set mpiexec path for system wide installation :SET_MPI_SYSTEM_WIDE -REM ... with the standard variable MSMPI_BIN -set "KHIOPS_MPI_COMMAND=%MSMPI_BIN%mpiexec.exe" -if exist "%KHIOPS_MPI_COMMAND%" goto MPI_PARAMS -REM ... if MSMPI_BIN is not correctly defined -REM ... we try to call directly mpiexec (assuming its path is in the 'path' variable) -set "KHIOPS_MPI_COMMAND=mpiexec" -where /q "%KHIOPS_MPI_COMMAND%" -if ERRORLEVEL 1 goto ERR_MPI -REM ... finally we check if it is the good MPI implementation: "Microsoft MPI" -"%KHIOPS_MPI_COMMAND%" | findstr /c:"Microsoft MPI" > nul -if ERRORLEVEL 1 goto ERR_MPI_IMPL -goto MPI_PARAMS - +set "KHIOPS_MPI_COMMAND="%_KHIOPS_HOME%\@BIN_PATH@\mpiexec.exe"" +if not exist %KHIOPS_MPI_COMMAND% goto ERR_MPI +goto MPI_DONE :ERR_MPI set "KHIOPS_MPI_ERROR=We didn't find mpiexec in the regular path. Parallel computation is unavailable: Khiops is launched in serial" diff --git a/packaging/windows/nsis/KhiopsGlobals.nsh b/packaging/windows/nsis/KhiopsGlobals.nsh deleted file mode 100644 index c3548bc3a..000000000 --- a/packaging/windows/nsis/KhiopsGlobals.nsh +++ /dev/null @@ -1,5 +0,0 @@ -# Global Definitions -# ------------------ - -# Minimal required MPI version -!define MPIRequiredVersion "10.0" diff --git a/packaging/windows/nsis/KhiopsPrerequisiteFunc.nsh b/packaging/windows/nsis/KhiopsPrerequisiteFunc.nsh deleted file mode 100644 index c80b7b448..000000000 --- a/packaging/windows/nsis/KhiopsPrerequisiteFunc.nsh +++ /dev/null @@ -1,49 +0,0 @@ -!include "FileFunc.nsh" -!include "WordFunc.nsh" - -# To deactivate the requirements installation define DO_NOT_INSTALL_REQUIREMENTS - - -# Detects MPI and loads its version -# - Defines MPIInstalledVersion -# - If not installed MPIInstalledVersion is equal to 0 -Function DetectAndLoadMPIEnvironment - # Installed version - Var /GLOBAL MPIInstalledVersion - StrCpy $MPIInstalledVersion 0 - - # Look in the registry for the MPI installation - StrCpy $1 "SOFTWARE\Microsoft\MPI" - StrCpy $2 0 - ReadRegStr $2 HKLM "$1" "Version" - StrCpy $MPIInstalledVersion $2 -FunctionEnd - - -# Installs MPI -Function InstallMPI -!ifndef DO_NOT_INSTALL_REQUIREMENTS - # Save MPI installer - SetOutPath $TEMP - File ${MSMPI_INSTALLER_PATH} - - # Execute MPI installer - Var /Global MSMPI_INSTALLER_FILENAME - ${GetFileName} ${MSMPI_INSTALLER_PATH} $MSMPI_INSTALLER_FILENAME - nsexec::Exec '"$TEMP\$MSMPI_INSTALLER_FILENAME" -unattend -force -minimal' - Pop $0 - DetailPrint "Installation of MPI: $0" - - # Delete MSMPI installer - Delete "$TEMP\$MSMPI_INSTALLER_FILENAME" - - # Load MPI environment (MPIInstalledVersion) - Call DetectAndLoadMPIEnvironment - - # Show an error if the required version is newer than installed version - ${VersionCompare} "${MPIRequiredVersion}" "$MPIInstalledVersion" $0 - ${If} $0 == 1 - Messagebox MB_OK "Could not install MPI runtime (version ${MPIRequiredVersion}): Khiops will not run. Try installing Microsoft MPI directly before installing Khiops." /SD IDOK - ${EndIf} -!endif -FunctionEnd diff --git a/packaging/windows/nsis/README.md b/packaging/windows/nsis/README.md index 8280416c9..d92fc25e9 100644 --- a/packaging/windows/nsis/README.md +++ b/packaging/windows/nsis/README.md @@ -4,20 +4,18 @@ This folder contains the scripts to generate the Khiops Windows installer. It is page](https://github.com/KhiopsML/khiops/wiki/Release-Process). ## What the installer does -Besides installing the Khiops executables, the installer automatically detects the presence of: -- [Microsoft MPI](https://learn.microsoft.com/en-us/message-passing-interface/microsoft-mpi) -and installs it if necessary. - - -It also installs: +It installs: - The [Khiops Visualization](https://github.com/khiopsrelease/kv-release/releases/latest) and [Khiops Covisualization](https://github.com/khiopsrelease/kc-release/releases/latest) apps by executing their corresponding installers. - The JRE from [Eclipse Temurin](https://adoptium.net/fr/temurin/releases/) +- The mpi runtime of Intel MPI (4 redistributable files with license in `licenses/` directory) - The [sample datasets](https://github.com/KhiopsML/khiops-samples/releases/latest). - Documentation files: - README.txt and WHATSNEW.txt (obtained from the sources at (../../common/khiops)) + - Third-party licenses in the `licenses/` directory + ## How to obtain the package assets All the package assets (installers, documentation, etc) are available at the @@ -44,10 +42,10 @@ makensis ^ /DKHIOPS_REDUCED_VERSION=10.2.0 ^ /DKHIOPS_WINDOWS_BUILD_DIR=..\..\..\build\windows-msvc-release ^ /DJRE_PATH=.\assets\jre\ ^ - /DMSMPI_INSTALLER_PATH=.\assets\msmpisetup.exe ^ - /DMSMPI_VERSION=10.1.3 ^ /DKHIOPS_VIZ_INSTALLER_PATH=.\assets\khiops-visualization-Setup-11.0.2.exe ^ /DKHIOPS_SAMPLES_DIR=.\assets\samples ^ + /DINTEL_MPI_BIN_DIR=..\..\..\build\windows-msvc-release\tmp\mpi\bin ^ + /DINTEL_MPI_LICENSES_DIR=..\THIRD-PARTY-LICENSES ^ khiops.nsi ``` The resulting installer will be at `packaging/windows/nsis/khiops-10.2.0-rc.1-setup.exe`. @@ -80,10 +78,9 @@ All the arguments are mandatory except for `DEBUG` and `SIGN`, they must be pref - `DEBUG`: Enables debug messages in the installer. They are "OK" message boxes. - `KHIOPS_VERSION`: Khiops version for the installer. - `KHIOPS_REDUCED_VERSION`: Khiops version without suffix and only digits and periods. -- `KHIOPS_WINDOWS_BUILD_DIR`: Build directory for (usually `build\windows-msvc-release` relative to - the project root). +- `KHIOPS_WINDOWS_BUILD_DIR`: root of the built project (usually `build\windows-msvc-release` relative to the project root). Contains khiops binaries in the `bin/` subdirectory. - `JRE_PATH`: Path to the Java Runtime Environment (JRE) directory. -- `MSMPI_INSTALLER_PATH`: Path to the Microsoft MPI (MS-MPI) installer. -- `MSMPI_MPI_VERSION`: MS-MPI version. - `KHIOPS_VIZ_INSTALLER_PATH`: Path to the Khiops Visualization installer. -- `KHIOPS_SAMPLES_DIR`: Path to the sample datasets directory. \ No newline at end of file +- `KHIOPS_SAMPLES_DIR`: Path to the sample datasets directory. +- `INTEL_MPI_BIN_DIR`: Path to the directory containing Intel MPI redistributable binaries (hydra_bstrap_proxy.exe, hydra_pmi_proxy.exe, mpiexec.exe, impi.dll). Usually `build\windows-msvc-release\tmp\mpi\bin`. +- `INTEL_MPI_LICENSES_DIR`: Path to the directory containing Intel MPI license files (README.txt and Intel-MPI-LICENSE.txt). \ No newline at end of file diff --git a/packaging/windows/nsis/khiops.nsi b/packaging/windows/nsis/khiops.nsi index 05d45f146..3844d9aa2 100644 --- a/packaging/windows/nsis/khiops.nsi +++ b/packaging/windows/nsis/khiops.nsi @@ -1,11 +1,11 @@ # Khiops installer builder NSIS script # Set Unicode to avoid warning 7998: "ANSI targets are deprecated" -Unicode True +Unicode true # Set compresion to LZMA (faster) SetCompressor /SOLID lzma -#SetCompress off +# SetCompress off # Include NSIS librairies !include "LogicLib.nsh" @@ -14,11 +14,6 @@ SetCompressor /SOLID lzma !include "x64.nsh" !include "winmessages.nsh" -# Include Custom libraries -!include "KhiopsGlobals.nsh" -!include "KhiopsPrerequisiteFunc.nsh" - - # Definitions for registry change notification !define SHCNE_ASSOCCHANGED 0x8000000 !define SHCNF_IDLIST 0 @@ -34,9 +29,9 @@ ManifestDPIAware true # Macro to check input parameter definitions !macro CheckInputParameter ParameterName - !ifndef ${ParameterName} - !error "${ParameterName} is not defined. Use the flag '-D${ParameterName}=...' to define it." - !endif + !ifndef ${ParameterName} + !error "${ParameterName} is not defined. Use the flag '-D${ParameterName}=...' to define it." + !endif !macroend # Check the mandatory input definitions @@ -45,33 +40,28 @@ ManifestDPIAware true !insertmacro CheckInputParameter KHIOPS_WINDOWS_BUILD_DIR !insertmacro CheckInputParameter KHIOPS_VIZ_INSTALLER_PATH !insertmacro CheckInputParameter JRE_PATH -!insertmacro CheckInputParameter MSMPI_INSTALLER_PATH -!insertmacro CheckInputParameter MSMPI_VERSION !insertmacro CheckInputParameter KHIOPS_SAMPLES_DIR +!insertmacro CheckInputParameter INTEL_MPI_BIN_DIR +!insertmacro CheckInputParameter INTEL_MPI_LICENSES_DIR # Sign uninstaller if requested !ifdef SIGN - !insertmacro CheckInputParameter PATH_TO_JSIGN - !insertmacro CheckInputParameter SM_CERT_ALIAS - !insertmacro CheckInputParameter SM_CLIENT_CERT_FILE - !insertmacro CheckInputParameter SM_CLIENT_CERT_PASSWORD - !insertmacro CheckInputParameter SM_API_KEY - !uninstfinalize 'java -jar ${PATH_TO_JSIGN} --storetype DIGICERTONE --storepass "${SM_API_KEY}|${SM_CLIENT_CERT_FILE}|${SM_CLIENT_CERT_PASSWORD}" --alias ${SM_CERT_ALIAS} --keystore https://clientauth.one.nl.digicert.com %1' + !insertmacro CheckInputParameter PATH_TO_JSIGN + !insertmacro CheckInputParameter SM_CERT_ALIAS + !insertmacro CheckInputParameter SM_CLIENT_CERT_FILE + !insertmacro CheckInputParameter SM_CLIENT_CERT_PASSWORD + !insertmacro CheckInputParameter SM_API_KEY + !uninstfinalize \ + 'java -jar ${PATH_TO_JSIGN} --storetype DIGICERTONE --storepass "${SM_API_KEY}|${SM_CLIENT_CERT_FILE}|${SM_CLIENT_CERT_PASSWORD}" --alias ${SM_CERT_ALIAS} --keystore https://clientauth.one.nl.digicert.com %1' !endif # Application name and installer file name Name "Khiops ${KHIOPS_VERSION}" OutFile "khiops-${KHIOPS_VERSION}-setup.exe" -######################## +# ####################### # Variable definitions # -######################## - -# Requirements installation flags -Var /GLOBAL MPIInstallationNeeded - -# Requirements installation messages -Var /GLOBAL MPIInstallationMessage +# ####################### # Previous Uninstaller data Var /GLOBAL PreviousUninstaller @@ -86,9 +76,9 @@ Var /GLOBAL SamplesInstallDir # Root key for the uninstaller in the windows registry !define UninstallerKey "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" -##################################### +# #################################### # Modern UI Interface Configuration # -##################################### +# #################################### # General configuration !define MUI_HEADERIMAGE @@ -103,15 +93,12 @@ BrandingText "Orange" # Welcome page !define MUI_WELCOMEPAGE_TITLE "Welcome to the Khiops ${KHIOPS_VERSION} Setup Wizard" !define MUI_WELCOMEPAGE_TEXT \ - "Khiops is a data mining tool includes data preparation and scoring, visualization, coclustering and covisualization.$\r$\n$\r$\n$\r$\n$\r$\n$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_WELCOME_INFO_TEXT)" + "Khiops is a data mining tool includes data preparation and scoring, visualization, coclustering and covisualization.$\r$\n$\r$\n$\r$\n$\r$\n$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_WELCOME_INFO_TEXT)" !insertmacro MUI_PAGE_WELCOME # Licence page !insertmacro MUI_PAGE_LICENSE "..\..\..\LICENSE" -# Custom page for requirements software -Page custom RequirementsPageShow RequirementsPageLeave - # Install directory choice page !insertmacro MUI_PAGE_DIRECTORY @@ -134,9 +121,9 @@ Page custom RequirementsPageShow RequirementsPageLeave # Language (must be defined after uninstaller) !insertmacro MUI_LANGUAGE "English" -####################### +# ###################### # Version Information # -####################### +# ###################### VIProductVersion "${KHIOPS_REDUCED_VERSION}.0" VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "Khiops" @@ -145,627 +132,608 @@ VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "Copyright (c) 2023-2026 VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "Khiops Installer" VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${KHIOPS_VERSION}" -###################### +# ##################### # Installer Sections # -###################### +# ##################### Section "Install" SecInstall - # In order to have shortcuts and documents for all users - SetShellVarContext all - - # Detect Java - Call RequirementsDetection - - - # MPI installation is always required, because Khiops is linked with MPI DLL - ${If} $MPIInstallationNeeded == "1" - Call InstallMPI - ${EndIf} - - # Activate file overwrite - SetOverwrite on - - # Install executables and java libraries - SetOutPath "$INSTDIR\bin" - File "${KHIOPS_WINDOWS_BUILD_DIR}\bin\MODL.exe" - File "${KHIOPS_WINDOWS_BUILD_DIR}\bin\MODL_Coclustering.exe" - File "${KHIOPS_WINDOWS_BUILD_DIR}\bin\_khiopsgetprocnumber.exe" - File "${KHIOPS_WINDOWS_BUILD_DIR}\bin\_khiopslauncher.exe" - File "${KHIOPS_WINDOWS_BUILD_DIR}\jars\norm.jar" - File "${KHIOPS_WINDOWS_BUILD_DIR}\jars\khiops.jar" - File "${KHIOPS_WINDOWS_BUILD_DIR}\tmp\khiops_env.cmd" - File "${KHIOPS_WINDOWS_BUILD_DIR}\tmp\khiops.cmd" - File "${KHIOPS_WINDOWS_BUILD_DIR}\tmp\khiops_coclustering.cmd" - - # Install Docs - SetOutPath "$INSTDIR" - File "/oname=LICENSE.txt" "..\..\..\LICENSE" - File "..\..\common\khiops\README.txt" - File "..\..\common\khiops\WHATSNEW.txt" - - # Install icons - SetOutPath "$INSTDIR\bin\icons" - File ".\images\installer.ico" - File "..\..\common\images\khiops.ico" - File "..\..\common\images\khiops_coclustering.ico" - - # Set the samples directory to be located either within %PUBLIC% or %ALLUSERSPROFILE% as fallback - ReadEnvStr $WinPublicDir PUBLIC - ReadEnvStr $AllUsersProfileDir ALLUSERSPROFILE - ${If} $WinPublicDir != "" - StrCpy $GlobalKhiopsDataDir "$WinPublicDir\khiops_data" - ${ElseIf} $AllUsersProfileDir != "" - StrCpy $GlobalKhiopsDataDir "$AllUsersProfileDir\khiops_data" - ${Else} - StrCpy $GlobalKhiopsDataDir "" - ${EndIf} - - # Debug message - !ifdef DEBUG - ${If} $GlobalKhiopsDataDir == "" - Messagebox MB_OK "Could find PUBLIC nor ALLUSERSPROFILE directories. Samples not installed." - ${Else} - Messagebox MB_OK "Samples will be installed at $GlobalKhiopsDataDir\samples." - ${EndIf} - !endif - - # Install samples only if the directory is defined - ${If} $GlobalKhiopsDataDir != "" - StrCpy $SamplesInstallDir "$GlobalKhiopsDataDir\samples" - SetOutPath "$SamplesInstallDir" - File "/oname=README.txt" "${KHIOPS_SAMPLES_DIR}\README.md" - SetOutPath "$SamplesInstallDir\Adult" - File "${KHIOPS_SAMPLES_DIR}\Adult\Adult.kdic" - File "${KHIOPS_SAMPLES_DIR}\Adult\Adult.txt" - SetOutPath "$SamplesInstallDir\Iris" - File "${KHIOPS_SAMPLES_DIR}\Iris\Iris.kdic" - File "${KHIOPS_SAMPLES_DIR}\Iris\Iris.txt" - SetOutPath "$SamplesInstallDir\Mushroom" - File "${KHIOPS_SAMPLES_DIR}\Mushroom\Mushroom.kdic" - File "${KHIOPS_SAMPLES_DIR}\Mushroom\Mushroom.txt" - SetOutPath "$SamplesInstallDir\Letter" - File "${KHIOPS_SAMPLES_DIR}\Letter\Letter.kdic" - File "${KHIOPS_SAMPLES_DIR}\Letter\Letter.txt" - SetOutPath "$SamplesInstallDir\SpliceJunction" - File "${KHIOPS_SAMPLES_DIR}\SpliceJunction\SpliceJunction.kdic" - File "${KHIOPS_SAMPLES_DIR}\SpliceJunction\SpliceJunction.txt" - File "${KHIOPS_SAMPLES_DIR}\SpliceJunction\SpliceJunctionDNA.txt" - SetOutPath "$SamplesInstallDir\Accidents" - File "${KHIOPS_SAMPLES_DIR}\Accidents\Accidents.kdic" - File "${KHIOPS_SAMPLES_DIR}\Accidents\Accidents.txt" - File "${KHIOPS_SAMPLES_DIR}\Accidents\Places.txt" - File "${KHIOPS_SAMPLES_DIR}\Accidents\Users.txt" - File "${KHIOPS_SAMPLES_DIR}\Accidents\Vehicles.txt" - File "${KHIOPS_SAMPLES_DIR}\Accidents\train.py" - File "/oname=README.txt" "${KHIOPS_SAMPLES_DIR}\Accidents\README.md" - SetOutPath "$SamplesInstallDir\Accidents\raw" - File "${KHIOPS_SAMPLES_DIR}\Accidents\raw\AccidentsPreprocess.kdic" - File "${KHIOPS_SAMPLES_DIR}\Accidents\raw\AccidentsCreateTarget.kdic" - File "${KHIOPS_SAMPLES_DIR}\Accidents\raw\Description_BD_ONISR.pdf" - File "${KHIOPS_SAMPLES_DIR}\Accidents\raw\Licence_Ouverte.pdf" - File "${KHIOPS_SAMPLES_DIR}\Accidents\raw\caracteristiques-2018.csv" - File "${KHIOPS_SAMPLES_DIR}\Accidents\raw\lieux-2018.csv" - File "${KHIOPS_SAMPLES_DIR}\Accidents\raw\usagers-2018.csv" - File "${KHIOPS_SAMPLES_DIR}\Accidents\raw\vehicules-2018.csv" - File "${KHIOPS_SAMPLES_DIR}\Accidents\raw\preprocess.py" - File "/oname=README.txt" "${KHIOPS_SAMPLES_DIR}\Accidents\raw\README.md" - SetOutPath "$SamplesInstallDir\AccidentsSummary" - File "${KHIOPS_SAMPLES_DIR}\AccidentsSummary\Accidents.kdic" - File "${KHIOPS_SAMPLES_DIR}\AccidentsSummary\Accidents.txt" - File "${KHIOPS_SAMPLES_DIR}\AccidentsSummary\Vehicles.txt" - File "/oname=README.txt" "${KHIOPS_SAMPLES_DIR}\AccidentsSummary\README.md" - SetOutPath "$SamplesInstallDir\Customer" - File "${KHIOPS_SAMPLES_DIR}\Customer\Customer.kdic" - File "${KHIOPS_SAMPLES_DIR}\Customer\CustomerRecoded.kdic" - File "${KHIOPS_SAMPLES_DIR}\Customer\Customer.txt" - File "${KHIOPS_SAMPLES_DIR}\Customer\Address.txt" - File "${KHIOPS_SAMPLES_DIR}\Customer\Service.txt" - File "${KHIOPS_SAMPLES_DIR}\Customer\Usage.txt" - File "${KHIOPS_SAMPLES_DIR}\Customer\sort_and_recode_customer.py" - File "/oname=README.txt" "${KHIOPS_SAMPLES_DIR}\Customer\README.md" - SetOutPath "$SamplesInstallDir\Customer\unsorted" - File "${KHIOPS_SAMPLES_DIR}\Customer\unsorted\Customer-unsorted.txt" - File "${KHIOPS_SAMPLES_DIR}\Customer\unsorted\Address-unsorted.txt" - File "${KHIOPS_SAMPLES_DIR}\Customer\unsorted\Service-unsorted.txt" - File "${KHIOPS_SAMPLES_DIR}\Customer\unsorted\Usage-unsorted.txt" - SetOutPath "$SamplesInstallDir\CustomerExtended" - File "${KHIOPS_SAMPLES_DIR}\CustomerExtended\Customer.kdic" - File "${KHIOPS_SAMPLES_DIR}\CustomerExtended\CustomerRecoded.kdic" - File "${KHIOPS_SAMPLES_DIR}\CustomerExtended\Customer.txt" - File "${KHIOPS_SAMPLES_DIR}\CustomerExtended\Address.txt" - File "${KHIOPS_SAMPLES_DIR}\CustomerExtended\Service.txt" - File "${KHIOPS_SAMPLES_DIR}\CustomerExtended\Usage.txt" - File "${KHIOPS_SAMPLES_DIR}\CustomerExtended\City.txt" - File "${KHIOPS_SAMPLES_DIR}\CustomerExtended\Country.txt" - File "${KHIOPS_SAMPLES_DIR}\CustomerExtended\Product.txt" - File "${KHIOPS_SAMPLES_DIR}\CustomerExtended\recode_customer.py" - File "/oname=README.txt" "${KHIOPS_SAMPLES_DIR}\CustomerExtended\README.md" - SetOutPath "$SamplesInstallDir\NegativeAirlineTweets" - File "${KHIOPS_SAMPLES_DIR}\NegativeAirlineTweets\NegativeAirlineTweets.kdic" - File "${KHIOPS_SAMPLES_DIR}\NegativeAirlineTweets\NegativeAirlineTweets.txt" - File "/oname=README.txt" "${KHIOPS_SAMPLES_DIR}\NegativeAirlineTweets\README.md" - SetOutPath "$SamplesInstallDir\WineReviews" - File "${KHIOPS_SAMPLES_DIR}\WineReviews\WineReviews.kdic" - File "${KHIOPS_SAMPLES_DIR}\WineReviews\WineReviews.txt" - File "/oname=README.txt" "${KHIOPS_SAMPLES_DIR}\WineReviews\README.md" - ${EndIf} - - # Install JRE - SetOutPath $INSTDIR\jre - File /nonfatal /a /r "${JRE_PATH}\" - - # Install Khiops Visualization App - - # Add the installer file - SetOutPath $TEMP - File ${KHIOPS_VIZ_INSTALLER_PATH} - - # Execute Khiops visualization installer: - # - It is not executed with silent mode so the user can customize the install - # - It is executed with "cmd /C" so it opens the installer options window - Var /Global KHIOPS_VIZ_INSTALLER_FILENAME - ${GetFileName} ${KHIOPS_VIZ_INSTALLER_PATH} $KHIOPS_VIZ_INSTALLER_FILENAME - ${If} ${Silent} - nsexec::Exec 'cmd /C "$KHIOPS_VIZ_INSTALLER_FILENAME /S"' - ${Else} - nsexec::Exec 'cmd /C "$KHIOPS_VIZ_INSTALLER_FILENAME"' - ${EndIf} - Pop $0 - DetailPrint "Installation of Khiops visualization: $0" - - # Delete the installer - Delete "$TEMP\KHIOPS_VIZ_INSTALLER_FILENAME" - - ############################# - # Finalize the installation # - ############################# - - # Create the Khiops shell - FileOpen $0 "$INSTDIR\bin\shell_khiops.cmd" w - FileWrite $0 '@echo off$\r$\n' - FileWrite $0 'REM Open a shell session with access to Khiops$\r$\n' - FileWrite $0 `if "%KHIOPS_HOME%".=="". set KHIOPS_HOME=$INSTDIR$\r$\n` - FileWrite $0 'set path=%KHIOPS_HOME%\bin;%path%$\r$\n' - FileWrite $0 'title Shell Khiops$\r$\n' - FileWrite $0 'start "Shell Khiops" cmd /k "echo Welcome to Khiops scripting mode & echo Type khiops -h or khiops_coclustering -h to get help' - FileClose $0 - - # Create the uninstaller - WriteUninstaller "$INSTDIR\uninstall-khiops.exe" - - - ##################################### - # Windows environment customization # - # ################################### - - # Write registry keys to add Khiops in the Add/Remove Programs pane - WriteRegStr HKLM "Software\Khiops" "" $INSTDIR - WriteRegStr HKLM "${UninstallerKey}\Khiops" "UninstallString" '"$INSTDIR\uninstall-khiops.exe"' - WriteRegStr HKLM "${UninstallerKey}\Khiops" "InstallLocation" "$INSTDIR" - WriteRegStr HKLM "${UninstallerKey}\Khiops" "DisplayName" "Khiops" - WriteRegStr HKLM "${UninstallerKey}\Khiops" "Publisher" "Orange" - WriteRegStr HKLM "${UninstallerKey}\Khiops" "DisplayIcon" "$INSTDIR\bin\icons\installer.ico" - WriteRegStr HKLM "${UninstallerKey}\Khiops" "DisplayVersion" "${KHIOPS_VERSION}" - WriteRegStr HKLM "${UninstallerKey}\Khiops" "URLInfoAbout" "https://khiops.org" - WriteRegDWORD HKLM "${UninstallerKey}\Khiops" "NoModify" "1" - WriteRegDWORD HKLM "${UninstallerKey}\Khiops" "NoRepair" "1" - - # Set as the startup dir for all executable shortcuts (yes it is done with SetOutPath!) - ${If} $GlobalKhiopsDataDir != "" - SetOutPath $GlobalKhiopsDataDir - ${Else} - SetOutPath $INSTDIR - ${EndIf} - - # Create application shortcuts in the installation directory - DetailPrint "Installing Start menu Shortcut..." - # - # Attention, pour la commande dans un shortcut, il faut utiliser des (") autour du fichier de commande en parametre du launcher, ce qui en NSIS se fait par ($\") - # "C:\Program files\khiops\bin\_khiopslauncher.exe" "C:\Program files\khiops\bin\khiops.cmd" - # Cf. https://nsis.sourceforge.io/How_can_I_use_quotes_in_a_string%3F - # - CreateShortCut "$INSTDIR\Khiops.lnk" "$INSTDIR\bin\_khiopslauncher.exe" "$\"$INSTDIR\bin\khiops.cmd$\"" "$INSTDIR\bin\icons\khiops.ico" 0 SW_SHOWNORMAL - CreateShortCut "$INSTDIR\Khiops Coclustering.lnk" "$INSTDIR\bin\_khiopslauncher.exe" "$\"$INSTDIR\bin\khiops_coclustering.cmd$\"" "$INSTDIR\bin\icons\khiops_coclustering.ico" 0 SW_SHOWNORMAL - ExpandEnvStrings $R0 "%COMSPEC%" - CreateShortCut "$INSTDIR\Shell Khiops.lnk" "$INSTDIR\bin\_khiopslauncher.exe" "$\"$INSTDIR\bin\shell_khiops.cmd$\"" "$R0" - - # Create start menu shortcuts for the executables - DetailPrint "Installing Start menu Shortcut..." - CreateDirectory "$SMPROGRAMS\Khiops" - CreateShortCut "$SMPROGRAMS\Khiops\Khiops.lnk" "$INSTDIR\bin\_khiopslauncher.exe" "$\"$INSTDIR\bin\khiops.cmd$\"" "$INSTDIR\bin\icons\khiops.ico" 0 SW_SHOWNORMAL - CreateShortCut "$SMPROGRAMS\Khiops\Khiops Coclustering.lnk" "$INSTDIR\bin\_khiopslauncher.exe" "$\"$INSTDIR\bin\khiops_coclustering.cmd$\"" "$INSTDIR\bin\icons\khiops_coclustering.ico" 0 SW_SHOWNORMAL - ExpandEnvStrings $R0 "%COMSPEC%" - CreateShortCut "$SMPROGRAMS\Khiops\Shell Khiops.lnk" "$INSTDIR\bin\_khiopslauncher.exe" "$\"$INSTDIR\bin\shell_khiops.cmd$\"" "$R0" - CreateShortCut "$SMPROGRAMS\Khiops\Uninstall.lnk" "$INSTDIR\uninstall-khiops.exe" - SetOutPath "$INSTDIR" - - # Define aliases for the following registry keys (also used in the uninstaller section) - # - HKLM (all users) - # - HKCU (current user) - !define env_hklm 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"' - !define env_hkcu 'HKCU "Environment"' - - # Set KHIOPS_HOME for the local machine and current user - WriteRegExpandStr ${env_hklm} "KHIOPS_HOME" "$INSTDIR" - WriteRegExpandStr ${env_hkcu} "KHIOPS_HOME" "$INSTDIR" - - # Make sure windows knows about the change - SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000 - - # Register file association for Khiops visualisation tools - # inspired from examples\makensis.nsi - - # Khiops dictionary file extension - ReadRegStr $R0 HKCR ".kdic" "" - ${if} $R0 == "Khiops.Dictionary.File" - DeleteRegKey HKCR "Khiops.Dictionary.File" - ${EndIf} - WriteRegStr HKCR ".kdic" "" "Khiops.Dictionary.File" - WriteRegStr HKCR "Khiops.Dictionary.File" "" "Khiops Dictionary File" - ReadRegStr $R0 HKCR "Khiops.Dictionary.File\shell\open\command" "" - ${If} $R0 == "" - WriteRegStr HKCR "Khiops.Dictionary.File\shell" "" "open" - WriteRegStr HKCR "Khiops.Dictionary.File\shell\open\command" "" 'notepad.exe "%1"' - ${EndIf} - - # Khiops scenario file - ReadRegStr $R0 HKCR "._kh" "" - ${if} $R0 == "Khiops.File" - DeleteRegKey HKCR "Khiops.File" - ${EndIf} - WriteRegStr HKCR "._kh" "" "Khiops.File" - WriteRegStr HKCR "Khiops.File" "" "Khiops File" - WriteRegStr HKCR "Khiops.File\DefaultIcon" "" "$INSTDIR\bin\icons\khiops.ico" - ReadRegStr $R0 HKCR "Khiops.File\shell\open\command" "" - ${If} $R0 == "" - WriteRegStr HKCR "Khiops.File\shell" "" "open" - WriteRegStr HKCR "Khiops.File\shell\open\command" "" 'notepad.exe "%1"' - ${EndIf} - WriteRegStr HKCR "Khiops.File\shell\compile" "" "Execute Khiops Script" - # - # Attention, pour la commande dans la base de registre, il faut utiliser des (\") autour de chaque element de type path - # des parametres du launcher, ce qui en NSIS se fait par (\$\") - # "C:\Program files\khiops\bin\_khiopslauncher.exe" "\"Program files\khiops\bin\khiops.cmd\" -i \"%1\"" - # - WriteRegStr HKCR "Khiops.File\shell\compile\command" "" '"$INSTDIR\bin\_khiopslauncher.exe" "\$\"$INSTDIR\bin\khiops.cmd\$\" -i \$\"%1\$\""' - - - # Khiops coclustering scenario file - ReadRegStr $R0 HKCR "._khc" "" - ${if} $R0 == "Khiops.Coclustering.File" - DeleteRegKey HKCR "Khiops.Coclustering.File" - ${EndIf} - WriteRegStr HKCR "._khc" "" "Khiops.Coclustering.File" - WriteRegStr HKCR "Khiops.Coclustering.File" "" "Khiops Coclustering File" - WriteRegStr HKCR "Khiops.Coclustering.File\DefaultIcon" "" "$INSTDIR\bin\icons\khiops_coclustering.ico" - ReadRegStr $R0 HKCR "Khiops.Coclustering.File\shell\open\command" "" - ${If} $R0 == "" - WriteRegStr HKCR "Khiops.Coclustering.File\shell" "" "open" - WriteRegStr HKCR "Khiops.Coclustering.File\shell\open\command" "" 'notepad.exe "%1"' - ${EndIf} - WriteRegStr HKCR "Khiops.Coclustering.File\shell\compile" "" "Execute Khiops Coclustering Script" - WriteRegStr HKCR "Khiops.Coclustering.File\shell\compile\command" "" '"$INSTDIR\bin\_khiopslauncher.exe" "\$\"$INSTDIR\bin\khiops_coclustering.cmd\$\" -i \$\"%1\$\""' - - - # Notify the file extension changes - System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)' - - # Debug message - !ifdef DEBUG - Messagebox MB_OK "Installation finished!" - !endif + # In order to have shortcuts and documents for all users + SetShellVarContext all + + # Activate file overwrite + SetOverwrite on + + # Install executables and java libraries + SetOutPath "$INSTDIR\bin" + File "${KHIOPS_WINDOWS_BUILD_DIR}\bin\MODL.exe" + File "${KHIOPS_WINDOWS_BUILD_DIR}\bin\MODL_Coclustering.exe" + File "${KHIOPS_WINDOWS_BUILD_DIR}\bin\_khiopslauncher.exe" + File "${KHIOPS_WINDOWS_BUILD_DIR}\jars\norm.jar" + File "${KHIOPS_WINDOWS_BUILD_DIR}\jars\khiops.jar" + File "${KHIOPS_WINDOWS_BUILD_DIR}\tmp\khiops_env.cmd" + File "${KHIOPS_WINDOWS_BUILD_DIR}\tmp\khiops.cmd" + File "${KHIOPS_WINDOWS_BUILD_DIR}\tmp\khiops_coclustering.cmd" + + # Install Intel MPI redistributable + File "${INTEL_MPI_BIN_DIR}\hydra_bstrap_proxy.exe" + File "${INTEL_MPI_BIN_DIR}\hydra_pmi_proxy.exe" + File "${INTEL_MPI_BIN_DIR}\mpiexec.exe" + File "${INTEL_MPI_BIN_DIR}\impi.dll" + + # Install third-party licenses (Intel MPI) + SetOutPath "$INSTDIR\licenses" + File "${INTEL_MPI_LICENSES_DIR}\README.txt" + File "${INTEL_MPI_LICENSES_DIR}\Intel-MPI-LICENSE.txt" + + # Install Docs + SetOutPath "$INSTDIR" + File "/oname=LICENSE.txt" "..\..\..\LICENSE" + File "..\..\common\khiops\README.txt" + File "..\..\common\khiops\WHATSNEW.txt" + + # Install icons + SetOutPath "$INSTDIR\bin\icons" + File ".\images\installer.ico" + File "..\..\common\images\khiops.ico" + File "..\..\common\images\khiops_coclustering.ico" + + # Set the samples directory to be located either within %PUBLIC% or %ALLUSERSPROFILE% as fallback + ReadEnvStr $WinPublicDir PUBLIC + ReadEnvStr $AllUsersProfileDir ALLUSERSPROFILE + + ${If} $WinPublicDir != "" + StrCpy $GlobalKhiopsDataDir "$WinPublicDir\khiops_data" + ${ElseIf} $AllUsersProfileDir != "" + StrCpy $GlobalKhiopsDataDir "$AllUsersProfileDir\khiops_data" + ${Else} + StrCpy $GlobalKhiopsDataDir "" + ${EndIf} + + # Debug message + !ifdef DEBUG + ${If} $GlobalKhiopsDataDir == "" + MessageBox MB_OK "Could find PUBLIC nor ALLUSERSPROFILE directories. Samples not installed." + ${Else} + MessageBox MB_OK "Samples will be installed at $GlobalKhiopsDataDir\samples." + ${EndIf} + !endif + + # Install samples only if the directory is defined + ${If} $GlobalKhiopsDataDir != "" + StrCpy $SamplesInstallDir "$GlobalKhiopsDataDir\samples" + SetOutPath "$SamplesInstallDir" + File "/oname=README.txt" "${KHIOPS_SAMPLES_DIR}\README.md" + SetOutPath "$SamplesInstallDir\Adult" + File "${KHIOPS_SAMPLES_DIR}\Adult\Adult.kdic" + File "${KHIOPS_SAMPLES_DIR}\Adult\Adult.txt" + SetOutPath "$SamplesInstallDir\Iris" + File "${KHIOPS_SAMPLES_DIR}\Iris\Iris.kdic" + File "${KHIOPS_SAMPLES_DIR}\Iris\Iris.txt" + SetOutPath "$SamplesInstallDir\Mushroom" + File "${KHIOPS_SAMPLES_DIR}\Mushroom\Mushroom.kdic" + File "${KHIOPS_SAMPLES_DIR}\Mushroom\Mushroom.txt" + SetOutPath "$SamplesInstallDir\Letter" + File "${KHIOPS_SAMPLES_DIR}\Letter\Letter.kdic" + File "${KHIOPS_SAMPLES_DIR}\Letter\Letter.txt" + SetOutPath "$SamplesInstallDir\SpliceJunction" + File "${KHIOPS_SAMPLES_DIR}\SpliceJunction\SpliceJunction.kdic" + File "${KHIOPS_SAMPLES_DIR}\SpliceJunction\SpliceJunction.txt" + File "${KHIOPS_SAMPLES_DIR}\SpliceJunction\SpliceJunctionDNA.txt" + SetOutPath "$SamplesInstallDir\Accidents" + File "${KHIOPS_SAMPLES_DIR}\Accidents\Accidents.kdic" + File "${KHIOPS_SAMPLES_DIR}\Accidents\Accidents.txt" + File "${KHIOPS_SAMPLES_DIR}\Accidents\Places.txt" + File "${KHIOPS_SAMPLES_DIR}\Accidents\Users.txt" + File "${KHIOPS_SAMPLES_DIR}\Accidents\Vehicles.txt" + File "${KHIOPS_SAMPLES_DIR}\Accidents\train.py" + File "/oname=README.txt" "${KHIOPS_SAMPLES_DIR}\Accidents\README.md" + SetOutPath "$SamplesInstallDir\Accidents\raw" + File "${KHIOPS_SAMPLES_DIR}\Accidents\raw\AccidentsPreprocess.kdic" + File "${KHIOPS_SAMPLES_DIR}\Accidents\raw\AccidentsCreateTarget.kdic" + File "${KHIOPS_SAMPLES_DIR}\Accidents\raw\Description_BD_ONISR.pdf" + File "${KHIOPS_SAMPLES_DIR}\Accidents\raw\Licence_Ouverte.pdf" + File "${KHIOPS_SAMPLES_DIR}\Accidents\raw\caracteristiques-2018.csv" + File "${KHIOPS_SAMPLES_DIR}\Accidents\raw\lieux-2018.csv" + File "${KHIOPS_SAMPLES_DIR}\Accidents\raw\usagers-2018.csv" + File "${KHIOPS_SAMPLES_DIR}\Accidents\raw\vehicules-2018.csv" + File "${KHIOPS_SAMPLES_DIR}\Accidents\raw\preprocess.py" + File "/oname=README.txt" "${KHIOPS_SAMPLES_DIR}\Accidents\raw\README.md" + SetOutPath "$SamplesInstallDir\AccidentsSummary" + File "${KHIOPS_SAMPLES_DIR}\AccidentsSummary\Accidents.kdic" + File "${KHIOPS_SAMPLES_DIR}\AccidentsSummary\Accidents.txt" + File "${KHIOPS_SAMPLES_DIR}\AccidentsSummary\Vehicles.txt" + File "/oname=README.txt" "${KHIOPS_SAMPLES_DIR}\AccidentsSummary\README.md" + SetOutPath "$SamplesInstallDir\Customer" + File "${KHIOPS_SAMPLES_DIR}\Customer\Customer.kdic" + File "${KHIOPS_SAMPLES_DIR}\Customer\CustomerRecoded.kdic" + File "${KHIOPS_SAMPLES_DIR}\Customer\Customer.txt" + File "${KHIOPS_SAMPLES_DIR}\Customer\Address.txt" + File "${KHIOPS_SAMPLES_DIR}\Customer\Service.txt" + File "${KHIOPS_SAMPLES_DIR}\Customer\Usage.txt" + File "${KHIOPS_SAMPLES_DIR}\Customer\sort_and_recode_customer.py" + File "/oname=README.txt" "${KHIOPS_SAMPLES_DIR}\Customer\README.md" + SetOutPath "$SamplesInstallDir\Customer\unsorted" + File "${KHIOPS_SAMPLES_DIR}\Customer\unsorted\Customer-unsorted.txt" + File "${KHIOPS_SAMPLES_DIR}\Customer\unsorted\Address-unsorted.txt" + File "${KHIOPS_SAMPLES_DIR}\Customer\unsorted\Service-unsorted.txt" + File "${KHIOPS_SAMPLES_DIR}\Customer\unsorted\Usage-unsorted.txt" + SetOutPath "$SamplesInstallDir\CustomerExtended" + File "${KHIOPS_SAMPLES_DIR}\CustomerExtended\Customer.kdic" + File "${KHIOPS_SAMPLES_DIR}\CustomerExtended\CustomerRecoded.kdic" + File "${KHIOPS_SAMPLES_DIR}\CustomerExtended\Customer.txt" + File "${KHIOPS_SAMPLES_DIR}\CustomerExtended\Address.txt" + File "${KHIOPS_SAMPLES_DIR}\CustomerExtended\Service.txt" + File "${KHIOPS_SAMPLES_DIR}\CustomerExtended\Usage.txt" + File "${KHIOPS_SAMPLES_DIR}\CustomerExtended\City.txt" + File "${KHIOPS_SAMPLES_DIR}\CustomerExtended\Country.txt" + File "${KHIOPS_SAMPLES_DIR}\CustomerExtended\Product.txt" + File "${KHIOPS_SAMPLES_DIR}\CustomerExtended\recode_customer.py" + File "/oname=README.txt" "${KHIOPS_SAMPLES_DIR}\CustomerExtended\README.md" + SetOutPath "$SamplesInstallDir\NegativeAirlineTweets" + File "${KHIOPS_SAMPLES_DIR}\NegativeAirlineTweets\NegativeAirlineTweets.kdic" + File "${KHIOPS_SAMPLES_DIR}\NegativeAirlineTweets\NegativeAirlineTweets.txt" + File "/oname=README.txt" "${KHIOPS_SAMPLES_DIR}\NegativeAirlineTweets\README.md" + SetOutPath "$SamplesInstallDir\WineReviews" + File "${KHIOPS_SAMPLES_DIR}\WineReviews\WineReviews.kdic" + File "${KHIOPS_SAMPLES_DIR}\WineReviews\WineReviews.txt" + File "/oname=README.txt" "${KHIOPS_SAMPLES_DIR}\WineReviews\README.md" + ${EndIf} + + # Install JRE + SetOutPath $INSTDIR\jre + File /NONFATAL /a /r "${JRE_PATH}\" + + # Install Khiops Visualization App + + # Add the installer file + SetOutPath $TEMP + File ${KHIOPS_VIZ_INSTALLER_PATH} + + # Execute Khiops visualization installer: + # - It is not executed with silent mode so the user can customize the install + # - It is executed with "cmd /C" so it opens the installer options window + Var /GLOBAL KHIOPS_VIZ_INSTALLER_FILENAME + ${GetFileName} ${KHIOPS_VIZ_INSTALLER_PATH} $KHIOPS_VIZ_INSTALLER_FILENAME + + ${If} ${Silent} + nsexec::Exec 'cmd /C "$KHIOPS_VIZ_INSTALLER_FILENAME /S"' + ${Else} + nsexec::Exec 'cmd /C "$KHIOPS_VIZ_INSTALLER_FILENAME"' + ${EndIf} + + Pop $0 + DetailPrint "Installation of Khiops visualization: $0" + + # Delete the installer + Delete "$TEMP\KHIOPS_VIZ_INSTALLER_FILENAME" + + # ############################ + # Finalize the installation # + # ############################ + + # Create the Khiops shell + FileOpen $0 "$INSTDIR\bin\shell_khiops.cmd" w + FileWrite $0 "@echo off$\r$\n" + FileWrite $0 "REM Open a shell session with access to Khiops$\r$\n" + FileWrite $0 'if "%KHIOPS_HOME%".==". set KHIOPS_HOME=$INSTDIR$\r$\n' + FileWrite $0 "set path=%KHIOPS_HOME%\bin;%path%$\r$\n" + FileWrite $0 "title Shell Khiops$\r$\n" + FileWrite $0 \ + 'start "Shell Khiops" cmd /k "echo Welcome to Khiops scripting mode & echo Type khiops -h or khiops_coclustering -h to get help' + FileClose $0 + + # Create the uninstaller + WriteUninstaller "$INSTDIR\uninstall-khiops.exe" + + # #################################### + # Windows environment customization # + # ################################### + + # Write registry keys to add Khiops in the Add/Remove Programs pane + WriteRegStr HKLM "Software\Khiops" "" $INSTDIR + WriteRegStr HKLM "${UninstallerKey}\Khiops" "UninstallString" '"$INSTDIR\uninstall-khiops.exe"' + WriteRegStr HKLM "${UninstallerKey}\Khiops" "InstallLocation" "$INSTDIR" + WriteRegStr HKLM "${UninstallerKey}\Khiops" "DisplayName" "Khiops" + WriteRegStr HKLM "${UninstallerKey}\Khiops" "Publisher" "Orange" + WriteRegStr HKLM "${UninstallerKey}\Khiops" "DisplayIcon" "$INSTDIR\bin\icons\installer.ico" + WriteRegStr HKLM "${UninstallerKey}\Khiops" "DisplayVersion" "${KHIOPS_VERSION}" + WriteRegStr HKLM "${UninstallerKey}\Khiops" "URLInfoAbout" "https://khiops.org" + WriteRegDWORD HKLM "${UninstallerKey}\Khiops" "NoModify" "1" + WriteRegDWORD HKLM "${UninstallerKey}\Khiops" "NoRepair" "1" + + # Set as the startup dir for all executable shortcuts (yes it is done with SetOutPath!) + ${If} $GlobalKhiopsDataDir != "" + SetOutPath $GlobalKhiopsDataDir + ${Else} + SetOutPath $INSTDIR + ${EndIf} + + # Create application shortcuts in the installation directory + DetailPrint "Installing Start menu Shortcut..." + # + # Attention, pour la commande dans un shortcut, il faut utiliser des (") autour du fichier de commande en parametre du launcher, ce qui en NSIS se fait par ($\") + # "C:\Program files\khiops\bin\_khiopslauncher.exe" "C:\Program files\khiops\bin\khiops.cmd" + # Cf. https://nsis.sourceforge.io/How_can_I_use_quotes_in_a_string%3F + # + CreateShortcut "$INSTDIR\Khiops.lnk" "$INSTDIR\bin\_khiopslauncher.exe" '"$INSTDIR\bin\khiops.cmd"' \ + "$INSTDIR\bin\icons\khiops.ico" 0 SW_SHOWNORMAL + CreateShortcut "$INSTDIR\Khiops Coclustering.lnk" "$INSTDIR\bin\_khiopslauncher.exe" \ + '"$INSTDIR\bin\khiops_coclustering.cmd"' "$INSTDIR\bin\icons\khiops_coclustering.ico" 0 SW_SHOWNORMAL + ExpandEnvStrings $R0 "%COMSPEC%" + CreateShortcut "$INSTDIR\Shell Khiops.lnk" "$INSTDIR\bin\_khiopslauncher.exe" '"$INSTDIR\bin\shell_khiops.cmd"' "$R0" + + # Create start menu shortcuts for the executables + DetailPrint "Installing Start menu Shortcut..." + CreateDirectory "$SMPROGRAMS\Khiops" + CreateShortcut "$SMPROGRAMS\Khiops\Khiops.lnk" "$INSTDIR\bin\_khiopslauncher.exe" '"$INSTDIR\bin\khiops.cmd"' \ + "$INSTDIR\bin\icons\khiops.ico" 0 SW_SHOWNORMAL + CreateShortcut "$SMPROGRAMS\Khiops\Khiops Coclustering.lnk" "$INSTDIR\bin\_khiopslauncher.exe" \ + '"$INSTDIR\bin\khiops_coclustering.cmd"' "$INSTDIR\bin\icons\khiops_coclustering.ico" 0 SW_SHOWNORMAL + ExpandEnvStrings $R0 "%COMSPEC%" + CreateShortcut "$SMPROGRAMS\Khiops\Shell Khiops.lnk" "$INSTDIR\bin\_khiopslauncher.exe" \ + '"$INSTDIR\bin\shell_khiops.cmd"' "$R0" + CreateShortcut "$SMPROGRAMS\Khiops\Uninstall.lnk" "$INSTDIR\uninstall-khiops.exe" + SetOutPath "$INSTDIR" + + # Define aliases for the following registry keys (also used in the uninstaller section) + # - HKLM (all users) + # - HKCU (current user) + !define env_hklm 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"' + !define env_hkcu 'HKCU "Environment"' + + # Set KHIOPS_HOME for the local machine and current user + WriteRegExpandStr ${env_hklm} "KHIOPS_HOME" "$INSTDIR" + WriteRegExpandStr ${env_hkcu} "KHIOPS_HOME" "$INSTDIR" + + # Make sure windows knows about the change + SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000 + + # Register file association for Khiops visualisation tools + # inspired from examples\makensis.nsi + + # Khiops dictionary file extension + ReadRegStr $R0 HKCR ".kdic" "" + + ${If} $R0 == "Khiops.Dictionary.File" + DeleteRegKey HKCR "Khiops.Dictionary.File" + ${EndIf} + + WriteRegStr HKCR ".kdic" "" "Khiops.Dictionary.File" + WriteRegStr HKCR "Khiops.Dictionary.File" "" "Khiops Dictionary File" + ReadRegStr $R0 HKCR "Khiops.Dictionary.File\shell\open\command" "" + + ${If} $R0 == "" + WriteRegStr HKCR "Khiops.Dictionary.File\shell" "" "open" + WriteRegStr HKCR "Khiops.Dictionary.File\shell\open\command" "" 'notepad.exe "%1"' + ${EndIf} + + # Khiops scenario file + ReadRegStr $R0 HKCR "._kh" "" + + ${If} $R0 == "Khiops.File" + DeleteRegKey HKCR "Khiops.File" + ${EndIf} + + WriteRegStr HKCR "._kh" "" "Khiops.File" + WriteRegStr HKCR "Khiops.File" "" "Khiops File" + WriteRegStr HKCR "Khiops.File\DefaultIcon" "" "$INSTDIR\bin\icons\khiops.ico" + ReadRegStr $R0 HKCR "Khiops.File\shell\open\command" "" + + ${If} $R0 == "" + WriteRegStr HKCR "Khiops.File\shell" "" "open" + WriteRegStr HKCR "Khiops.File\shell\open\command" "" 'notepad.exe "%1"' + ${EndIf} + + WriteRegStr HKCR "Khiops.File\shell\compile" "" "Execute Khiops Script" + # + # Attention, pour la commande dans la base de registre, il faut utiliser des (\") autour de chaque element de type path + # des parametres du launcher, ce qui en NSIS se fait par (\$\") + # "C:\Program files\khiops\bin\_khiopslauncher.exe" "\"Program files\khiops\bin\khiops.cmd\" -i \"%1\"" + # + WriteRegStr HKCR "Khiops.File\shell\compile\command" "" \ + '"$INSTDIR\bin\_khiopslauncher.exe" "\"$INSTDIR\bin\khiops.cmd\" -i \"%1\"' + + # Khiops coclustering scenario file + ReadRegStr $R0 HKCR "._khc" "" + + ${If} $R0 == "Khiops.Coclustering.File" + DeleteRegKey HKCR "Khiops.Coclustering.File" + ${EndIf} + + WriteRegStr HKCR "._khc" "" "Khiops.Coclustering.File" + WriteRegStr HKCR "Khiops.Coclustering.File" "" "Khiops Coclustering File" + WriteRegStr HKCR "Khiops.Coclustering.File\DefaultIcon" "" "$INSTDIR\bin\icons\khiops_coclustering.ico" + ReadRegStr $R0 HKCR "Khiops.Coclustering.File\shell\open\command" "" + + ${If} $R0 == "" + WriteRegStr HKCR "Khiops.Coclustering.File\shell" "" "open" + WriteRegStr HKCR "Khiops.Coclustering.File\shell\open\command" "" 'notepad.exe "%1"' + ${EndIf} + + WriteRegStr HKCR "Khiops.Coclustering.File\shell\compile" "" "Execute Khiops Coclustering Script" + WriteRegStr HKCR "Khiops.Coclustering.File\shell\compile\command" "" \ + '"$INSTDIR\bin\_khiopslauncher.exe" "\"$INSTDIR\bin\khiops_coclustering.cmd\" -i \"%1\"' + + # Notify the file extension changes + System::Call "Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)" + + # Debug message + !ifdef DEBUG + MessageBox MB_OK "Installation finished!" + !endif SectionEnd - -############### +# ############## # Uninstaller # -############### +# ############## Section "Uninstall" - # In order to have shortcuts and documents for all users - SetShellVarContext all - - # Restore Registry # - # Unregister file associations - DetailPrint "Uninstalling Khiops Shell Extensions..." - - # Unregister Khiops dictionary file extension - ${If} $R0 == "Khiops.Dictionary.File" - DeleteRegKey HKCR ".kdic" - ${EndIf} - DeleteRegKey HKCR "Khiops.Dictionary.File" - - # Unregister Khiops file extension - ${If} $R0 == "Khiops.File" - DeleteRegKey HKCR "._kh" - ${EndIf} - DeleteRegKey HKCR "Khiops.File" - - # Unregister Khiops coclustering file extension - ${If} $R0 == "Khiops.Coclustering.File" - DeleteRegKey HKCR "._khc" - ${EndIf} - DeleteRegKey HKCR "Khiops.Coclustering.File" - - # Notify file extension changes - System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)' - - # Delete installation folder key - DeleteRegKey HKLM "${UninstallerKey}\Khiops" - DeleteRegKey HKLM "Software\Khiops" - - # Delete environement variable KHIOPS_HOME - DeleteRegValue ${env_hklm} "KHIOPS_HOME" - DeleteRegValue ${env_hkcu} "KHIOPS_HOME" - - # Delete deprecated environment variable KhiopsHome - DeleteRegValue ${env_hklm} "KhiopsHome" - DeleteRegValue ${env_hkcu} "KhiopsHome" - - # Make sure windows knows about the changes in the environment - SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000 - - # Delete files # - # Note: Some directories are removed only if they are completely empty (no "/r" RMDir flag) - DetailPrint "Deleting Files ..." - - # Delete docs - Delete "$INSTDIR\LICENSE.txt" - Delete "$INSTDIR\README.txt" - Delete "$INSTDIR\WHATSNEW.txt" - - # Delete jre - RMDir /r "$INSTDIR\jre" - - # Delete icons - RMDir /r "$INSTDIR\bin\icons" - - # Delete executables and scripts - Delete "$INSTDIR\bin\khiops_env.cmd" - Delete "$INSTDIR\bin\khiops.cmd" - Delete "$INSTDIR\bin\khiops_coclustering.cmd" - Delete "$INSTDIR\bin\MODL.exe" - Delete "$INSTDIR\bin\MODL_Coclustering.exe" - Delete "$INSTDIR\bin\_khiopsgetprocnumber.exe" - Delete "$INSTDIR\bin\_khiopslauncher.exe" - Delete "$INSTDIR\bin\norm.jar" - Delete "$INSTDIR\bin\khiops.jar" - Delete "$INSTDIR\bin\shell_khiops.cmd" - RMDir "$INSTDIR\bin" - - # Delete shortcuts from install dir - Delete "$INSTDIR\Khiops.lnk" - Delete "$INSTDIR\Khiops Coclustering.lnk" - Delete "$INSTDIR\Shell Khiops.lnk" - - # Delete the installer - Delete "$INSTDIR\uninstall-khiops.exe" - - # Remove install directory - RMDir "$INSTDIR" - - # Delete desktop shortcuts - Delete "$DESKTOP\Khiops.lnk" - Delete "$DESKTOP\Khiops Coclustering.lnk" - Delete "$DESKTOP\Shell Khiops.lnk" - - # Delete Start Menu Shortcuts - RMDir /r "$SMPROGRAMS\Khiops" - - # Set the samples directory to be located either within %PUBLIC% or %ALLUSERSPROFILE% as fallback - ReadEnvStr $WinPublicDir PUBLIC - ReadEnvStr $AllUsersProfileDir ALLUSERSPROFILE - ${If} $WinPublicDir != "" - StrCpy $GlobalKhiopsDataDir "$WinPublicDir\khiops_data" - ${ElseIf} $AllUsersProfileDir != "" - StrCpy $GlobalKhiopsDataDir "$AllUsersProfileDir\khiops_data" - ${Else} - StrCpy $GlobalKhiopsDataDir "" - ${EndIf} - - # Delete sample datasets - # We do not remove the whole directory to save the users results from Khiops' analyses - ${If} $GlobalKhiopsDataDir != "" - StrCpy $SamplesInstallDir "$GlobalKhiopsDataDir\samples" - Delete "$SamplesInstallDir\AccidentsSummary\Accidents.kdic" - Delete "$SamplesInstallDir\AccidentsSummary\Accidents.txt" - Delete "$SamplesInstallDir\AccidentsSummary\README.txt" - Delete "$SamplesInstallDir\AccidentsSummary\Vehicles.txt" - Delete "$SamplesInstallDir\Accidents\Accidents.kdic" - Delete "$SamplesInstallDir\Accidents\Accidents.txt" - Delete "$SamplesInstallDir\Accidents\Places.txt" - Delete "$SamplesInstallDir\Accidents\README.txt" - Delete "$SamplesInstallDir\Accidents\Users.txt" - Delete "$SamplesInstallDir\Accidents\Vehicles.txt" - Delete "$SamplesInstallDir\Accidents\raw\AccidentsPreprocess.kdic" - Delete "$SamplesInstallDir\Accidents\raw\AccidentsCreateTarget.kdic" - Delete "$SamplesInstallDir\Accidents\raw\Description_BD_ONISR.pdf" - Delete "$SamplesInstallDir\Accidents\raw\Licence_Ouverte.pdf" - Delete "$SamplesInstallDir\Accidents\raw\README.txt" - Delete "$SamplesInstallDir\Accidents\raw\caracteristiques-2018.csv" - Delete "$SamplesInstallDir\Accidents\raw\lieux-2018.csv" - Delete "$SamplesInstallDir\Accidents\raw\preprocess.py" - Delete "$SamplesInstallDir\Accidents\raw\usagers-2018.csv" - Delete "$SamplesInstallDir\Accidents\raw\vehicules-2018.csv" - Delete "$SamplesInstallDir\Accidents\train.py" - Delete "$SamplesInstallDir\Adult\Adult.kdic" - Delete "$SamplesInstallDir\Adult\Adult.txt" - Delete "$SamplesInstallDir\CustomerExtended\Address.txt" - Delete "$SamplesInstallDir\CustomerExtended\City.txt" - Delete "$SamplesInstallDir\CustomerExtended\Country.txt" - Delete "$SamplesInstallDir\CustomerExtended\Customer.kdic" - Delete "$SamplesInstallDir\CustomerExtended\Customer.txt" - Delete "$SamplesInstallDir\CustomerExtended\CustomerRecoded.kdic" - Delete "$SamplesInstallDir\CustomerExtended\Product.txt" - Delete "$SamplesInstallDir\CustomerExtended\README.txt" - Delete "$SamplesInstallDir\CustomerExtended\Service.txt" - Delete "$SamplesInstallDir\CustomerExtended\Usage.txt" - Delete "$SamplesInstallDir\CustomerExtended\recode_customer.py" - Delete "$SamplesInstallDir\Customer\Address.txt" - Delete "$SamplesInstallDir\Customer\Customer.kdic" - Delete "$SamplesInstallDir\Customer\Customer.txt" - Delete "$SamplesInstallDir\Customer\CustomerRecoded.kdic" - Delete "$SamplesInstallDir\Customer\README.txt" - Delete "$SamplesInstallDir\Customer\Service.txt" - Delete "$SamplesInstallDir\Customer\Usage.txt" - Delete "$SamplesInstallDir\Customer\sort_and_recode_customer.py" - Delete "$SamplesInstallDir\Customer\unsorted\Address-unsorted.txt" - Delete "$SamplesInstallDir\Customer\unsorted\Customer-unsorted.txt" - Delete "$SamplesInstallDir\Customer\unsorted\Service-unsorted.txt" - Delete "$SamplesInstallDir\Customer\unsorted\Usage-unsorted.txt" - Delete "$SamplesInstallDir\Iris\Iris.kdic" - Delete "$SamplesInstallDir\Iris\Iris.txt" - Delete "$SamplesInstallDir\Letter\Letter.kdic" - Delete "$SamplesInstallDir\Letter\Letter.txt" - Delete "$SamplesInstallDir\Mushroom\Mushroom.kdic" - Delete "$SamplesInstallDir\Mushroom\Mushroom.txt" - Delete "$SamplesInstallDir\README.txt" - Delete "$SamplesInstallDir\SpliceJunction\SpliceJunction.kdic" - Delete "$SamplesInstallDir\SpliceJunction\SpliceJunction.txt" - Delete "$SamplesInstallDir\SpliceJunction\SpliceJunctionDNA.txt" - Delete "$SamplesInstallDir\NegativeAirlineTweets\NegativeAirlineTweets.kdic" - Delete "$SamplesInstallDir\NegativeAirlineTweets\NegativeAirlineTweets.txt" - Delete "$SamplesInstallDir\NegativeAirlineTweets\README.txt" - Delete "$SamplesInstallDir\WineReviews\WineReviews.kdic" - Delete "$SamplesInstallDir\WineReviews\WineReviews.txt" - Delete "$SamplesInstallDir\WineReviews\README.txt" - RMDir "$SamplesInstallDir\AccidentsSummary\" - RMDir "$SamplesInstallDir\Accidents\raw\" - RMDir "$SamplesInstallDir\Accidents\" - RMDir "$SamplesInstallDir\Adult\" - RMDir "$SamplesInstallDir\CustomerExtended\" - RMDir "$SamplesInstallDir\Customer\unsorted\" - RMDir "$SamplesInstallDir\Customer\" - RMDir "$SamplesInstallDir\Iris\" - RMDir "$SamplesInstallDir\Letter\" - RMDir "$SamplesInstallDir\Mushroom\" - RMDir "$SamplesInstallDir\SpliceJunction\" - RMDir "$SamplesInstallDir\NegativeAirlineTweets\" - RMDir "$SamplesInstallDir\WineReviews\" - RMDir "$SamplesInstallDir" - ${EndIf} + # In order to have shortcuts and documents for all users + SetShellVarContext all + + # Restore Registry # + # Unregister file associations + DetailPrint "Uninstalling Khiops Shell Extensions..." + + # Unregister Khiops dictionary file extension + ${If} $R0 == "Khiops.Dictionary.File" + DeleteRegKey HKCR ".kdic" + ${EndIf} + + DeleteRegKey HKCR "Khiops.Dictionary.File" + + # Unregister Khiops file extension + ${If} $R0 == "Khiops.File" + DeleteRegKey HKCR "._kh" + ${EndIf} + + DeleteRegKey HKCR "Khiops.File" + + # Unregister Khiops coclustering file extension + ${If} $R0 == "Khiops.Coclustering.File" + DeleteRegKey HKCR "._khc" + ${EndIf} + + DeleteRegKey HKCR "Khiops.Coclustering.File" + + # Notify file extension changes + System::Call "Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)" + + # Delete installation folder key + DeleteRegKey HKLM "${UninstallerKey}\Khiops" + DeleteRegKey HKLM "Software\Khiops" + + # Delete environement variable KHIOPS_HOME + DeleteRegValue ${env_hklm} "KHIOPS_HOME" + DeleteRegValue ${env_hkcu} "KHIOPS_HOME" + + # Delete deprecated environment variable KhiopsHome + DeleteRegValue ${env_hklm} "KhiopsHome" + DeleteRegValue ${env_hkcu} "KhiopsHome" + + # Make sure windows knows about the changes in the environment + SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000 + + # Delete files # + # Note: Some directories are removed only if they are completely empty (no "/r" RMDir flag) + DetailPrint "Deleting Files ..." + + # Delete docs + Delete "$INSTDIR\LICENSE.txt" + Delete "$INSTDIR\README.txt" + Delete "$INSTDIR\WHATSNEW.txt" + + # Delete third-party licenses + Delete "$INSTDIR\licenses\README.txt" + Delete "$INSTDIR\licenses\Intel-MPI-LICENSE.txt" + RMDir "$INSTDIR\licenses" + + # Delete jre + RMDir /r "$INSTDIR\jre" + + # Delete icons + RMDir /r "$INSTDIR\bin\icons" + + # Delete executables and scripts + Delete "$INSTDIR\bin\khiops_env.cmd" + Delete "$INSTDIR\bin\khiops.cmd" + Delete "$INSTDIR\bin\khiops_coclustering.cmd" + Delete "$INSTDIR\bin\MODL.exe" + Delete "$INSTDIR\bin\MODL_Coclustering.exe" + Delete "$INSTDIR\bin\_khiopslauncher.exe" + Delete "$INSTDIR\bin\hydra_bstrap_proxy.exe" + Delete "$INSTDIR\bin\hydra_pmi_proxy.exe" + Delete "$INSTDIR\bin\impi.dll" + Delete "$INSTDIR\bin\mpiexec.exe" + Delete "$INSTDIR\bin\norm.jar" + Delete "$INSTDIR\bin\khiops.jar" + Delete "$INSTDIR\bin\shell_khiops.cmd" + RMDir "$INSTDIR\bin" + + # Delete shortcuts from install dir + Delete "$INSTDIR\Khiops.lnk" + Delete "$INSTDIR\Khiops Coclustering.lnk" + Delete "$INSTDIR\Shell Khiops.lnk" + + # Delete the installer + Delete "$INSTDIR\uninstall-khiops.exe" + + # Remove install directory + RMDir "$INSTDIR" + + # Delete desktop shortcuts + Delete "$DESKTOP\Khiops.lnk" + Delete "$DESKTOP\Khiops Coclustering.lnk" + Delete "$DESKTOP\Shell Khiops.lnk" + + # Delete Start Menu Shortcuts + RMDir /r "$SMPROGRAMS\Khiops" + + # Set the samples directory to be located either within %PUBLIC% or %ALLUSERSPROFILE% as fallback + ReadEnvStr $WinPublicDir PUBLIC + ReadEnvStr $AllUsersProfileDir ALLUSERSPROFILE + + ${If} $WinPublicDir != "" + StrCpy $GlobalKhiopsDataDir "$WinPublicDir\khiops_data" + ${ElseIf} $AllUsersProfileDir != "" + StrCpy $GlobalKhiopsDataDir "$AllUsersProfileDir\khiops_data" + ${Else} + StrCpy $GlobalKhiopsDataDir "" + ${EndIf} + + # Delete sample datasets + # We do not remove the whole directory to save the users results from Khiops' analyses + ${If} $GlobalKhiopsDataDir != "" + StrCpy $SamplesInstallDir "$GlobalKhiopsDataDir\samples" + Delete "$SamplesInstallDir\AccidentsSummary\Accidents.kdic" + Delete "$SamplesInstallDir\AccidentsSummary\Accidents.txt" + Delete "$SamplesInstallDir\AccidentsSummary\README.txt" + Delete "$SamplesInstallDir\AccidentsSummary\Vehicles.txt" + Delete "$SamplesInstallDir\Accidents\Accidents.kdic" + Delete "$SamplesInstallDir\Accidents\Accidents.txt" + Delete "$SamplesInstallDir\Accidents\Places.txt" + Delete "$SamplesInstallDir\Accidents\README.txt" + Delete "$SamplesInstallDir\Accidents\Users.txt" + Delete "$SamplesInstallDir\Accidents\Vehicles.txt" + Delete "$SamplesInstallDir\Accidents\raw\AccidentsPreprocess.kdic" + Delete "$SamplesInstallDir\Accidents\raw\AccidentsCreateTarget.kdic" + Delete "$SamplesInstallDir\Accidents\raw\Description_BD_ONISR.pdf" + Delete "$SamplesInstallDir\Accidents\raw\Licence_Ouverte.pdf" + Delete "$SamplesInstallDir\Accidents\raw\README.txt" + Delete "$SamplesInstallDir\Accidents\raw\caracteristiques-2018.csv" + Delete "$SamplesInstallDir\Accidents\raw\lieux-2018.csv" + Delete "$SamplesInstallDir\Accidents\raw\preprocess.py" + Delete "$SamplesInstallDir\Accidents\raw\usagers-2018.csv" + Delete "$SamplesInstallDir\Accidents\raw\vehicules-2018.csv" + Delete "$SamplesInstallDir\Accidents\train.py" + Delete "$SamplesInstallDir\Adult\Adult.kdic" + Delete "$SamplesInstallDir\Adult\Adult.txt" + Delete "$SamplesInstallDir\CustomerExtended\Address.txt" + Delete "$SamplesInstallDir\CustomerExtended\City.txt" + Delete "$SamplesInstallDir\CustomerExtended\Country.txt" + Delete "$SamplesInstallDir\CustomerExtended\Customer.kdic" + Delete "$SamplesInstallDir\CustomerExtended\Customer.txt" + Delete "$SamplesInstallDir\CustomerExtended\CustomerRecoded.kdic" + Delete "$SamplesInstallDir\CustomerExtended\Product.txt" + Delete "$SamplesInstallDir\CustomerExtended\README.txt" + Delete "$SamplesInstallDir\CustomerExtended\Service.txt" + Delete "$SamplesInstallDir\CustomerExtended\Usage.txt" + Delete "$SamplesInstallDir\CustomerExtended\recode_customer.py" + Delete "$SamplesInstallDir\Customer\Address.txt" + Delete "$SamplesInstallDir\Customer\Customer.kdic" + Delete "$SamplesInstallDir\Customer\Customer.txt" + Delete "$SamplesInstallDir\Customer\CustomerRecoded.kdic" + Delete "$SamplesInstallDir\Customer\README.txt" + Delete "$SamplesInstallDir\Customer\Service.txt" + Delete "$SamplesInstallDir\Customer\Usage.txt" + Delete "$SamplesInstallDir\Customer\sort_and_recode_customer.py" + Delete "$SamplesInstallDir\Customer\unsorted\Address-unsorted.txt" + Delete "$SamplesInstallDir\Customer\unsorted\Customer-unsorted.txt" + Delete "$SamplesInstallDir\Customer\unsorted\Service-unsorted.txt" + Delete "$SamplesInstallDir\Customer\unsorted\Usage-unsorted.txt" + Delete "$SamplesInstallDir\Iris\Iris.kdic" + Delete "$SamplesInstallDir\Iris\Iris.txt" + Delete "$SamplesInstallDir\Letter\Letter.kdic" + Delete "$SamplesInstallDir\Letter\Letter.txt" + Delete "$SamplesInstallDir\Mushroom\Mushroom.kdic" + Delete "$SamplesInstallDir\Mushroom\Mushroom.txt" + Delete "$SamplesInstallDir\README.txt" + Delete "$SamplesInstallDir\SpliceJunction\SpliceJunction.kdic" + Delete "$SamplesInstallDir\SpliceJunction\SpliceJunction.txt" + Delete "$SamplesInstallDir\SpliceJunction\SpliceJunctionDNA.txt" + Delete "$SamplesInstallDir\NegativeAirlineTweets\NegativeAirlineTweets.kdic" + Delete "$SamplesInstallDir\NegativeAirlineTweets\NegativeAirlineTweets.txt" + Delete "$SamplesInstallDir\NegativeAirlineTweets\README.txt" + Delete "$SamplesInstallDir\WineReviews\WineReviews.kdic" + Delete "$SamplesInstallDir\WineReviews\WineReviews.txt" + Delete "$SamplesInstallDir\WineReviews\README.txt" + RMDir "$SamplesInstallDir\AccidentsSummary\" + RMDir "$SamplesInstallDir\Accidents\raw\" + RMDir "$SamplesInstallDir\Accidents\" + RMDir "$SamplesInstallDir\Adult\" + RMDir "$SamplesInstallDir\CustomerExtended\" + RMDir "$SamplesInstallDir\Customer\unsorted\" + RMDir "$SamplesInstallDir\Customer\" + RMDir "$SamplesInstallDir\Iris\" + RMDir "$SamplesInstallDir\Letter\" + RMDir "$SamplesInstallDir\Mushroom\" + RMDir "$SamplesInstallDir\SpliceJunction\" + RMDir "$SamplesInstallDir\NegativeAirlineTweets\" + RMDir "$SamplesInstallDir\WineReviews\" + RMDir "$SamplesInstallDir" + ${EndIf} SectionEnd - -####################### +# ###################### # Installer Functions # -####################### +# ###################### Function "CreateDesktopShortcuts" - # Set as the startup dir for all executable shortcuts (yes it is done with SetOutPath!) - ${If} $GlobalKhiopsDataDir != "" - SetOutPath $GlobalKhiopsDataDir - ${Else} - SetOutPath $INSTDIR - ${EndIf} - - # Create the shortcuts - DetailPrint "Installing Desktop Shortcut..." - CreateShortCut "$DESKTOP\Khiops.lnk" "$INSTDIR\bin\_khiopslauncher.exe" "$\"$INSTDIR\bin\khiops.cmd$\"" "$INSTDIR\bin\icons\khiops.ico" 0 SW_SHOWNORMAL - CreateShortCut "$DESKTOP\Khiops Coclustering.lnk" "$INSTDIR\bin\_khiopslauncher.exe" "$\"$INSTDIR\bin\khiops_coclustering.cmd$\"" "$INSTDIR\bin\icons\khiops_coclustering.ico" 0 SW_SHOWNORMAL + # Set as the startup dir for all executable shortcuts (yes it is done with SetOutPath!) + ${If} $GlobalKhiopsDataDir != "" + SetOutPath $GlobalKhiopsDataDir + ${Else} + SetOutPath $INSTDIR + ${EndIf} + + # Create the shortcuts + DetailPrint "Installing Desktop Shortcut..." + CreateShortcut "$DESKTOP\Khiops.lnk" "$INSTDIR\bin\_khiopslauncher.exe" '"$INSTDIR\bin\khiops.cmd"' \ + "$INSTDIR\bin\icons\khiops.ico" 0 SW_SHOWNORMAL + CreateShortcut "$DESKTOP\Khiops Coclustering.lnk" "$INSTDIR\bin\_khiopslauncher.exe" \ + '"$INSTDIR\bin\khiops_coclustering.cmd"' "$INSTDIR\bin\icons\khiops_coclustering.ico" 0 SW_SHOWNORMAL FunctionEnd # Predefined initialization install function Function .onInit - - # Read location of the uninstaller - ReadRegStr $PreviousUninstaller HKLM "${UninstallerKey}\Khiops" "UninstallString" - ReadRegStr $PreviousVersion HKLM "${UninstallerKey}\Khiops" "DisplayVersion" - - # Ask the user to proceed if there was already a previous Khiops version installed - # In silent mode: remove previous version - ${If} $PreviousUninstaller != "" - MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \ - "Khiops $PreviousVersion is already installed. $\n$\nClick OK to remove the \ - previous version $\n$\nor Cancel to cancel this upgrade." \ - /SD IDOK IDOK uninst - Abort - - # Run the uninstaller - uninst: - ClearErrors - ExecWait '$PreviousUninstaller /S _?=$INSTDIR' - - # Run again the uninstaller to delete the uninstaller itself and the root dir (without waiting) - # Must not be used in silent mode (may delete files from silent following installation) - ${IfNot} ${Silent} - ExecWait '$PreviousUninstaller /S' - ${EndIf} - ${EndIf} - - # Choice of default installation directory, for windows 32 or 64 - ${If} $INSTDIR == "" - ${If} ${RunningX64} - StrCpy $INSTDIR "$PROGRAMFILES64\khiops" - # No 32-bit install - ${EndIf} - ${EndIf} - - # Sets whether install logging to $INSTDIR\install.log will happen (require NSIS_CONFIG_LOG) - # LogSet on + # Check requirements as soon as setup starts + Call RequirementsDetection + + # Read location of the uninstaller + ReadRegStr $PreviousUninstaller HKLM "${UninstallerKey}\Khiops" "UninstallString" + ReadRegStr $PreviousVersion HKLM "${UninstallerKey}\Khiops" "DisplayVersion" + + # Ask the user to proceed if there was already a previous Khiops version installed + # In silent mode: remove previous version + ${If} $PreviousUninstaller != "" + MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \ + "Khiops $PreviousVersion is already installed. $\n$\nClick OK to remove the previous version $\n$\nor Cancel to cancel this upgrade." \ + /SD IDOK IDOK uninst + Abort + + # Run the uninstaller + uninst: + ClearErrors + ExecWait "$PreviousUninstaller /S _?=$INSTDIR" + + # Run again the uninstaller to delete the uninstaller itself and the root dir (without waiting) + # Must not be used in silent mode (may delete files from silent following installation) + ${IfNot} ${Silent} + ExecWait "$PreviousUninstaller /S" + ${EndIf} + ${EndIf} + + # Choice of default installation directory, for windows 32 or 64 + ${If} $INSTDIR == "" + ${If} ${RunningX64} + StrCpy $INSTDIR "$PROGRAMFILES64\khiops" + # No 32-bit install + ${EndIf} + ${EndIf} + + # Sets whether install logging to $INSTDIR\install.log will happen (require NSIS_CONFIG_LOG) + # LogSet on FunctionEnd - -# Function to show the page for requirements -Function RequirementsPageShow - # Detect requirements - Call RequirementsDetection - - # Creation of page, with title and subtitle - nsDialogs::Create 1018 - !insertmacro MUI_HEADER_TEXT "Check software requirements" "Check Microsoft MPI" - - # Message to show for the Microsoft MPI installation - ${NSD_CreateLabel} 0 20u 100% 10u $MPIInstallationMessage - - # Show page - nsDialogs::Show -FunctionEnd - - # Requirements detection # - Detects if the system architecture is 64-bit -# - Detects whether Java JRE and MPI are installed and their versions Function RequirementsDetection - # Abort installation if the machine does not have 64-bit architecture - ${IfNot} ${RunningX64} - Messagebox MB_OK "Khiops works only on Windows 64 bits: installation will be terminated." /SD IDOK - Quit - ${EndIf} - - # Decide if MPI is required by detecting the number of cores - # Note: This call defines MPIInstalledVersion - Call DetectAndLoadMPIEnvironment - - # Try to install MPI - StrCpy $MPIInstallationNeeded "0" - StrCpy $MPIInstallationMessage "" - - # If it is not installed install it - ${If} $MPIInstalledVersion == "0" - StrCpy $MPIInstallationMessage "Microsoft MPI version ${MSMPI_VERSION} will be installed" - StrCpy $MPIInstallationNeeded "1" - # Otherwise install only if the required version is newer than the installed one - ${Else} - ${VersionCompare} "${MPIRequiredVersion}" "$MPIInstalledVersion" $0 - ${If} $0 == 1 - StrCpy $MPIInstallationMessage "Microsoft MPI will be upgraded to version ${MSMPI_VERSION}" - StrCpy $MPIInstallationNeeded "1" - ${Else} - StrCpy $MPIInstallationMessage "Microsoft MPI version already installed" - ${EndIf} - ${EndIf} - - - # Show debug information - !ifdef DEBUG - Messagebox MB_OK "MS-MPI: needed=$MPIInstallationNeeded required=${MPIRequiredVersion} installed=$MPIInstalledVersion" - !endif - -FunctionEnd + # Abort installation if the machine does not have 64-bit architecture + ${IfNot} ${RunningX64} + MessageBox MB_OK "Khiops works only on Windows 64 bits: installation will be terminated." /SD IDOK + Quit + ${EndIf} -# No leave page for required software -Function RequirementsPageLeave FunctionEnd diff --git a/packaging/windows/set_proc_number.cmd b/packaging/windows/set_proc_number.cmd new file mode 100644 index 000000000..59a9568ff --- /dev/null +++ b/packaging/windows/set_proc_number.cmd @@ -0,0 +1,2 @@ +REM compute the number of processes to use for Khiops. +if "%KHIOPS_PROC_NUMBER%". == "". for /f %%i in ('"%~dp0_khiopsgetprocnumber"') do set "KHIOPS_PROC_NUMBER=%%i" diff --git a/scripts/get_mpi_implementation.cmake b/scripts/get_mpi_implementation.cmake index 7300ad960..59f0b6a32 100644 --- a/scripts/get_mpi_implementation.cmake +++ b/scripts/get_mpi_implementation.cmake @@ -71,6 +71,12 @@ function(get_mpi_implementation) set(IS_MPICH TRUE) endif() + string(REGEX MATCH "msmpi" VAR_MATCH "${VAR_MPI_INFO_LOWER}") + if(VAR_MATCH) + set(MPI_IMPL "msmpi") + set(IS_MS_MPI TRUE) + endif() + string(REGEX MATCH "intel|impi" VAR_MATCH "${VAR_MPI_INFO_LOWER}") if(VAR_MATCH) set(MPI_IMPL "intel") @@ -93,6 +99,9 @@ function(get_mpi_implementation) set(IS_MPICH ${IS_MPICH} PARENT_SCOPE) + set(IS_MS_MPI + ${IS_MS_MPI} + PARENT_SCOPE) set(IS_INTEL_MPI ${IS_INTEL_MPI} PARENT_SCOPE) diff --git a/test/LearningTestTool/py/kht_test.py b/test/LearningTestTool/py/kht_test.py index de329fad5..7ce8435d1 100644 --- a/test/LearningTestTool/py/kht_test.py +++ b/test/LearningTestTool/py/kht_test.py @@ -20,6 +20,15 @@ # mpiexec sous Windows if os.name == "nt": mpi_exe_name = "mpiexec.exe" + # Avec intel MPI mpiexec n'est pas dans le path. On peut le trouver grace a la variable d'environnement I_MPI_ROOT + # (qui doit etre positionnee par l'utilisateur, ca n'est pas fait automatiquement lors de l'installation) + # En la mettant dans le PATH on trouve mpiexec et les dll associees + intel_mpi_path = os.environ.get("I_MPI_ROOT", "") + if intel_mpi_path != "": + os.environ["PATH"] = ( + os.path.join(intel_mpi_path, "bin") + ";" + os.environ["PATH"] + ) + # mpiexec sous Linux else: mpi_exe_name = "mpirun"