diff --git a/.github/workflows/build-containers.yml b/.github/workflows/build-linux-pack-containers.yml similarity index 72% rename from .github/workflows/build-containers.yml rename to .github/workflows/build-linux-pack-containers.yml index 68c2195aa..a52b160ea 100644 --- a/.github/workflows/build-containers.yml +++ b/.github/workflows/build-linux-pack-containers.yml @@ -1,9 +1,9 @@ --- -name: Build development containers +name: Build Linux containers for packaging on: workflow_dispatch: jobs: - build-container: + build-packaging-container: runs-on: ubuntu-latest strategy: fail-fast: false @@ -24,13 +24,11 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build the image and push it to the registry + id: docker-build uses: docker/build-push-action@v2 with: - # relative path to the place where source code with Dockerfile is located - context: ./packaging/dockerfiles - file: ./packaging/dockerfiles/Dockerfile.${{ matrix.os }} - # Note: tags must be lower-case + file: ./packaging/dockerfiles/linux/Dockerfile.${{ matrix.os }} tags: ghcr.io/khiopsml/khiops/khiopsdev-${{ matrix.os }}:latest push: true - name: Display the image digest - run: echo ${{ steps.docker_build.outputs.digest }} + run: echo ${{ steps.docker-build.outputs.digest }} diff --git a/.github/workflows/pack-nsis.yml b/.github/workflows/pack-nsis.yml new file mode 100644 index 000000000..48bb34b14 --- /dev/null +++ b/.github/workflows/pack-nsis.yml @@ -0,0 +1,112 @@ +--- +name: Build NSIS Windows installer +on: + workflow_dispatch: + pull_request: + paths: + - '**CMakeLists.txt' + - packaging/windows/nsis/*.nsh + - packaging/windows/nsis/*.nsi + push: + tags: [v*] +jobs: + build-nsis-installer: + outputs: + khiops-package-version: ${{ steps.get-version.outputs.khiops-package-version }} + name: Build NSIS Windows installer + runs-on: windows-latest + steps: + - name: Obtain checkout ref + shell: bash + run: | + # We take the "pull request head" ref (by default it is a merged one) + if [[ "${{ github.event_name }}" == "pull_request" ]] + then + CHECKOUT_REF="${{ github.event.pull_request.head.sha }}" + # Otherwise the default checkout action ref + else + CHECKOUT_REF="${{ github.ref_name }}" + fi + echo "CHECKOUT_REF=$CHECKOUT_REF" >> $GITHUB_ENV + echo "Checkout ref: $CHECKOUT_REF" + - name: Checkout sources + uses: actions/checkout@v4.1.0 + with: + ref: ${{ env.CHECKOUT_REF }} + - name: Put the package version on the environment and output + id: get-version + shell: bash + run: | + # Build the versions + KHIOPS_PACKAGE_VERSION="$(./scripts/khiops-package-version ${{ env.CHECKOUT_REF }})" + KHIOPS_PACKAGE_REDUCED_VERSION="$(echo $KHIOPS_PACKAGE_VERSION | cut -d'-' -f1)" + echo "KHIOPS_PACKAGE_VERSION=$KHIOPS_PACKAGE_VERSION" >> "$GITHUB_ENV" + echo "KHIOPS_PACKAGE_REDUCED_VERSION=$KHIOPS_PACKAGE_REDUCED_VERSION" >> "$GITHUB_ENV" + echo "khiops-package-version=$KHIOPS_PACKAGE_VERSION" >> "$GITHUB_OUTPUT" + - name: Download Windows install assets + uses: robinraju/release-downloader@v1.8 + with: + repository: khiopsml/khiops-win-install-assets + latest: true + - name: Extract Windows installer assets and load assets-info.env + shell: bash + run: | + assets_tar_gz=$(ls khiops-win-install-assets*.tar.gz) + tar -zxvf "$assets_tar_gz" + cat assets/assets-info.env >> "$GITHUB_ENV" + - name: Build Khiops binaries + uses: ./.github/actions/build-khiops + with: + preset-name: windows-msvc-release + targets: MODL MODL_Coclustering norm_jar khiops_jar + override-flags: -DTESTING=OFF -DBUILD_JARS=ON + - name: Build NSIS package + shell: pwsh + run: |- + cd ./packaging/windows/nsis + makensis ` + /DKHIOPS_VERSION=${{ env.KHIOPS_PACKAGE_VERSION }} ` + /DKHIOPS_REDUCED_VERSION=${{ env.KHIOPS_PACKAGE_REDUCED_VERSION }} ` + /DKHIOPS_WINDOWS_BUILD_DIR=..\..\..\build\windows-msvc-release ` + /DJRE_INSTALLER_PATH=..\..\..\assets\${{ env.JRE_FILENAME }} ` + /DJRE_VERSION=${{ env.JRE_VERSION }} ` + /DMSMPI_INSTALLER_PATH=..\..\..\assets\${{ env.MSMPI_FILENAME }} ` + /DMSMPI_VERSION=${{ env.MSMPI_VERSION }} ` + /DKHIOPS_VIZ_INSTALLER_PATH=..\..\..\assets\${{ env.KHIOPS_VIZ_FILENAME }} ` + /DKHIOPS_COVIZ_INSTALLER_PATH=..\..\..\assets\${{ env.KHIOPS_COVIZ_FILENAME }} ` + /DKHIOPS_SAMPLES_DIR=..\..\..\assets\samples ` + /DKHIOPS_DOC_DIR=..\..\..\assets\doc ` + khiops.nsi + - name: Upload installer as an artifact + uses: actions/upload-artifact@v3.1.2 + with: + name: khiops-installer + path: ./packaging/windows/nsis/khiops-${{ env.KHIOPS_PACKAGE_VERSION }}-setup.exe + test-nsis-installer: + name: Test NSIS Windows installer + needs: build-nsis-installer + runs-on: windows-2019 + steps: + - name: Download NSIS installer artifact + uses: actions/download-artifact@v3.0.2 + with: + name: khiops-installer + - name: Install Khiops + shell: pwsh + run: | + # Execute the installer + $ErrorActionPreference = 'Stop' + $ProgressPreference = 'SilentlyContinue' + Start-Process ` + -FilePath .\khiops-${{ needs.build-nsis-installer.outputs.khiops-package-version }}-setup.exe ` + -ArgumentList '/S' ` + -Wait + # Add Khiops and MPI to the path + $Env:Path += ";${Env:ProgramFiles}\khiops\bin;${Env:ProgramFiles}\Microsoft MPI\Bin" + echo "PATH=${Env:PATH}" >> ${Env:GITHUB_ENV} + echo ${Env:GITHUB_ENV} + type ${Env:GITHUB_ENV} + - name: Checkout the khiops sources + uses: actions/checkout@v3 + - name: Test the installation + uses: ./.github/actions/test-khiops-install diff --git a/packaging/common/images/khiops.ico b/packaging/common/images/khiops.ico new file mode 100644 index 000000000..4be84ba01 Binary files /dev/null and b/packaging/common/images/khiops.ico differ diff --git a/packaging/common/images/khiops_coclustering.ico b/packaging/common/images/khiops_coclustering.ico new file mode 100644 index 000000000..4d479036e Binary files /dev/null and b/packaging/common/images/khiops_coclustering.ico differ diff --git a/packaging/common/khiops/README.txt b/packaging/common/khiops/README.txt index 64499d254..4d43be5c9 100644 --- a/packaging/common/khiops/README.txt +++ b/packaging/common/khiops/README.txt @@ -1,7 +1,7 @@ Khiops 10.0 =========== - (c) 2021 Orange Labs - All rights reserved. - www.khiops.com + (c) 2023 Orange Labs - All rights reserved. + https://khiops.org Khiops is a fully automatic tool for mining large multi-table databases, winner of several data mining challenges. @@ -30,23 +30,23 @@ Main features Khiops 10.0 - what's new - New algorithm for Selective Naive Bayes predictor - . improved accuracy using a direct optimization of variable weights, - . improved interpretability and faster deployment time, with less variables selected, - . faster training time, using the new algorithm and exploiting parallelization, + - improved accuracy using a direct optimization of variable weights, + - improved interpretability and faster deployment time, with less variables selected, + - faster training time, using the new algorithm and exploiting parallelization, - Improved random forests - . faster and more accurate preprocessing, - . biased random selection of variable to better deal with large numbers of variables, + - faster and more accurate preprocessing, + - biased random selection of variable to better deal with large numbers of variables, - Management of sparse data - . fully automatic, - . potentially faster algorithms in case of many constructed variables, + - fully automatic, + - potentially faster algorithms in case of many constructed variables, - New visualization tool - . available on any platform: windows, linux, mac, both in standalone and using a browser + - available on any platform: windows, linux, mac, both in standalone and using a browser - Parallelization on clusters of machine - . available on Hadoop (Yarn, HDFS) + - available on Hadoop (Yarn, HDFS) - New version of pykhiops - . more compliant with python PEP8 standard, using snake case - . distributed as a python package - . new features are available: see pykhiops release notes + - more compliant with python PEP8 standard, using snake case + - distributed as a python package + - new features are available: see pykhiops release notes Upward compatibility with Khiops 9 - dictionaries of Khiops 9 are readable with Khiops 10 @@ -54,87 +54,70 @@ Upward compatibility with Khiops 9 - python scripts using pykhiops 9 are running, with warnings for the deprecated features - scenarios of Khiops 9 are compatible, with warnings for the deprecated features - removed features in Khiops 10, that still work when used from former python scripts or scenarios: - . MAP Naive Bayes is removed - . Naive Bayes predictor is removed - . Preprocessing options MODLEqualWdth, MODLEqualFrequency and MODLBasic are removed + - MAP Naive Bayes is removed + - Naive Bayes predictor is removed + - Preprocessing options MODLEqualWidth, MODLEqualFrequency and MODLBasic are removed - deprecated features, that still work but will be removed in next versions after Khiops 10: - . pykhiops 9 is replaced by pykhiops 10 (see migration guide within pykhiops release notes) - - -Technical prerequisite ----------------------- -Configuration: - PC Windows (Seven and higher), 64 bits - Linux (supported distributions: see www.khiops.com), 64 bits - -Windows software: - Java Runtime Environment V7 or higher, Adobe AIR runtime V30.0, MS MPI 9 - Automatic detection and silent installation during the Khiops installation process on Windows - For specific installation (other than default installation), ask "get Java" or - "get Adobe AIR" on your web search engine to obtain the installer for each - prerequisite component, and proceed with a manual installation - For silent installation, run installer with /S option, and /D=installationDir to choose - a specific installation directory + - pykhiops 9 is replaced by pykhiops 10 (see migration guide within pykhiops release notes) + + +Technical prerequisites +----------------------- +Configuration: + - PC Windows (Seven and higher), 64 bits + - Linux (supported distributions: see https://khiops.org), 64 bits + +Windows software: + - Java Runtime Environment V7 or higher + - Automatic detection and silent installation during the Khiops installation process on Windows + - For specific installation (other than default installation), search "get Java" on your search + engine to obtain the installer for each prerequisite component, and proceed with a manual + installation + - For a silent installation, run the installer with /S option, and /D=installationDir to choose a + specific installation directory. Linux software: Java Runtime Environment V7 or higher, mpich (>3.0), libstdc++6 Automatic detection and silent installation during the Khiops installation process -Software key, provided during the installation process. - -Other configurations: contact us +Other configurations (ex. macOS): see https://khiops.org Khiops files on Windows ----------------------- -Root directory: - readme.txt: this file - whatsnewV10.0.txt: detailed release notes - install.txt: installation process - KhiopsLicense.pdf: license file - Short-cuts to Khiops components - -bin directory: - executable, batch files and libraries - -doc directory: - reference guides and tutorial for Khiops components - start with KhiopsTutorial.pdf - -python directory: - python library for Khiops (pykhiops) and samples of use of this library - see python/readme.txt +Install location (usually C:\Program Files\khiops): + - README.txt: this file + - WHATSNEW.txt: detailed release notes + - LICENSE.txt: license file + - Shortcuts to Khiops components + - bin sub-directory: + - executable, batch files and libraries + - doc sub-directory: + - reference guides and tutorial for Khiops components + - start with KhiopsTutorial.pdf + +Other locations: + - %USERPROFILE%\khiops_data\lastrun directory (usually C:\Users\\khiops_data\lastrun): + - contains scenario and log files for last run of Khiops and Khiops Coclustering + + - %PUBLIC%\khiops_data\samples (usually C:\Users\Public\khiops_data\samples) + - directory tree with database samples (database files `.txt` and + dictionary files `.kdic`) see samples/README.txt -samples directory: - directory tree with database samples (database file (.txt) and dictionary file (.kdic)) - see samples/readme.txt - -key directory: - to store Khiops and Khiops Coclustering license files - -lastrun directory: - contains scenario and log files for last run of Khiops and Khiops Coclustering - - - Khiops files on Linux --------------------- - -/usr/bin : - executable, batch files +/usr/bin: + - executable, batch files /usr/share/doc/khiops: - reference guides and tutorial for Khiops components - start with KhiopsTutorial.pdf - readme.txt: this file - whatsnewV10.0.txt: detailed release notes - samples directory: - directory tree with database samples (database file (.txt) and dictionary file (.kdic)) - see samples/readme.txt - -/opt/khiops/key/: - to store Khiops and Khiops Coclustering license files + - reference guides and tutorial for Khiops components + - start with KhiopsTutorial.pdf + - README.txt: this file + - WHATSNEW.txt: detailed release notes + - samples directory: + directory tree with database samples (database files `.txt` and dictionary files `.kdic`) + see samples/README.txt /tmp/khiops/$USER: - contains scenario and log files for last run of Khiops and Khiops Coclustering \ No newline at end of file + - contains scenario and log files for last run of Khiops and Khiops Coclustering diff --git a/packaging/common/khiops/whatsnewV10.1.txt b/packaging/common/khiops/WHATSNEW.txt similarity index 81% rename from packaging/common/khiops/whatsnewV10.1.txt rename to packaging/common/khiops/WHATSNEW.txt index 5120a0701..e16612289 100644 --- a/packaging/common/khiops/whatsnewV10.1.txt +++ b/packaging/common/khiops/WHATSNEW.txt @@ -1,59 +1,79 @@ -Khiops 10.1.5 release notes -=========================== +========================================== +Release Notes for Khiops 10 Version Series +========================================== + +Version 10.2.0 +============== +**Announcement**: This is a special release marking the open-sourcing of the Khiops AutoML suite. +New Features: +- Khiops can now be built in macOS. Currently only a conda package is available for installing (more + information at https://khiops.org) + +Bug fix: +- Fix a bug in the calculation of descriptive stats for huge databases +- Fix clusters having negative typicalities in coclustering + + +Version 10.1.5 +============== +Bug fix: +- KhiopsNativeInterface crashes with java under Linux. Signals are not intercepted anymore in KNI. + +Version 10.1.4 +============== +Bug fix: +- in the sorting algorithm: it could produce corrupted files when the separators of the input and + output files are different. + +Version 10.1.3 +============== Bug fix: -- KhiopsNativeInterface crashes with java under linux. - Signals are not intercepted anymore in KNI. - -Khiops 10.1.4 release notes -=========================== -Bug fix: -- in the sorting algorithm: it could produce corrupted files when the separators of the input - and output files are different. - -Khiops 10.1.3 release notes -=========================== -Bug fix: - better error management on non standard file systems (e.g. s3 or hdfs) - the results directory is correctly build in predictor evaluation on non standard file systems -Khiops 10.1.2 release notes -=========================== -Bug fix: +Version 10.1.2 +============== +Bug fix: - the results path is correctly build in Khiops-coclustering when the directory is located on non standard file systems (e.g. s3 or hdfs) -Khiops 10.1.1 release notes -=========================== +Version 10.1.1 +============== Bug fixes: -- in the sorting algorithm : in case where the field separator in the output file was different - from the input file, with the input file having fields surrounded by double-quotes and - containing the input field separator -- in the construction of trees: in an edge case with a single tree and categorical fields - with very large number of values +- in the sorting algorithm : in case where the field separator in the output file was different from + the input file, with the input file having fields surrounded by double-quotes and containing the + input field separator +- in the construction of trees: in an edge case with a single tree and categorical fields with very + large number of values - in a multiple-machine cloud environment: fixed the file path management with URI -- in a multiple-machine cloud environment: fixed management of specialized temporary directories per machine +- in a multiple-machine cloud environment: fixed management of specialized temporary directories per + machine Improvements: -- better dimensionning of the deployment task in case of multi-table schema with a large number of orphan secondary records +- better dimensioning of the deployment task in case of multi-table schema with a large number of + orphan secondary records - improved detection and diagnostics related to JAVA runtime in Khiops scripts on Windows -Khiops 10.1 release notes -========================= -Khiops 10.1 is a minor release, with few new features, but many optimization and reliability improvements, -to better perform in cloud environments and better integrate Khiops within information systems. +Version 10.1 +============ +Khiops 10.1 is a minor release, with few new features, but many optimization and reliability +improvements, to better perform in cloud environments and better integrate Khiops within information +systems. Main new features - Visualization tools: - Khiops visualization: new panel "Tree preparation" to visualize the trees. - - Khiops covisualization: new tool, replacing the previous one based on the obsolete Flex framework. + - Khiops covisualization: new tool, replacing the previous one based on the obsolete Flex + framework. - Data Table Dictionaries: - A new type TimestampTZ: A timestamp with timezone: - it uses the ISO 8601 standard (see the Khiops Guide for more details). - it is detected automatically in the "Build dictionary from data table" feature. - new derivation rules for this type: - - CopyTSTZ, FormatTimestampTZ, AsTimestampTZ, UtcTimestamp, LocalTimestamp, SetTimeZoneMinutes, - GetTimeZoneMinutes, DiffTimestampTZ, AddSecondsTSTZ, IsTimestampTZValid, BuildTimestampTZ, GetValueTSTZ. + - CopyTSTZ, FormatTimestampTZ, AsTimestampTZ, UtcTimestamp, LocalTimestamp, + SetTimeZoneMinutes, GetTimeZoneMinutes, DiffTimestampTZ, AddSecondsTSTZ, IsTimestampTZValid, + BuildTimestampTZ, GetValueTSTZ. - new automatic construction rule in "Variable construction parameters": - LocalTimestamp, to obtain a local Timestamp from a TimestampTZ - Timestamp type now accepts a format with the character 'T' as separator between date and time. @@ -87,67 +107,65 @@ Main performance improvements Many minor corrections, mainly for edge-case bugs. -Khiops 10.0.4 release notes -=========================== -- bug fix in sort algorithm : the field separator in the output file was not correct - for files with a huge number of identical lines. +Version 10.0.4 +============== +- bug fix in sort algorithm : the field separator in the output file was not correct for files with + a huge number of identical lines. -Khiops 10.0.3 release notes -=========================== -- fix an edge-case bug in multi-table schemas, in case of a root table of moderate size - and several subtables, some of them very small and some very large, and duplicate records - in the root table +Version 10.0.3 +============== +- fix an edge-case bug in multi-table schemas, in case of a root table of moderate size and several + subtables, some of them very small and some very large, and duplicate records in the root table -- fix a problem of wrong line numbers reported in case or warning or errors occuring - with very large data files +- fix a problem of wrong line numbers reported in case or warning or errors occuring with very large + data files - fix a bug in json reports for trees - the file format detector is now more resilient to empty lines in the analyzed data files -Khiops 10.0.2 release notes -=========================== -- fix a bug for file systems with URI schemes (s3 or hdfs) for correct managment - of the "result files directory" +Version 10.0.2 +============== +- fix a bug for file systems with URI schemes (s3 or hdfs) for correct managment of the "result + files directory" -Khiops 10.0.1 release notes -=========================== +Version 10.0.1 +============== Improvements: -- better handling of database encodings (ascii, ansi, utf8) for json report files, - to make it easier to manipulate reports from pykhiops: +- better handling of database encodings (ascii, ansi, utf8) for json report files, to make it easier + to manipulate reports from pykhiops: cf. "Character encodings" section in the Khiops guide -- the "Detect file format" feature now displays a message in the log window - with the recognized format: used header line and field sepatator +- the "Detect file format" feature now displays a message in the log window with the recognized + format: used header line and field separator -- the "Build dictionary" function now proposes a categorical format for fields - that only contain the values "", "0", or "1" +- the "Build dictionary" function now proposes a categorical format for fields that only contain the + values "", "0", or "1" -- in modeling dictionaries, the target variable is now set as "Unused" by default - to facilitate the deployment of predictors in the case of deployment databases - where the target variable is missing +- in modeling dictionaries, the target variable is now set as "Unused" by default to facilitate the + deployment of predictors in the case of deployment databases where the target variable is missing -- the Accidents sample database is now translated into English, with interpretable - variable names and values; a simpler version called AccidentsSummary is available +- the Accidents sample database is now translated into English, with interpretable variable names + and values; a simpler version called AccidentsSummary is available -- the khiops and khiops_coclustering shell commands now exploit a common shell command - khiops_env which defines all env variables required by Khiops. - This new command is self-documented and can be used from a wrapper, such as pykhiops +- the khiops and khiops_coclustering shell commands now exploit a common shell command khiops_env + which defines all env variables required by Khiops. This new command is self-documented and can + be used from a wrapper, such as pykhiops -- better messages and documentation in case of unsupported data formats, such as the - "classic" Mac OS line endings, deprecated since Max OS X in 1998, or a UTF-8 file - with BOM (byte order mark) start characters +- better messages and documentation in case of unsupported data formats, such as the "classic" Mac + OS line endings, deprecated since Max OS X in 1998, or a UTF-8 file with BOM (byte order mark) + start characters -- slight improvement of the level criterion for the preparation of univariate and - bivariate data in some edge cases +- slight improvement of the level criterion for the preparation of univariate and bivariate data in + some edge cases - the "Build coclustering" button is renamed to "Train coclustering" in the Khiops coclustering tool -- the environment variables for managing external resources are now KHIOPS_MEMORY_LIMIT and KHIOPS_TMP_DIR, - instead of the now obsolete KhiopsTmpDir. +- the environment variables for managing external resources are now KHIOPS_MEMORY_LIMIT and + KHIOPS_TMP_DIR, instead of the now obsolete KhiopsTmpDir. - AUC is now 0 in the case of an empty test database. @@ -159,25 +177,29 @@ Improvements: Issues: - fix a bug in the "Extract keys" function, when the output file is specified without a header line -- fix an overestimation of the memory requirement for building the trees in the case of large databases +- fix an overestimation of the memory requirement for building the trees in the case of large + databases - fix a edge case bug that freezes parallel processes when learning a multi-table scheme -- fix a edge case bug in the SNB classifier, in the case of a very large matrix instances x variables beyond two billion values +- fix a edge case bug in the SNB classifier, in the case of a very large matrix instances x + variables beyond two billion values -- fix a edge case bug in the sorting functionality, when the input files contain fields between double quotes with internal quotes - double quotes and/or an input field separator, and when the output field separator is different from the input one +- fix a edge case bug in the sorting functionality, when the input files contain fields between + double quotes with internal quotes double quotes and/or an input field separator, and when the + output field separator is different from the input one -- fix a bug in te user interface, when the "Inspect dictionary" action could be called twice simultaneously, resulting in a crash +- fix a bug in te user interface, when the "Inspect dictionary" action could be called twice + simultaneously, resulting in a crash -- fix several resource management issues in the case of a cluster with several heteregeneous machines +- fix several resource management issues in the case of a cluster with several heteregeneous + machines - Other minor corrections -Khiops 10.0 - what 's new -========================= - (c) 2021 Orange Labs - All rights reserved. +Version 10.0 +============ Khiops is a fully automatic tool for mining large multi-table databases, winner of several data mining challenges. @@ -344,7 +366,7 @@ User interface - Variable construction pane: removed - new helper button "Detect file format" in each database pane, to detect whether there is a header line and what the field separator is - - new menu Help, with documentation, licence management and about sub-menus + - new menu Help, with documentation, license management and about sub-menus - removed options - Pane Parameters/Predictors - MAP Naive Bayes and Naive Bayes predictors are removed diff --git a/packaging/common/khiops/install.txt b/packaging/common/khiops/install.txt deleted file mode 100644 index 14f727bb2..000000000 --- a/packaging/common/khiops/install.txt +++ /dev/null @@ -1,95 +0,0 @@ -Khiops 10.1 -=========== - (c) 2022 Orange Labs - All rights reserved. - www.khiops.com - -1 Windows users -1.1 Installation process on Windows -1.2 Known problems on Windows -2 Linux users -2.1 Important Warnings for Linux users -2.2 Installation Process on Linux -2.3 Known problems on Linux - - - -1 Windows users ---------------- - -1.1 Installation process on Windows ----------------------------------- - -The steps to download and use Khiops are summarized below. - -Step 1 - On www.khiops.com -. Go to the "Login" page and log in - -Step 2 - On www.khiops.com -. Go to the "Install" page -. Download the Khiops version that you need (Windows or Linux) - -Step 3 - On your computer: install Khiops in administrator mode - -1.2 Known problems on Windows ------------------------------ -The Khiops installer relies on embedded installers for Java and MPI. - - Windows Defender or any other antivirus software may remove excutable files (.exe, .jar) during installation. - In this case, you should add exceptions to your antivirus or disable it during installation. - - The java installer results in a system reboot on some systems (eg. on Windows Server 2008) - - The MPI installer is Microsoft MPI 10, which is not compliant with too old Windows OS. - If necessary, the khiops.cmd command file can be edited to start Khiops without MPI - (see khiops_coclustering.cmd) - - - -2 Linux Users -------------- - -Khiops comes with three packages: khiops-core, khiops and khiops-samples. khiops-core is a lightweight package without GUI, -documentation or samples. It is intended to be used on servers and dockers. The khiops package requires -khiops-core and contains the full version of Khiops: GUI, documentation. The khiops-samples contains several datasets used in -Khiops tutorial. These samples are located in /opt/khiops/samples. This directory is write protected, therefore, -in order to work with it, it is recommended to copy it to your home directory (or /tmp). - -In the same way, KNI comes with two packages: kni and kni-doc. kni contains only the header and the shared -library of Khiops native interface. And kni-doc contains the documentation and samples. - -2.1 Important Warnings for Linux users ---------------------------------------- -With khiops-core or on remote machines without X tunneling, khiops and khiops_coclustering must -be executed with the "-b" option. Otherwise, Khiops tries to launch a Java GUI, causing a Java error -("fatal error : Java GUI : No GUI (X server) available under current environment"). - -2.2 Installation process on Linux ----------------------------------- -The installation process is the same as on Windows (see section 1.1). There are nevertheless some -differences. If you are using a linux repository, the installation of the khiops package will -automatically install khiops-core and khiops-samples packages. It is more complicated if you download the packages: -you have to install khiops-core before khiops. - -On debian : - -sudo dpkg -i khiops-core_10.1-0+focal_amd64.deb -sudo dpkg -i khiops-samples_10.1-0+focal_amd64.deb -sudo dpkg -i khiops_10.1-0+focal_amd64.deb -sudo apt-get -f install - -On redhat : - -sudo yum localinstall khiops-core-10.1-0.el7.x86_64.rpm -sudo yum localinstall khiops-samples-10.1-0.el7.x86_64.rpm -sudo yum localinstall khiops-10.1-0.el7.x86_64.rpm - -2.3 Known problems on Linux ---------------------------- - - A bug on openjdk on Ubuntu 18.04 causes a java exception. - To fix this problem, you have to edit the file - /etc/java-11-openjdk/accessibility.properties and comment the line - "assistive_technologies=org.GNOME.Accessibility.AtkWrapper" - - When there is a problem resolving localhost, khiops fails with an MPICH error endind with : - ckpt_restart(379)..................: gethostbyname failed, YOUR_LOCAL_HOST_NAME (errno 1) - This issue appears when the command "localhost" and the file /etc/hosts are not consistent - To solve this issue, type "sudo hostnamectl set-hostname NEW-NAME" where NEW-NAME is - the hostname of /etc/hosts - - On some Raspbian release, the java GUI is freezing. However, you can use Khiops in - batch mode (khiops -b) or with the python library. \ No newline at end of file diff --git a/packaging/install.cmake b/packaging/install.cmake index 6598290d1..bf5983a20 100644 --- a/packaging/install.cmake +++ b/packaging/install.cmake @@ -99,7 +99,7 @@ install( COMPONENT KHIOPS_CORE) install( - FILES ${PROJECT_SOURCE_DIR}/packaging/common/khiops/whatsnewV10.1.txt + FILES ${PROJECT_SOURCE_DIR}/packaging/common/khiops/WHATSNEW.txt ${PROJECT_SOURCE_DIR}/packaging/common/khiops/README.txt DESTINATION usr/share/doc/khiops COMPONENT KHIOPS) diff --git a/packaging/windows/nsis/CreateKhiopsCmdFileFunc.nsh b/packaging/windows/nsis/CreateKhiopsCmdFileFunc.nsh new file mode 100644 index 000000000..3fce501e9 --- /dev/null +++ b/packaging/windows/nsis/CreateKhiopsCmdFileFunc.nsh @@ -0,0 +1,119 @@ +!include "FileFunc.nsh" +!include "x64.nsh" + +# Macro to create the khiops.cmd script +# Example: +# ${CreateKhiopsCmdFile} "$INSTDIR\khiops.cmd" "MODL" "" "$INSTDIR" "scenario._kh" "log.txt" "1" +# +!define CreateKhiopsCmdFile "!insertmacro CreateKhiopsCmdFile" +!macro CreateKhiopsCmdFile FileName ToolName BinSuffix KhiopsHome ScenarioFileName LogFileName ParallelMode + Push "${ParallelMode}" + Push "${LogFileName}" + Push "${ScenarioFileName}" + Push "${KhiopsHome}" + Push "${BinSuffix}" + Push "${ToolName}" + Push "${FileName}" + Call CreateKhiopsCmdFile +!macroend + + +Function CreateKhiopsCmdFile + # Function parameters + Var /GLOBAL _FileName + Var /GLOBAL _ToolName + Var /GLOBAL _BinSuffix + Var /GLOBAL _KhiopsHome + Var /GLOBAL _ScenarioFileName + Var /GLOBAL _LogFileName + Var /GLOBAL _ParallelMode + + # Retrieve parameters from stack + Pop $_FileName + Pop $_ToolName + Pop $_BinSuffix + Pop $_KhiopsHome + Pop $_ScenarioFileName + Pop $_LogFileName + Pop $_ParallelMode + + # Open file to create + FileOpen $0 "$_FileName" w + + # Write file + FileWrite $0 `@echo off$\r$\n` + FileWrite $0 `setlocal$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `REM ========================================================$\r$\n` + FileWrite $0 `REM See the khiops_env script for full documentation on the$\r$\n` + FileWrite $0 `REM environment variables used by Khiops$\r$\n` + FileWrite $0 `REM ========================================================$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `REM ========================================================$\r$\n` + FileWrite $0 `REM Initialization of the installation directory of Khiops$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `REM Test is Khiops environment already set up$\r$\n` + FileWrite $0 `if "%KHIOPS_HOME%".=="". set KHIOPS_HOME=$_KhiopsHome$\r$\n` + FileWrite $0 `if not exist "%KHIOPS_HOME%\bin$_BinSuffix\$_ToolName.exe" goto ERR_PATH$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `REM Test if batch mode from parameters$\r$\n` + FileWrite $0 `set _KHIOPS_BATCH_MODE=$\r$\n` + FileWrite $0 `for %%i in (%*) do if %%i.==-b. set _KHIOPS_BATCH_MODE=true$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `REM Initialize Khiops env variables$\r$\n` + FileWrite $0 `call "%KHIOPS_HOME%\bin\khiops_env" --env > NUL$\r$\n` + FileWrite $0 `if not %_KHIOPS_BATCH_MODE%.==true. if not exist "%KHIOPS_JAVA_PATH%\jvm.dll" goto ERR_JAVA$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `REM Set path$\r$\n` + FileWrite $0 `set path=%KHIOPS_PATH%;%KHIOPS_JAVA_PATH%;%path%$\r$\n` + FileWrite $0 `set classpath=%KHIOPS_CLASSPATH%;%classpath%$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `REM ========================================================$\r$\n` + FileWrite $0 `REM Start Khiops (with or without parameteres)$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `if %1.==. goto NOPARAMS$\r$\n` + FileWrite $0 `if not %1.==. goto PARAMS$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `REM Start without parameters$\r$\n` + FileWrite $0 `:NOPARAMS$\r$\n` + FileWrite $0 `if not exist "%KHIOPS_LAST_RUN_DIR%" md "%KHIOPS_LAST_RUN_DIR%"$\r$\n` + FileWrite $0 `if not exist "%KHIOPS_LAST_RUN_DIR%" goto PARAMS$\r$\n` + ${If} $_ParallelMode == "0" + FileWrite $0 `"%KHIOPS_PATH%$_BinSuffix\$_ToolName" -o "%KHIOPS_LAST_RUN_DIR%\$_ScenarioFileName" -e "%KHIOPS_LAST_RUN_DIR%\$_LogFileName"$\r$\n` + ${Else} + FileWrite $0 `%KHIOPS_MPI_COMMAND% "%KHIOPS_PATH%$_BinSuffix\$_ToolName" -o "%KHIOPS_LAST_RUN_DIR%\$_ScenarioFileName" -e "%KHIOPS_LAST_RUN_DIR%\$_LogFileName"$\r$\n` + ${EndIf} + FileWrite $0 `goto END$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `REM Start with parameters$\r$\n` + FileWrite $0 `:PARAMS$\r$\n` + ${If} $_ParallelMode == "0" + FileWrite $0 `"%KHIOPS_PATH%$_BinSuffix\$_ToolName" %*$\r$\n` + ${Else} + FileWrite $0 `%KHIOPS_MPI_COMMAND% "%KHIOPS_PATH%$_BinSuffix\$_ToolName" %*$\r$\n` + ${EndIf} + FileWrite $0 `goto END$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `REM ========================================================$\r$\n` + FileWrite $0 `REM Error messages$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `:ERR_PATH$\r$\n` + FileWrite $0 `start "KHIOPS CONFIG PROBLEM" echo ERROR Incorrect installation directory for Khiops (File $_ToolName.exe not found in directory %KHIOPS_PATH%$_BinSuffix)$\r$\n` + FileWrite $0 `exit /b 1$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `:ERR_JAVA$\r$\n` + FileWrite $0 `start "KHIOPS CONFIG PROBLEM" echo ERROR Java not correctly installed, jvm.dll not found under java directory tree %_KHIOPS_JAVA_HOME% (%_KHIOPS_JAVA_HOME_ORIGIN%): see khiops_env.cmd file in %KHIOPS_HOME%\bin, after line 'Set user Java Home'$\r$\n` + FileWrite $0 `exit /b 1$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `:END$\r$\n` + FileWrite $0 `endlocal$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `REM Return 1 if fatal error, 2 if error(s), 0 otherwise$\r$\n` + FileWrite $0 `exit /b %errorlevel%$\r$\n` + + # Close file + FileClose $0 +FunctionEnd diff --git a/packaging/windows/nsis/CreateKhiopsEnvCmdFileFunc.nsh b/packaging/windows/nsis/CreateKhiopsEnvCmdFileFunc.nsh new file mode 100644 index 000000000..26d4e0877 --- /dev/null +++ b/packaging/windows/nsis/CreateKhiopsEnvCmdFileFunc.nsh @@ -0,0 +1,195 @@ +!include "FileFunc.nsh" +!include "x64.nsh" + +# Macro to create the khiops_env.cmd script +# Example: +# ${CreateKhiopsEnvCmdFile} "$INSTDIR\khiops_env.cmd" "$INSTDIR" "4" +# +!define CreateKhiopsEnvCmdFile "!insertmacro CreateKhiopsEnvCmdFile" +!macro CreateKhiopsEnvCmdFile FileName KhiopsHome PhysicalCoresNumber + Push "${PhysicalCoresNumber}" + Push "${KhiopsHome}" + Push "${FileName}" + Call CreateKhiopsEnvCmdFile +!macroend + +# Function to be used with the macro defined above +Function CreateKhiopsEnvCmdFile + # Define function parameters + Var /GLOBAL _EnvFileName + Var /GLOBAL _EnvKhiopsHome + Var /GLOBAL _EnvProcessNumber + + # Retrieve parameters from stack + Pop $_EnvFileName + Pop $_EnvKhiopsHome + Pop $_EnvProcessNumber + + # Open the file to create + FileOpen $0 "$_EnvFileName" w + + # Write file contents + FileWrite $0 `@echo off$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `if %1.==--env. goto SET_ENV$\r$\n` + FileWrite $0 `goto HELP$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `:HELP$\r$\n` + FileWrite $0 `echo Usage: khiops-env [-h] [--env]$\r$\n` + FileWrite $0 `echo khiops-env is an internal script intended to be used by Khiops tool and Khiops'$\r$\n` + FileWrite $0 `echo wrappers only.$\r$\n` + FileWrite $0 `echo If the --env flag is used, the environment list is printed on the standard output$\r$\n` + FileWrite $0 `echo.$\r$\n` + FileWrite $0 `echo The following variables are used to set the path and classpath$\r$\n` + FileWrite $0 `echo for the prerequisite of Khiops.$\r$\n` + FileWrite $0 `echo.$\r$\n` + FileWrite $0 `echo KHIOPS_HOME: home directory of Khiops, on Windows only$\r$\n` + FileWrite $0 `echo.$\r$\n` + FileWrite $0 `echo KHIOPS_PATH: path of Khiops' executable, to add in path$\r$\n` + FileWrite $0 `echo KHIOPS_MPI_COMMAND: MPI command to call the Khiops tool$\r$\n` + FileWrite $0 `echo KHIOPS_MPI_LIB: MPI library path used by the Khiops tool$\r$\n` + FileWrite $0 `echo KHIOPS_JAVA_PATH: path of Java tool, to add in path$\r$\n` + FileWrite $0 `echo KHIOPS_CLASSPATH: Khiops java libraries, to add in classpath$\r$\n` + FileWrite $0 `echo.$\r$\n` + FileWrite $0 `echo If they are not already defined, the following variables used by$\r$\n` + FileWrite $0 `echo Khiops are set :$\r$\n` + FileWrite $0 `echo.$\r$\n` + FileWrite $0 `echo KHIOPS_LAST_RUN_DIR: directory where Khiops writes output command$\r$\n` + FileWrite $0 `echo file and log (when not defined with -e and -o)$\r$\n` + FileWrite $0 `echo KHIOPS_PROC_NUMBER: processes number launched by Khiops (it's$\r$\n` + FileWrite $0 `echo default value corresponds to the number of physical cores of$\r$\n` + FileWrite $0 `echo the computer plus one)$\r$\n` + FileWrite $0 `echo.$\r$\n` + FileWrite $0 `echo The following variables are not defined by default and can be used to$\r$\n` + FileWrite $0 `echo change some default properties of Khiops:$\r$\n` + FileWrite $0 `echo.$\r$\n` + FileWrite $0 `echo KHIOPS_TMP_DIR: Khiops' temporary directory location (default : the$\r$\n` + FileWrite $0 `echo system's default) This location can be modified from the tool as well$\r$\n` + FileWrite $0 `echo KHIOPS_MEMORY_LIMIT: Khiops' memory limit (default : the system's$\r$\n` + FileWrite $0 `echo memory limit). This setting is ignored if it is above the system's$\r$\n` + FileWrite $0 `echo memory limit. It can only be reduced from the tool$\r$\n` + FileWrite $0 `echo KHIOPS_API_MODE: standard or api mode for the management of output result files created by Khiops$\r$\n` + FileWrite $0 `echo In standard mode, the result files are stored in the train database directory,$\r$\n` + FileWrite $0 `echo unless an absolute path is specified, and the file extension is forced if necessary.$\r$\n` + FileWrite $0 `echo In api mode, the result files are stored in the current working directory, using the specified results as is.$\r$\n` + FileWrite $0 `echo . default behavior if not set: standard mode$\r$\n` + FileWrite $0 `echo . set to 'true' to force standard mode$\r$\n` + FileWrite $0 `echo . set to 'false' to force api mode$\r$\n` + FileWrite $0 `echo KHIOPS_RAW_GUI: graphical user interface for file name selection$\r$\n` + FileWrite $0 `echo . default behavior if not set: depending on the file drivers available for Khiops$\r$\n` + FileWrite $0 `echo . set to 'true' to allow file name selection with uri schemas$\r$\n` + FileWrite $0 `echo . set to 'false' to allow local file name selection only with a file selection dialog$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `if not %2.==. exit /b 1$\r$\n` + FileWrite $0 `if %1.==-h. exit /b 0$\r$\n` + FileWrite $0 `exit /b 1$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `REM Set Khiops env variables$\r$\n` + FileWrite $0 `:SET_ENV$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `REM Test if Khiops environment already set up$\r$\n` + FileWrite $0 `if "%KHIOPS_HOME%".=="". set KHIOPS_HOME=$_EnvKhiopsHome$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `REM KHIOPS_PATH$\r$\n` + FileWrite $0 `set KHIOPS_PATH=%KHIOPS_HOME%\bin$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `REM KHIOPS_CLASSPATH$\r$\n` + FileWrite $0 `set KHIOPS_CLASSPATH=%KHIOPS_HOME%\bin\norm.jar$\r$\n` + FileWrite $0 `set KHIOPS_CLASSPATH=%KHIOPS_HOME%\bin\khiops.jar;%KHIOPS_CLASSPATH%$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `REM KHIOPS_LAST_RUN_DIR$\r$\n` + FileWrite $0 `if "%KHIOPS_LAST_RUN_DIR%".=="". set KHIOPS_LAST_RUN_DIR=%USERPROFILE%\khiops_data\lastrun$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `REM KHIOPS_PROC_NUMBER$\r$\n` + FileWrite $0 `if "%KHIOPS_PROC_NUMBER%".=="". set KHIOPS_PROC_NUMBER=$_EnvProcessNumber$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `REM KHIOPS_MPI_COMMAND$\r$\n` + FileWrite $0 `REM Priority$\r$\n` + FileWrite $0 `REM 0: Idle$\r$\n` + FileWrite $0 `REM 1: Below normal$\r$\n` + FileWrite $0 `REM 2: Normal$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `set KHIOPS_MPI_COMMAND="%MSMPI_BIN%mpiexec" -al spr:P -n %KHIOPS_PROC_NUMBER% /priority 1$\r$\n` + FileWrite $0 `if %KHIOPS_PROC_NUMBER%==1 set KHIOPS_MPI_COMMAND=$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `REM KHIOPS_JAVA_PATH$\r$\n` + FileWrite $0 `REM May not work in case of a recent new installation of Java on the PC$\r$\n` + FileWrite $0 `set KHIOPS_JAVA_PATH=$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `REM Set user Java Home$\r$\n` + FileWrite $0 `REM Uncomment the following line your own Java version$\r$\n` + FileWrite $0 `REM set _KHIOPS_JAVA_HOME=C:\Program Files\Java\jre${JavaRequiredFullVersion}$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `:JAVA_HOME_0$\r$\n` + FileWrite $0 `set _KHIOPS_JAVA_HOME_ORIGIN=java home set by user$\r$\n` + FileWrite $0 `REM Search if set by user$\r$\n` + FileWrite $0 `if not "%_KHIOPS_JAVA_HOME%".=="". goto JAVA_HOME_LAST$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `:JAVA_HOME_1$\r$\n` + FileWrite $0 `set _KHIOPS_JAVA_HOME_ORIGIN=found java recent version in registry$\r$\n` + FileWrite $0 `REM Search for a recent version of Java (greater than 8)$\r$\n` + FileWrite $0 `REM Search Java Version from registry and set _KHIOPS_JAVA_VERSION env var$\r$\n` + FileWrite $0 `for /F "tokens=2*" %%f in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\JRE" -v CurrentVersion 2^>nul') do set _KHIOPS_JAVA_VERSION=%%g$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `REM Search Java Home from registry and set _KHIOPS_JAVA_HOME env var$\r$\n` + FileWrite $0 `for /F "tokens=2*" %%f in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\JRE\%_KHIOPS_JAVA_VERSION%" -v JavaHome 2^>nul') do set _KHIOPS_JAVA_HOME=%%g$\r$\n` + FileWrite $0 `if not "%_KHIOPS_JAVA_HOME%".=="". goto JAVA_HOME_LAST$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `:JAVA_HOME_2$\r$\n` + FileWrite $0 `set _KHIOPS_JAVA_HOME_ORIGIN=found java version in registry$\r$\n` + FileWrite $0 `REM Search for a previous version of Java$\r$\n` + FileWrite $0 `REM Search Java Version from registry and set _KHIOPS_JAVA_VERSION env var$\r$\n` + FileWrite $0 `for /F "tokens=2*" %%f in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment" -v CurrentVersion 2^>nul') do set _KHIOPS_JAVA_VERSION=%%g$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `REM Search Java Home from registry and set _KHIOPS_JAVA_HOME env var$\r$\n` + FileWrite $0 `for /F "tokens=2*" %%f in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\%_KHIOPS_JAVA_VERSION%" -v JavaHome 2^>nul') do set _KHIOPS_JAVA_HOME=%%g$\r$\n` + FileWrite $0 `if not "%_KHIOPS_JAVA_HOME%".=="". goto JAVA_HOME_LAST$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `:JAVA_HOME_3$\r$\n` + FileWrite $0 `set _KHIOPS_JAVA_HOME_ORIGIN=found in java installation sub dirs$\r$\n` + FileWrite $0 `REM Heuristic search in sub-directories of java installation dir$\r$\n` + FileWrite $0 `if not exist "%programFiles%\java" goto JAVA_HOME_LAST$\r$\n` + # Following instruction surrounding by simple quotes ', to allow internal use of back-quotes ` + FileWrite $0 'FOR /F "usebackq delims=" %%i IN (`where /R "%programFiles%\java" jvm.dll`) DO (set KHIOPS_JAVA_PATH=%%~di%%~pi)$\r$\n' + FileWrite $0 `if exist "%KHIOPS_JAVA_PATH%\jvm.dll" goto JAVA_END$\r$\n` + FileWrite $0 `if not exist "%KHIOPS_JAVA_PATH%\jvm.dll" set KHIOPS_JAVA_PATH=$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `:JAVA_HOME_4$\r$\n` + FileWrite $0 `set _KHIOPS_JAVA_HOME_ORIGIN=default installation settings$\r$\n` + FileWrite $0 `REM Set default Java Home if not found in registry$\r$\n` + FileWrite $0 `if "%_KHIOPS_JAVA_HOME%".=="". set _KHIOPS_JAVA_HOME=C:\Program Files\Java\jre${JavaRequiredFullVersion}$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `:JAVA_HOME_LAST$\r$\n` + FileWrite $0 `REM Add java runtime dir to KHIOPS_JAVA_PATH$\r$\n` + FileWrite $0 `if exist "%_KHIOPS_JAVA_HOME%\bin\client\jvm.dll" set KHIOPS_JAVA_PATH=%_KHIOPS_JAVA_HOME%\bin\client$\r$\n` + FileWrite $0 `if exist "%_KHIOPS_JAVA_HOME%\bin\server\jvm.dll" set KHIOPS_JAVA_PATH=%_KHIOPS_JAVA_HOME%\bin\server$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `:JAVA_END$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `$\r$\n` + FileWrite $0 `REM Print the environment list on the standard output$\r$\n` + FileWrite $0 `echo KHIOPS_HOME %KHIOPS_HOME%$\r$\n` + FileWrite $0 `echo KHIOPS_PATH %KHIOPS_PATH%$\r$\n` + FileWrite $0 `echo KHIOPS_MPI_COMMAND %KHIOPS_MPI_COMMAND%$\r$\n` + FileWrite $0 `echo KHIOPS_MPI_LIB %KHIOPS_MPI_LIB%$\r$\n` + FileWrite $0 `echo KHIOPS_JAVA_PATH %KHIOPS_JAVA_PATH%$\r$\n` + FileWrite $0 `echo KHIOPS_CLASSPATH %KHIOPS_CLASSPATH%$\r$\n` + FileWrite $0 `echo KHIOPS_LAST_RUN_DIR %KHIOPS_LAST_RUN_DIR%$\r$\n` + FileWrite $0 `echo KHIOPS_PROC_NUMBER %KHIOPS_PROC_NUMBER%$\r$\n` + FileWrite $0 `echo KHIOPS_TMP_DIR %KHIOPS_TMP_DIR%$\r$\n` + FileWrite $0 `echo KHIOPS_MEMORY_LIMIT %KHIOPS_MEMORY_LIMIT%$\r$\n` + FileWrite $0 `echo KHIOPS_API_MODE %KHIOPS_API_MODE%$\r$\n` + FileWrite $0 `echo KHIOPS_RAW_GUI %KHIOPS_RAW_GUI%$\r$\n` + FileWrite $0 `exit /b 0$\r$\n` + + # Close file + FileClose $0 +FunctionEnd diff --git a/packaging/windows/nsis/GetCoresCount.nsh b/packaging/windows/nsis/GetCoresCount.nsh new file mode 100644 index 000000000..74822c04e --- /dev/null +++ b/packaging/windows/nsis/GetCoresCount.nsh @@ -0,0 +1,54 @@ +# Copied entirely from +# http://stackoverflow.com/questions/29911549/cpu-features-getcount-return-incorrect-number-for-cpu-cores +!include LogicLib.nsh +!ifndef ERROR_INSUFFICIENT_BUFFER +!define ERROR_INSUFFICIENT_BUFFER 122 +!endif +!define RelationProcessorCore 0 + +!if "${NSIS_PTR_SIZE}" <= 4 +Function GetProcessorPhysCoreCount +System::Store S +StrCpy $9 0 ; 0 if we fail +System::Call 'kernel32::GetLogicalProcessorInformationEx(i${RelationProcessorCore},i,*i0r2)i.r0?e' +Pop $3 +${If} $3 = ${ERROR_INSUFFICIENT_BUFFER} +${AndIf} $2 <> 0 + System::Alloc $2 + System::Call 'kernel32::GetLogicalProcessorInformationEx(i${RelationProcessorCore},isr1,*ir2r2)i.r0' + Push $1 + ${If} $0 <> 0 + loop_7: + IntOp $9 $9 + 1 + System::Call *$1(i,i.r3) + IntOp $1 $1 + $3 + IntOp $2 $2 - $3 + IntCmp $2 0 "" loop_7 loop_7 + ${EndIf} + Pop $1 + System::Free $1 +${Else} + System::Call 'kernel32::GetLogicalProcessorInformation(i,*i0r2)i.r0?e' + Pop $3 + ${If} $3 = ${ERROR_INSUFFICIENT_BUFFER} + System::Alloc $2 + System::Call 'kernel32::GetLogicalProcessorInformation(isr1,*ir2r2)i.r0' + Push $1 + ${If} $0 <> 0 + loop_v: + System::Call *$1(i,i.r3) + ${If} $3 == ${RelationProcessorCore} + IntOp $9 $9 + 1 + ${EndIf} + IntOp $1 $1 + 24 + IntOp $2 $2 - 24 + IntCmp $2 0 "" loop_v loop_v + ${EndIf} + Pop $1 + System::Free $1 + ${EndIf} +${EndIf} +Push $9 +System::Store L +FunctionEnd +!endif diff --git a/packaging/windows/nsis/KhiopsGlobals.nsh b/packaging/windows/nsis/KhiopsGlobals.nsh new file mode 100644 index 000000000..72f5cabbd --- /dev/null +++ b/packaging/windows/nsis/KhiopsGlobals.nsh @@ -0,0 +1,14 @@ +# Global Definitions +# ------------------ + +# Minimal required Java version +!define JavaRequiredVersion "1.8" + +# Minimal required Java update version of the package installer +!define JavaRequiredVersionUpdate "181" + +# Minimal required full Java version (stored in the registry) +!define JavaRequiredFullVersion "1.8.0_181" + +# Minimal required MPI version +!define MPIRequiredVersion "10.0" diff --git a/packaging/windows/nsis/KhiopsPrerequisiteFunc.nsh b/packaging/windows/nsis/KhiopsPrerequisiteFunc.nsh new file mode 100644 index 000000000..45f5832bf --- /dev/null +++ b/packaging/windows/nsis/KhiopsPrerequisiteFunc.nsh @@ -0,0 +1,134 @@ +!include "FileFunc.nsh" +!include "x64.nsh" +!include "WordFunc.nsh" + +# To deactivate the requirements installation define DO_NOT_INSTALL_REQUIREMENTS + +# Detects and loads Java installation path and the JRE version +# - Defines JavaInstalledVersion and JavaInstallationPath +# - If the detection fails JavaInstalledVersion is set to "" +Function DetectAndLoadJavaEnvironment + # Installed version + Var /GLOBAL JavaInstalledVersion + + # Installation path + Var /GLOBAL JavaInstallationPath + + # Set the 64 bit registry to detect the correct version of Java + SetRegView 64 + + # Detection of JRE for Java >= 10 + StrCpy $JavaInstalledVersion "" + StrCpy $JavaInstallationPath "" + StrCpy $1 "SOFTWARE\JavaSoft\JRE" + StrCpy $2 0 + ReadRegStr $2 HKLM "$1" "CurrentVersion" + ${If} $2 != "" + ReadRegStr $3 HKLM "$1\$2" "JavaHome" + ${If} $3 != "" + StrCpy $JavaInstalledVersion $2 + StrCpy $JavaInstallationPath $3 + ${EndIf} + ${EndIf} + + # Debug message + !ifdef DEBUG + Messagebox MB_OK "JRE (>=10.0): required=${JavaRequiredVersion}, installed=$JavaInstalledVersion, path=$JavaInstallationPath" + !endif + + # Detection of JRE for Java < 10.0 + ${If} $JavaInstalledVersion == "" + StrCpy $JavaInstallationPath "" + StrCpy $1 "SOFTWARE\JavaSoft\Java Runtime Environment" + StrCpy $2 0 + ReadRegStr $2 HKLM "$1" "CurrentVersion" + ${If} $2 != "" + ReadRegStr $3 HKLM "$1\$2" "JavaHome" + ${If} $3 != "" + StrCpy $JavaInstallationPath $3 + StrCpy $JavaInstalledVersion $2 + ${EndIf} + ${EndIf} + ${EndIf} + + # Debug message + !ifdef DEBUG + Messagebox MB_OK "JRE (< 10.0): required=${JavaRequiredVersion}, installed=$JavaInstalledVersion, path=$JavaInstallationPath" + !endif + + # Get back to 32 bit registry + SetRegView 32 +FunctionEnd + +# Installs Java +Function InstallJava +!ifndef DO_NOT_INSTALL_REQUIREMENTS + # Write the JRE installer + SetOutPath $TEMP + File ${JRE_INSTALLER_PATH} + + # Execute the JRE installer silently + Var /Global JRE_INSTALLER_FILENAME + ${GetFileName} ${JRE_INSTALLER_PATH} $JRE_INSTALLER_FILENAME + nsexec::Exec '"$TEMP\$JRE_INSTALLER_FILENAME" INSTALL_SILENT=1 REBOOT=0' + Pop $0 + DetailPrint "Installation of Java JRE: $0" + + # Delete JRE installer + Delete "$TEMP\$JRE_INSTALLER_FILENAME" + + # Load the Java Environment + Call DetectAndLoadJavaEnvironment + + # Fail if the required version is newer than installed version + ${VersionCompare} "${JavaRequiredVersion}" "$JavaInstalledVersion" $0 + ${If} $0 == 1 + Messagebox MB_OK "Could not install Java runtime (version ${JavaRequiredVersion}): Khiops will run only in batch mode. Try installing Java JRE directly before installing to Khiops." /SD IDOK + ${EndIf} +!endif +FunctionEnd + + +# 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 new file mode 100644 index 000000000..e05399a25 --- /dev/null +++ b/packaging/windows/nsis/README.md @@ -0,0 +1,77 @@ +# Khiops NSIS packaging +This folder contains the scripts to generate the Khiops Windows installer. It is built with +[NSIS](https://nsis.sourceforge.io/Download). See also the [Release Process wiki +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) +- [Java Runtime Environment](https://www.java.com/en/download/manual.jsp) + +and installs them if necessary. + + +It also 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 [sample datasets](https://github.com/KhiopsML/khiops-samples/releases/latest). +- Documentation files: + - PDF Guides . + - README.txt and WHATSNEW.txt (obtained from the sources at (../../common/khiops)) + +## How to obtain the package assets +All the package assets (installers, documentation, etc) are available at the +[`khiops-win-install-assets`](https://github.com/KhiopsML/khiops-win-install-assets/releases/latest) +repository. + +## How to build the installer manually +1) Install NSIS and make sure `makensis` it is available in the `%PATH%`. +2) Download and decompress the package assets to your machine. +3) [Build Khiops in Release mode](https://github.com/KhiopsML/khiops/wiki/Building-Khiops) +4) In a console, go to the `packaging/windows/nsis` directory and execute +```bat +%REM We assume the package assets were downoladed to packaging\windows\nsis\assets +makensis ^ + /DKHIOPS_VERSION=10.2.0-preview ^ + /DKHIOPS_REDUCED_VERSION=10.2.0 ^ + /DKHIOPS_WINDOWS_BUILD_DIR=..\..\..\build\windows-msvc-release ^ + /DJRE_INSTALLER_PATH=.\assets\jre-8u371-windows-x64.exe ^ + /DJRE_VERSION=1.8 ^ + /DMSMPI_INSTALLER_PATH=.\assets\msmpisetup.exe ^ + /DMSMPI_VERSION=10.1.3 ^ + /DKHIOPS_VIZ_INSTALLER_PATH=.\assets\khiops-visualization-Setup-11.0.2.exe ^ + /DKHIOPS_COVIZ_INSTALLER_PATH=.\assets\khiops-covisualization-Setup-10.2.4.exe ^ + /DKHIOPS_SAMPLES_DIR=.\assets\samples ^ + /DKHIOPS_DOC_DIR=.\assets\doc ^ + khiops.nsi +``` + +The resulting installer will be at `packaging/windows/nsis/khiops-10.1.1-setup.exe`. + +_Note 1_: See [below](#build-script-arguments) for the details of the installer builder script arguments. + +_Note 2_: If your are using powershell replace the `^` characters by backticks `` ` `` in the +multi-line command. + + +## Github Workflow +This process is automatized in the [pack-nsis.yml workflow](../../../.github/workflows/pack-nsis.yml). + +## Build script arguments +All the arguments are mandatory except for `DEBUG`, they must be prefixed by `/D` and post fixed by +`=` to specify a value. + +- `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). +- `JRE_INSTALLER_PATH`: Path to the Java Runtime Environment (JRE) installer. +- `JRE_VERSION`: JRE version. +- `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_COVIZ_INSTALLER_PATH`: Path to the Khiops Covisualization installer. +- `KHIOPS_SAMPLES_DIR`: Path to the sample datasets directory. +- `KHIOPS_DOC_DIR`: Path to the directory containing the documentation. diff --git a/packaging/windows/nsis/images/headerimage.bmp b/packaging/windows/nsis/images/headerimage.bmp new file mode 100644 index 000000000..16942a3ce Binary files /dev/null and b/packaging/windows/nsis/images/headerimage.bmp differ diff --git a/packaging/windows/nsis/images/installer.ico b/packaging/windows/nsis/images/installer.ico new file mode 100644 index 000000000..95d877710 Binary files /dev/null and b/packaging/windows/nsis/images/installer.ico differ diff --git a/packaging/windows/nsis/images/welcomefinish.bmp b/packaging/windows/nsis/images/welcomefinish.bmp new file mode 100644 index 000000000..def59f3a7 Binary files /dev/null and b/packaging/windows/nsis/images/welcomefinish.bmp differ diff --git a/packaging/windows/nsis/khiops.nsi b/packaging/windows/nsis/khiops.nsi new file mode 100644 index 000000000..bb9b74a48 --- /dev/null +++ b/packaging/windows/nsis/khiops.nsi @@ -0,0 +1,818 @@ +# Khiops installer builder NSIS script + +# Set Unicode to avoid warning 7998: "ANSI targets are deprecated" +Unicode True + +# Set compresion to LZMA (faster) +SetCompressor /SOLID lzma + +# Include NSIS librairies +!include "LogicLib.nsh" +!include "MUI2.nsh" +!include "FileFunc.nsh" +!include "x64.nsh" +!include "winmessages.nsh" + +# Include Custom libraries +!include "KhiopsGlobals.nsh" +!include "GetCoresCount.nsh" +!include "CreateKhiopsEnvCmdFileFunc.nsh" +!include "CreateKhiopsCmdFileFunc.nsh" +!include "KhiopsPrerequisiteFunc.nsh" + +# Definitions for registry change notification +!define SHCNE_ASSOCCHANGED 0x8000000 +!define SHCNF_IDLIST 0 + +# Get installation folder from registry if available +InstallDirRegKey HKLM Software\khiops "" + +# Request admin privileges +RequestExecutionLevel admin + +# Make it aware of HiDPI screens +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 +!macroend + +# Check the mandatory input definitions +!insertmacro CheckInputParameter KHIOPS_VERSION +!insertmacro CheckInputParameter KHIOPS_REDUCED_VERSION +!insertmacro CheckInputParameter KHIOPS_WINDOWS_BUILD_DIR +!insertmacro CheckInputParameter KHIOPS_VIZ_INSTALLER_PATH +!insertmacro CheckInputParameter KHIOPS_COVIZ_INSTALLER_PATH +!insertmacro CheckInputParameter JRE_INSTALLER_PATH +!insertmacro CheckInputParameter JRE_VERSION +!insertmacro CheckInputParameter MSMPI_INSTALLER_PATH +!insertmacro CheckInputParameter MSMPI_VERSION +!insertmacro CheckInputParameter KHIOPS_SAMPLES_DIR +!insertmacro CheckInputParameter KHIOPS_DOC_DIR + +# Application name and installer file name +Name "Khiops ${KHIOPS_VERSION}" +OutFile "khiops-${KHIOPS_VERSION}-setup.exe" + +######################## +# Variable definitions # +######################## + +# MPI installation flag +Var /GLOBAL IsMPIRequired + +# Requirements installation flags +Var /GLOBAL MPIInstallationNeeded +Var /GLOBAL JavaInstallationNeeded + +# Requirements installation messages +Var /GLOBAL MPIInstallationMessage +Var /GLOBAL JavaInstallationMessage + +# Number of physical cores +Var /GLOBAL PhysicalCoresNumber + +# Number of processes to use +Var /GLOBAL ProcessNumber + +# Previous Uninstaller data +Var /GLOBAL PreviousUninstaller +Var /GLOBAL PreviousVersion + +# %Public%, %AllUsersProfile% (%ProgramData%) and samples directory +Var /GLOBAL WinPublicDir +Var /GLOBAL AllUsersProfileDir +Var /GLOBAL GlobalKhiopsDataDir +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 +!define MUI_HEADERIMAGE_BITMAP ".\images\headerimage.bmp" +!define MUI_HEADERIMAGE_LEFT +!define MUI_WELCOMEFINISHPAGE_BITMAP ".\images\welcomefinish.bmp" +!define MUI_ABORTWARNING +!define MUI_ICON ".\images\installer.ico" +!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\win-uninstall.ico" +BrandingText "Orange Innovation" + +# 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)" +!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 + +# Install files choice page +!insertmacro MUI_PAGE_INSTFILES + +# Final page +!define MUI_FINISHPAGE_RUN +!define MUI_FINISHPAGE_RUN_TEXT "Create desktop shortcut" +!define MUI_FINISHPAGE_RUN_FUNCTION "CreateDesktopShortcuts" +!define MUI_FINISHPAGE_TEXT "$\r$\n$\r$\nThank you for installing Khiops." +!define MUI_FINISHPAGE_LINK "khiops.org" +!define MUI_FINISHPAGE_LINK_LOCATION "https://khiops.org" +!insertmacro MUI_PAGE_FINISH + +# Uninstaller pages +!insertmacro MUI_UNPAGE_CONFIRM +!insertmacro MUI_UNPAGE_INSTFILES + +# Language (must be defined after uninstaller) +!insertmacro MUI_LANGUAGE "English" + +####################### +# Version Information # +####################### + +VIProductVersion "${KHIOPS_REDUCED_VERSION}.0" +VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "Khiops" +VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "Orange" +VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "Copyright (c) 2023 Orange" +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 + + # Install java if needed + ${If} $JavaInstallationNeeded == "1" + Call InstallJava + ${EndIf} + + # 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}\jars\norm.jar" + File "${KHIOPS_WINDOWS_BUILD_DIR}\jars\khiops.jar" + + # Install Docs + SetOutPath "$INSTDIR" + File "/oname=LICENSE.txt" "..\..\..\LICENSE" + File "..\..\common\khiops\README.txt" + File "..\..\common\khiops\WHATSNEW.txt" + SetOutPath "$INSTDIR\doc" + File /nonfatal /a /r "${KHIOPS_DOC_DIR}\" + + # 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\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" + ${EndIf} + + + # 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" + + + # Execute Khiops covisualization installer: + # Same rules as above with the visualization + + # Files to install in installer directory + File ${KHIOPS_COVIZ_INSTALLER_PATH} + + Var /Global KHIOPS_COVIZ_INSTALLER_FILENAME + ${GetFileName} ${KHIOPS_COVIZ_INSTALLER_PATH} $KHIOPS_COVIZ_INSTALLER_FILENAME + ${If} ${Silent} + nsexec::Exec 'cmd /C "$TEMP\$KHIOPS_COVIZ_INSTALLER_FILENAME /S"' + ${Else} + nsexec::Exec 'cmd /C "$TEMP\$KHIOPS_COVIZ_INSTALLER_FILENAME"' + ${EndIf} + Pop $0 + DetailPrint "Installation of Khiops covisualization: $0" + + # Delete the installer + Delete "$TEMP\$KHIOPS_COVIZ_INSTALLER_FILENAME" + + + ############################# + # Finalize the installation # + ############################# + + + # Creation of Khiops cmd files for Khiops et Khiops Coclustering + StrCpy $ProcessNumber $PhysicalCoresNumber + ${If} $PhysicalCoresNumber >= 2 + IntOp $ProcessNumber $PhysicalCoresNumber + 1 + ${EndIf} + ${CreateKhiopsEnvCmdFile} "$INSTDIR\bin\khiops_env.cmd" "$INSTDIR" $ProcessNumber + ${CreateKhiopsCmdFile} "$INSTDIR\bin\khiops.cmd" "MODL" "" "$INSTDIR" "scenario._kh" "log.txt" $IsMPIRequired + ${CreateKhiopsCmdFile} "$INSTDIR\bin\khiops_coclustering.cmd" "MODL_Coclustering" "" "$INSTDIR" "scenario._khc" "logc.txt" "0" + + # 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 '%comspec% /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 Labs" + WriteRegStr HKLM "${UninstallerKey}\Khiops" "DisplayIcon" "$INSTDIR\bin\icons\installer.ico" + WriteRegStr HKLM "${UninstallerKey}\Khiops" "DisplayVersion" "${KHIOPS_VERSION}" + WriteRegStr HKLM "${UninstallerKey}\Khiops" "URLInfoAbout" "http://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..." + CreateShortCut "$INSTDIR\Khiops.lnk" "$INSTDIR\bin\khiops.cmd" "" "$INSTDIR\bin\icons\khiops.ico" 0 SW_SHOWMINIMIZED + CreateShortCut "$INSTDIR\Khiops Coclustering.lnk" "$INSTDIR\bin\khiops_coclustering.cmd" "" "$INSTDIR\bin\icons\khiops_coclustering.ico" 0 SW_SHOWMINIMIZED + ExpandEnvStrings $R0 "%COMSPEC%" + CreateShortCut "$INSTDIR\Shell Khiops.lnk" "$INSTDIR\bin\shell_khiops.cmd" "" "$R0" + + # Create start menu shortcuts for the executables and documentation + DetailPrint "Installing Start menu Shortcut..." + CreateDirectory "$SMPROGRAMS\Khiops" + CreateShortCut "$SMPROGRAMS\Khiops\Khiops.lnk" "$INSTDIR\bin\khiops.cmd" "" "$INSTDIR\bin\icons\khiops.ico" 0 SW_SHOWMINIMIZED + CreateShortCut "$SMPROGRAMS\Khiops\Khiops Coclustering.lnk" "$INSTDIR\bin\khiops_coclustering.cmd" "" "$INSTDIR\bin\icons\khiops_coclustering.ico" 0 SW_SHOWMINIMIZED + ExpandEnvStrings $R0 "%COMSPEC%" + CreateShortCut "$SMPROGRAMS\Khiops\Shell Khiops.lnk" "$INSTDIR\bin\shell_khiops.cmd" "" "$R0" + CreateShortCut "$SMPROGRAMS\Khiops\Uninstall.lnk" "$INSTDIR\uninstall-khiops.exe" + CreateDirectory "$SMPROGRAMS\Khiops\doc" + CreateShortCut "$SMPROGRAMS\Khiops\doc\Tutorial.lnk" "$INSTDIR\doc\KhiopsTutorial.pdf" + CreateShortCut "$SMPROGRAMS\Khiops\doc\Khiops.lnk" "$INSTDIR\doc\KhiopsGuide.pdf" + CreateShortCut "$SMPROGRAMS\Khiops\doc\Khiops Coclustering.lnk" "$INSTDIR\doc\KhiopsCoclusteringGuide.pdf" + CreateShortCut "$SMPROGRAMS\Khiops\doc\Khiops Visualization.lnk" "$INSTDIR\doc\KhiopsVisualizationGuide.pdf" + CreateShortCut "$SMPROGRAMS\Khiops\doc\Khiops Covisualization.lnk" "$INSTDIR\doc\KhiopsCovisualizationGuide.pdf" + 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" + WriteRegStr HKCR "Khiops.File\shell\compile\command" "" '"$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\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" + RMDir /r "$INSTDIR\doc" + + # 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\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\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" + 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" + ${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\khiops.cmd" "" "$INSTDIR\bin\icons\khiops.ico" 0 SW_SHOWMINIMIZED + CreateShortCut "$DESKTOP\Khiops Coclustering.lnk" "$INSTDIR\bin\khiops_coclustering.cmd" "" "$INSTDIR\bin\icons\khiops_coclustering.ico" 0 SW_SHOWMINIMIZED +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} +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 and Java Runtime Environment" + + # Message to show for the Microsoft MPI installation + ${NSD_CreateLabel} 0 20u 100% 10u $MPIInstallationMessage + + # Message to show for the JRE installation + ${NSD_CreateLabel} 0 50u 100% 10u $JavaInstallationMessage + + # 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 + StrCpy $PhysicalCoresNumber "0" + Call GetProcessorPhysCoreCount + Pop $0 + StrCpy $PhysicalCoresNumber $0 + ${If} $PhysicalCoresNumber > 1 + StrCpy $IsMPIRequired "1" + ${Else} + StrCpy $IsMPIRequired "0" + ${EndIf} + ${If} $IsMPIRequired == "1" + # Note: This call defines MPIInstalledVersion + Call DetectAndLoadMPIEnvironment + ${EndIf} + + # Try to install MPI if it is required + StrCpy $MPIInstallationNeeded "0" + StrCpy $MPIInstallationMessage "" + ${If} $IsMPIRequired == "1" + # 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} + # Otherwise just inform that MPI is not required + ${Else} + StrCpy $MPIInstallationMessage "Microsoft MPI installation not required" + ${EndIf} + + # Show debug information + !ifdef DEBUG + Messagebox MB_OK "MS-MPI: needed=$MPIInstallationNeeded required=${MPIRequiredVersion} installed=$MPIInstalledVersion" + !endif + + # Detect and load Java Environment + Call DetectAndLoadJavaEnvironment + + # Message to install Java + StrCpy $JavaInstallationNeeded "0" + StrCpy $JavaInstallationMessage "" + ${If} $JavaInstallationPath == "" + StrCpy $JavaInstallationMessage "Java Runtime Environment version ${JRE_VERSION} will be installed" + StrCpy $JavaInstallationNeeded "1" + # If Java allready installed + ${Else} + # We use JavaRequiredVersion and not JavaRequiredFullVersion because of a bug + ${VersionCompare} "${JavaRequiredVersion}" "$JavaInstalledVersion" $0 + # Required version is newer than installed version + ${If} $0 == 1 + StrCpy $JavaInstallationMessage "New Java runtime version 1.${JRE_VERSION} will be installed" + StrCpy $JavaInstallationNeeded "1" + # Require version is equal or older than installed version + ${Else} + StrCpy $JavaInstallationMessage "Java runtime already installed" + ${EndIf} + ${EndIf} + + # Debug message + !ifdef DEBUG + Messagebox MB_OK "Java runtime: isNeeded=$JavaInstallationNeeded reqVersion=${JavaRequiredVersion} installedVersion=$JavaInstalledVersion" + !endif +FunctionEnd + +# No leave page for required software +Function RequirementsPageLeave +FunctionEnd diff --git a/scripts/khiops-package-version b/scripts/khiops-package-version index 7caceb6c0..eedbe59c4 100755 --- a/scripts/khiops-package-version +++ b/scripts/khiops-package-version @@ -19,17 +19,16 @@ main () { # The ref_name it should be either a hash or a tag declare ref_name="$1" - # Whether ref_name is a tag (default false) - declare is_tag="${2:-false}" - # Obtain the khiops version from the source local script_dir local khiops_version khiops_version="$("$SCRIPT_DIR/khiops-version")" - # See the header of the script for this part + # See the header of the script to understand this part local khiops_package_version - if [[ "$is_tag" == "true" ]] + + # Case of a tag + if git describe --tags --exact-match "$ref_name" 1> /dev/null 2> /dev/null then if [[ "$ref_name" == "v${khiops_version}" ]] then @@ -37,12 +36,14 @@ main () { else khiops_package_version="$khiops_version-preview-$ref_name" echo "::warning: Tag '$ref_name' doesn't match the Khiops source version '$khiops_version'" 1>&2 - echo "::warning: Creating snapshot package $khiops_package_version" 1>&2 + echo "::warning: Creating preview package version string '$khiops_package_version'" 1>&2 fi + # Case of another reference name (branch name or sha) else short_hash="$(git rev-parse --short --verify "$ref_name" | cut -d' ' -f1)" khiops_package_version="$khiops_version-preview-$short_hash" - echo "::warning: Creating snapshot package $khiops_package_version" 1>&2 + echo "::warning: Ref name '$ref_name' is not a tag" 1>&2 + echo "::warning: Creating preview package version string '$khiops_package_version'" 1>&2 fi echo "$khiops_package_version" } diff --git a/src/Learning/KWLearningProblem/KWLearningProblemHelpCard.cpp b/src/Learning/KWLearningProblem/KWLearningProblemHelpCard.cpp index 152d10164..0529f7c03 100644 --- a/src/Learning/KWLearningProblem/KWLearningProblemHelpCard.cpp +++ b/src/Learning/KWLearningProblem/KWLearningProblemHelpCard.cpp @@ -43,35 +43,38 @@ KWLearningProblemHelpCard::~KWLearningProblemHelpCard() {} void KWLearningProblemHelpCard::ShowDocumentation() { UICard documentationCard; + ALString sDocumentationHeader; require(GetFieldNumber() == 0); - // Titre + // Parametrage basique de la carte documentationCard.SetIdentifier("Documentation"); documentationCard.SetLabel("Documentation " + GetLearningFullApplicationName()); - // Affichage - if (sDocumentationText != "") + // Entete + sDocumentationHeader = "

" + GetLearningFullApplicationName() + "

" + sDocumentationHeader += + "

Khiops is an AutoML suite for supervised and unsupervised learning

"; + if (GetLearningWebSite() != "") { - documentationCard.AddStringField("Information", "", sDocumentationText); - documentationCard.GetFieldAt("Information")->SetStyle("FormattedLabel"); + sDocumentationHeader += "

Official website: "; + sDocumentationHeader += "" + GetLearningWebSite() + "

"; } - - // Site web + documentationCard.AddStringField("Header", "", "" + sDocumentationHeader + ""); if (GetLearningWebSite() != "") { - // Saut de ligne - documentationCard.AddStringField("NewLine", "", ""); - documentationCard.GetFieldAt("NewLine")->SetStyle("FormattedLabel"); - - // Site web - documentationCard.AddStringField("WebSite", "Web site", - " " + GetLearningWebSite() + " "); - documentationCard.GetFieldAt("WebSite")->SetStyle("UriLabel"); - documentationCard.GetFieldAt("WebSite")->SetParameters(GetLearningWebSite()); + documentationCard.GetFieldAt("Header")->SetStyle("UriLabel"); + documentationCard.GetFieldAt("Header")->SetParameters(GetLearningWebSite()); + } + else + { + documentationCard.GetFieldAt("Header")->SetStyle("FormattedLabel"); } - // Affichage + // Contenus + documentationCard.AddStringField("Body", "", "" + sDocumentationText + ""); + documentationCard.GetFieldAt("Body")->SetStyle("FormattedLabel"); + + // Affichage du widget documentationCard.Open(); } diff --git a/src/Learning/MODL/MDKhiopsLearningProject.cpp b/src/Learning/MODL/MDKhiopsLearningProject.cpp index a2a417a78..83c2df817 100644 --- a/src/Learning/MODL/MDKhiopsLearningProject.cpp +++ b/src/Learning/MODL/MDKhiopsLearningProject.cpp @@ -31,45 +31,49 @@ void MDKhiopsLearningProject::OpenLearningEnvironnement() // Parametrage du menu about SetLearningAboutImage("images/khiops_about.gif"); - SetLearningWebSite("www.khiops.com"); - - // Parametrage de la fenetre de documentation - sDocumentation = " "; - sDocumentation += "

" + GetLearningFullApplicationName() + "

"; + SetLearningWebSite("https://khiops.org"); // Documentation - sDocumentation += "

Reference guide and tutorial

"; + sDocumentation += "

Reference Guide and Tutorial

" #ifdef _WIN32 - sDocumentation += "

In the 'doc' sub-directory of the installation directory

"; -#elif defined __linux__ - sDocumentation += "

In the '/usr/share/doc/khiops' directory

"; + "

In the 'doc' sub-directory of the installation directory

"; +#elif defined __linux_or_apple__ + "

In the '/usr/share/doc/khiops' directory

"; #endif - // Examples - sDocumentation += "

Sample data sets

"; + // Sample datasets + sDocumentation += "

Sample Datasets

" + "

See the 'samples' directory " #ifdef _WIN32 - sDocumentation += "

In the 'samples' sub-directory of the installation directory

"; -#elif defined __linux__ - sDocumentation += "

In the '/usr/share/doc/khiops/samples' directory

"; + "in the 'Public' directory, usually C:\\Users\\Public\\khiops_data\\samples

"; +#elif defined __linux_or_apple__ + "in $HOME/khiops_data/samples

"; #endif - // Autre resources - sDocumentation += "

Dictionaries and modeling results under the json format

"; + // JSON Files sDocumentation += - "

The modeling results of Khiops (.khj) and Khiops coclustrering (.khcj) are stored using

" - "

the json format. Dictionaries (.kdic) can also be exported under the json format (.kdicj).

" - "

All these json files can be exploited from external tools, like pykhiops.

"; - sDocumentation += "

Visualization tools

"; - sDocumentation += "

All modeling results can be visualized using the Khiops visualization or Khiops " - "covisualization tools.

"; - sDocumentation += "

Scripting libraries

"; - sDocumentation += "

Full API to run the tool and to inspect its modeling results

"; - sDocumentation += "

pykhiops: python library

"; - sDocumentation += "

KNI: Khiops Native Interface

"; - sDocumentation += "

DLL for online deployment of models

"; - sDocumentation += "

Web site

"; - sDocumentation += "

Documentation and other resources are available for download

"; - sDocumentation += ""; + "

JSON Dictionary and Modeling Results Files

" + "

The modeling results of Khiops (.khj) and Khiops Coclustering (.khcj) are stored using

" + "

the JSON format. Dictionaries files (.kdic) may also be exported to JSON format (.kdicj).

" + "

These JSON files may be used with the Khiops Python library,

" + "

the Khiops Visualization tools (see below) or other custom external tools.

"; + + // Outils de visualisation + sDocumentation += "

Visualization Tools

" + "

The modeling result files (.khj and .khcj) can be visualized

" + "

using the Khiops Visualization or Khiops Covisualization tools.

"; + + // Librairie Python + sDocumentation += "

Khiops Python Library

" + "

This library allows to automatize the tool execution and to access

" + "

its analysis result files. More information at the Khiops website.

"; + + // Khiops Native Interface DLL + sDocumentation += "

KNI: Khiops Native Interface

" + "

DLL for online model deployment/prediction.

" + "

More information at the Khiops website.

"; + + // Parametrage de la documentation KWLearningProblemHelpCard::SetDocumentationText(sDocumentation); } diff --git a/src/Learning/MODL_Coclustering/CCLearningProject.cpp b/src/Learning/MODL_Coclustering/CCLearningProject.cpp index a4117501e..838a621f3 100644 --- a/src/Learning/MODL_Coclustering/CCLearningProject.cpp +++ b/src/Learning/MODL_Coclustering/CCLearningProject.cpp @@ -29,22 +29,43 @@ void CCLearningProject::OpenLearningEnvironnement() SetLearningAboutImage("images/khiops_coclustering_about.gif"); SetLearningWebSite("www.khiops.com"); - // Parametrage de la fenetre de documentation - sDocumentation = " "; - sDocumentation += "

" + GetLearningFullApplicationName() + "

"; - sDocumentation += "

Documentation and other resources are available in the installation directory and on " - "the web site

"; - sDocumentation += "

Reference guide and tutorial

"; - sDocumentation += "

In the 'doc' sub-directory of the installation directory

"; - sDocumentation += "

KhiopsCoclusteringGuide.pdf

"; - sDocumentation += "

KhiopsCoclusteringVisualizationGuide.pdf

"; - sDocumentation += "

KhiopsTutorial.pdf

"; - sDocumentation += "

Sample data sets

"; - sDocumentation += "

In the 'samples' sub-directory of the installation directory

"; - sDocumentation += "

pykhiops

"; - sDocumentation += "

In the 'python' sub-directory of the installation directory

"; - sDocumentation += "

Full python library to run the tool and to inspect its results from python

"; - sDocumentation += ""; + // Documentation + sDocumentation += "

Reference Guide and Tutorial

" +#ifdef _WIN32 + "

In the 'doc' sub-directory of the installation directory

"; +#elif defined __linux_or_apple__ + "

In the '/usr/share/doc/khiops' directory

"; +#endif + + // Sample datasets + sDocumentation += "

Sample Datasets

" + "

See the 'samples' directory " +#ifdef _WIN32 + "in the 'Public' directory,

" + "

usually C:\\Users\\Public\\khiops_data\\samples

"; +#elif defined __linux_or_apple__ + "in $HOME/khiops_data/samples

"; +#endif + + // JSON Files + sDocumentation += + "

JSON Dictionary and Modeling Results Files

" + "

The modeling results of Khiops (.khj) and Khiops Coclustering (.khcj) are stored using

" + "

the JSON format. Dictionaries files (.kdic) may also be exported to JSON format (.kdicj).

" + "

These JSON files may be used with the Khiops Python library,

" + "

the Khiops Visualization tools (see below) or other custom external tools.

"; + + // Outils de visualisation + sDocumentation += "

Visualization Tools

" + "

The modeling result files (.khj and .khcj) can be visualized

" + "

using the Khiops Visualization or Khiops Covisualization tools.

"; + + // Librairie Python + sDocumentation += "

Khiops Python Library

" + "

This library allows to automatize the tool execution and to access

" + "

its analysis result files. More information at the Khiops website.

"; + + // Parametrage de la documentation KWLearningProblemHelpCard::SetDocumentationText(sDocumentation); }