diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 6b0a38c..0000000 --- a/.gitignore +++ /dev/null @@ -1,72 +0,0 @@ -*.exe - -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# Distribution / packaging -.Python -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -share/python-wheels/ -*.egg-info/ -.installed.cfg -*.egg - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec -build/* -!build/Build.bat -!build/LocalBuild.bat -!build/RequirementGenBackup.bat - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.nox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*.cover -*.py,cover -.hypothesis/ -.pytest_cache/ -cover/ - -# Jupyter Notebook -.ipynb_checkpoints - -# IPython -profile_default/ -ipython_config.py - -# pyenv -.python-version - -# Environments -.env -.venv -env/ -venv/ -ENV/ -env.bak/ -venv.bak/ diff --git a/AIDevKit/Samples-Links.md b/AIDevKit/Samples-Links.md deleted file mode 100644 index 6776e48..0000000 --- a/AIDevKit/Samples-Links.md +++ /dev/null @@ -1,5 +0,0 @@ -# Important links -### [MSFT Webnn Developer Preview Link](https://microsoft.github.io/webnn-developer-preview) - -### [Webnn webmachinelearning Link](https://github.com/webmachinelearning/awesome-webnn) - diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 75b4a6c..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,118 +0,0 @@ -# AIPCDevKit Changelog -AIPCDevKit Release Notes - -All notable changes to this project will be documented in this file. - -## ReleaseVersion: [2024.10.2] - 2024-10-28 - -### Prerequisite -Download and install the following package version -| Software | Version | Description | -|-|-|-| - -### Sofware/Archive Versions -| Software/Archive | Version | -|-|-| -| Visual Studio Code | 1.91.0 | -| Git | 2.46.0 | -| Vim | 9.1.0 | -| Visual C++ Redistributable | 14.32.31332.0 | -| Cmake | 3.30.2 | -| OpenCV | 4.10.0 | -| Intel Driver & Support Assistant | 24.4.32.8 | -| Python | 3.10.11 | -| OpenVino | 2024.4.1 | -| OpenVino Notebooks | 2024.4 | -| Intel Demos | 2024.4 | -| Open Model Zoo | 2024.3.0 | - -### Feature Added -- Added working samples - -### Feature Changed / Modified -- Added option to include specific members from an archive - -### Feature Deprecated -No - -### Feature Removed -None - -### Issues Fixed -None - -### Security Issues Fixed -None - -### New Issues -None - -### Source Repo -- https://github.com/intel/aipc-devkit-install - -## ReleaseVersion: [2024.10.1] - 2024-10-08 - -### Prerequisite -Download and install the following package version -| Software | Version | Description | -|-|-|-| - -### Sofware/Archive Versions -| Software/Archive | Version | -|-|-| -| Visual Studio Code | 1.91.0 | -| Git | 2.46.0 | -| Vim | 9.1.0 | -| Visual C++ Redistributable | 14.32.31332.0 | -| Cmake | 3.30.2 | -| OpenCV | 4.10.0 | -| Intel Driver & Support Assistant | 24.4.32.8 | -| Python | 3.10.11 | -| OpenVino | 2024.4.1 | -| OpenVino Notebooks | 2024.4 | -| Open Model Zoo | 2024.3.0 | - - -### Feature Added -- Added signing of installer -- Added Git soruce tar ball -- Added File version and other details embedded in the installer.exe -- Added uninstall option in installer and an uninstall script -- Added option to install specific softwares -- Added option to install softwares from online -- Added option to download and extract archives -- Added UI to display license and install - -### Feature Changed / Modified -- Moved the path values from script to configuration file -- Changed silent install options for IDSA -- Changed python installation to be interactive -- Changed the path of Logs directory inside the installation directory -- Changed the starting directory for jupyter lab to openvino_notebooks -- Upgraded versions of Git, Cmake, OpenCV and python modules based on BDBA Vulnerabilities -- Install python wheels online -- Install all softwares from online -- Changed checksum from md5 sha256 -- Remove only the version of VC++ installed by the installer -- requirements.txt to be part of the installer.exe -- Upgraded pytorch version and upgraded openvino notebooks - -### Feature Deprecated -None - -### Feature Removed -None - -### Issues Fixed -- Fixed bandit scan and checkmarx issues -- Fixed OpenVino version Issues - -### Security Issues Fixed -None - -### New Issues -None - -### Source Repo -- https://github.com/intel/aipc-devkit-install - diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md deleted file mode 100644 index 58dba18..0000000 --- a/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,131 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -We as members, contributors, and leaders pledge to make participation in our -community a harassment-free experience for everyone, regardless of age, body -size, visible or invisible disability, ethnicity, sex characteristics, gender -identity and expression, level of experience, education, socio-economic status, -nationality, personal appearance, race, caste, color, religion, or sexual -identity and orientation. - -We pledge to act and interact in ways that contribute to an open, welcoming, -diverse, inclusive, and healthy community. - -## Our Standards - -Examples of behavior that contributes to a positive environment for our -community include: - -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience -* Focusing on what is best not just for us as individuals, but for the overall - community - -Examples of unacceptable behavior include: - -* The use of sexualized language or imagery, and sexual attention or advances of - any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email address, - without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Enforcement Responsibilities - -Community leaders are responsible for clarifying and enforcing our standards of -acceptable behavior and will take appropriate and fair corrective action in -response to any behavior that they deem inappropriate, threatening, offensive, -or harmful. - -Community leaders have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, and will communicate reasons for moderation -decisions when appropriate. - -## Scope - -This Code of Conduct applies within all community spaces, and also applies when -an individual is officially representing the community in public spaces. -Examples of representing our community include using an official e-mail address, -posting via an official social media account, or acting as an appointed -representative at an online or offline event. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement at -CommunityCodeOfConduct AT intel DOT com. -All complaints will be reviewed and investigated promptly and fairly. - -All community leaders are obligated to respect the privacy and security of the -reporter of any incident. - -## Enforcement Guidelines - -Community leaders will follow these Community Impact Guidelines in determining -the consequences for any action they deem in violation of this Code of Conduct: - -### 1. Correction - -**Community Impact**: Use of inappropriate language or other behavior deemed -unprofessional or unwelcome in the community. - -**Consequence**: A private, written warning from community leaders, providing -clarity around the nature of the violation and an explanation of why the -behavior was inappropriate. A public apology may be requested. - -### 2. Warning - -**Community Impact**: A violation through a single incident or series of -actions. - -**Consequence**: A warning with consequences for continued behavior. No -interaction with the people involved, including unsolicited interaction with -those enforcing the Code of Conduct, for a specified period of time. This -includes avoiding interactions in community spaces as well as external channels -like social media. Violating these terms may lead to a temporary or permanent -ban. - -### 3. Temporary Ban - -**Community Impact**: A serious violation of community standards, including -sustained inappropriate behavior. - -**Consequence**: A temporary ban from any sort of interaction or public -communication with the community for a specified period of time. No public or -private interaction with the people involved, including unsolicited interaction -with those enforcing the Code of Conduct, is allowed during this period. -Violating these terms may lead to a permanent ban. - -### 4. Permanent Ban - -**Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an -individual, or aggression toward or disparagement of classes of individuals. - -**Consequence**: A permanent ban from any sort of public interaction within the -community. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 2.1, available at -[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. - -Community Impact Guidelines were inspired by -[Mozilla's code of conduct enforcement ladder][Mozilla CoC]. - -For answers to common questions about this code of conduct, see the FAQ at -[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at -[https://www.contributor-covenant.org/translations][translations]. - -[homepage]: https://www.contributor-covenant.org -[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html -[Mozilla CoC]: https://github.com/mozilla/diversity -[FAQ]: https://www.contributor-covenant.org/faq diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 7904549..0000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,102 +0,0 @@ -# Contributing - -### License - -AIPC-DEVKIT-INSTALL is licensed under the terms in [LICENSE](License.txt). By contributing to the project, you agree to the license and copyright terms therein and release your contribution under these terms. - -### Sign your work - -Please use the sign-off line at the end of the patch. Your signature certifies that you wrote the patch or otherwise have the right to pass it on as an open-source patch. The rules are pretty simple: if you can certify -the below (from [developercertificate.org](http://developercertificate.org/)): - -``` -Developer Certificate of Origin -Version 1.1 - -Copyright (C) 2004, 2006 The Linux Foundation and its contributors. -660 York Street, Suite 102, -San Francisco, CA 94110 USA - -Everyone is permitted to copy and distribute verbatim copies of this -license document, but changing it is not allowed. - -Developer's Certificate of Origin 1.1 - -By making a contribution to this project, I certify that: - -(a) The contribution was created in whole or in part by me and I - have the right to submit it under the open source license - indicated in the file; or - -(b) The contribution is based upon previous work that, to the best - of my knowledge, is covered under an appropriate open source - license and I have the right under that license to submit that - work with modifications, whether created in whole or in part - by me, under the same open source license (unless I am - permitted to submit under a different license), as indicated - in the file; or - -(c) The contribution was provided directly to me by some other - person who certified (a), (b) or (c) and I have not modified - it. - -(d) I understand and agree that this project and the contribution - are public and that a record of the contribution (including all - personal information I submit with it, including my sign-off) is - maintained indefinitely and may be redistributed consistent with - this project or the open source license(s) involved. -``` - -Then you just add a line to every git commit message: - - Signed-off-by: Joe Smith - -Use your real name (sorry, no pseudonyms or anonymous contributions.) - -If you set your `user.name` and `user.email` git configs, you can sign your -commit automatically with `git commit -s`. - -## Forms of contribution - -### Provide Feedback - -* **Report bugs / issues** - If you experience faulty behavior, you can [create a new issue](https://github.com/intel/aipc-devkit-install/issues) in the GitHub issue tracker. -* **Propose new features / improvements** - If you have a suggestion for improvement or idea is already well defined, you can also create a - [Feature Request Issue](https://github.com/intel/aipc-devkit-install/issues) - -In both cases, provide a detailed description, including use cases, benefits, and potential challenges. If your points are especially well aligned with the product vision, they will be included in the development roadmap. - -### Contribute Code Changes - -If you want to help improving choose one of the issues reported in [GitHub Issue Tracker](https://github.com/intel/aipc-devkit-install/issues) and create a Pull Request addressing it. Before creating a new PR, check if nobody is already working on it. In such a case, you may still help, having aligned with the other developer. - -### Submit a PR with your changes - -Follow our [Good Pull Request guidelines](#general-rules-of-a-good-pull-request). Please remember about linking your Pull Request to the issue it addresses. - -### Wait for a review - -We'll make sure to review your Pull Request as soon as possible and provide you with our feedback. - -## General Rules of a Good Pull Request - -* Create your own fork of the repository and use it to create PRs. Avoid creating change branches in the main repository. -* Choose a proper branch for your work and create your own branch based on it. -* Give your branches, commits, and Pull Requests meaningful names and descriptions. It helps to track changes later. -* Make your PRs small - each PR should address one issue. Remove all changes unrelated to the PR. -* For Work In Progress, use a Draft PR. - -### Integration process - -* Once the Pull Request is approved, validation process will be initiated. -* After validation, the changes will be available in the main branch during the release. - -## Need Additional Help? Check these Articles - -* [How to create a fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo) - -## License - -By contributing, you agree that your contributions will be licensed under the terms stated in the [LICENSE](License.txt) file. \ No newline at end of file diff --git a/Configuration/installation_config.json b/Configuration/installation_config.json deleted file mode 100644 index 0bb94aa..0000000 --- a/Configuration/installation_config.json +++ /dev/null @@ -1,292 +0,0 @@ -{ - "default_paths": { - "openvino_source_dir": "Prerequisites\\OpenVino", - "samples_dir": "AIDevKit", - "openvino_dest_dir": "C:\\program files (x86)\\intel\\openvino2024", - "python_requirements_file": "Prerequisites\\PythonModules\\requirements.txt", - "local_python_wheel_dir": "Prerequisites\\PythonModules\\modules", - "local_installers_path": "Prerequisites\\Installers", - "installation_dir": "C:\\Intel\\aipcdevkit", - "venv_path": "C:\\Intel\\aipcdevkit\\aipc-venv", - "logs_dir": "C:\\Intel\\aipcdevkit\\SetupLogs", - "uninstall_logs_dir": "C:\\Intel\\UninstallLogs", - "default_python_path": "C:\\Python310\\python.exe", - "cmd_exe": "C:\\Windows\\System32\\cmd.exe", - "delete_files": ["C:\\Python310", "C:\\Intel\\opencv", "C:\\Program Files\\Git", "C:\\Intel\\aipcdevkit\\SetupLogs"], - "copy_files": ["uninstall.exe"] - }, - "archive_installations": [ - { - "name": "OpenVino", - "target_version": "2024.4.1", - "installation": { - "source_path": "OpenVino", - "source_file": "openvino.zip", - "destination_dir": "C:\\program files (x86)\\intel\\openvino2024", - "checksum": "8a763fcc2e3cdd916da56326c1e88dc2df0d2269001f0adc88bccc319e97636d", - "download_url": "https://github.com/openvinotoolkit/openvino/archive/refs/tags/2024.4.1.zip", - "skip_top_dir": true - } - }, - { - "name": "OpenVino Notebooks", - "target_version": "2024.4", - "installation": { - "source_path": "openvino_notebooks", - "source_file": "openvino_notebooks.zip", - "destination_dir": "openvino_notebooks", - "download_url": "https://github.com/openvinotoolkit/openvino_notebooks/archive/refs/heads/2024.4.zip", - "checksum": "a1d9e562ef12fd20388bdc4f7f6783e4e0ccd48b7fbcc8352953e9d51657fb79", - "skip_top_dir": true - } - }, - { - "name": "OpenVino Demo Notebooks", - "target_version": "2024.4", - "installation": { - "source_path": "openvino_demo", - "source_file": "openvino_demo.zip", - "destination_dir": "openvino_notebooks\\openvino_build_deploy", - "download_url": "https://github.com/openvinotoolkit/openvino_build_deploy/archive/refs/heads/master.zip", - "skip_top_dir": true - } - }, - { - "name": "Open Model Zoo", - "target_version": "2024.3.0", - "installation": { - "source_path": "open_model_zoo", - "source_file": "open_model_zoo.zip", - "destination_dir": "openmodelzoo", - "download_url": "https://github.com/openvinotoolkit/open_model_zoo/archive/refs/tags/2024.3.0.zip", - "checksum": "105b0238b8c1cafa061574edaafd0237e673098df5d992cd87f9188f1ecc9c28", - "skip_top_dir": true - } - } - ], - "software_installations": [ - { - "name": "Python", - "target_version": "3.10.11", - "installation": { - "installer_path": "python", - "installer_exe": "python-3.10.11-amd64.exe", - "install_flags": ["InstallAllUsers=1", "DefaultAllUsersTargetDir=C:\\Python310", "PrependPath=1", "Include_test=0"], - "quiteinstall_flags": ["/quiet", "InstallAllUsers=1", "DefaultAllUsersTargetDir=C:\\Python310", "PrependPath=1", "SimpleInstall=1", "Include_test=0"], - "download_url": "https://www.python.org/ftp/python/3.10.11/python-3.10.11-amd64.exe", - "checksum": "d8dede5005564b408ba50317108b765ed9c3c510342a598f9fd42681cbe0648b" - }, - "uninstallation": { - "registry": { - "check_name_in_installed_softwares": [{"name": "Python 3.10.11 (64-bit)", "version": "3.10.11150.0"}], - "quiteuninstall_flags": ["/quiet"] - } - }, - "prechecks": { - "command_check": { - "command": ["C:\\Python310\\python.exe"], - "options": ["--version"] - } - }, - "logs": { - "file_name": "python_Install.log", - "option": "/log" - } - }, - { - "name": "Visual Studio Code", - "target_version": "1.91.0", - "installation": { - "installer_path": "VSCode", - "installer_exe": "VSCodeSetup-x64-1.91.0.exe", - "install_flags": ["/norestart", "/mergetasks=!runcode", "/dir=C:\\Program Files\\Microsoft VS Code"], - "quiteinstall_flags": ["/norestart", "/mergetasks=!runcode", "/dir=C:\\Program Files\\Microsoft VS Code", "/SP-", "/verysilent"], - "download_url": "https://update.code.visualstudio.com/1.91.0/win32-x64/stable", - "checksum": "fa3ea61ca7fbff9b40731a90975c3d48a648a1ef7bbcb747e7227a7552dc8d91" - }, - "uninstallation": { - "registry": { - "check_name_in_installed_softwares": [ - {"name": "Microsoft Visual Studio Code"} - ], - "quiteuninstall_flags": ["/norestart", "/SP-", "/verysilent"] - } - }, - "prechecks": { - "registry": { - "check_name_in_installed_softwares": "Microsoft Visual Studio Code", - "registry_value": "DisplayVersion" - } - }, - "logs": { - "option": "/log=", - "file_name": "VSCode_Install.log" - }, - "post_install": [ - { - "fallback_command": ["code", "--install-extension", "ms-python.python", "--install-extension", "ms-toolsai.jupyter"], - "command": ["C:\\Program Files\\Microsoft VS Code\\bin\\code.cmd", "--install-extension", "ms-python.python", "--install-extension", "ms-toolsai.jupyter"] - } - ] - }, - { - "name": "Visual C++ Redistributable", - "target_version": "14.32.31332", - "installation": { - "installer_path": "VCRedist", - "installer_exe": "vc_redist.x64.exe", - "install_flags": ["/install", "/norestart", "/mergetasks=!runcode"], - "quiteinstall_flags": ["/install", "/norestart", "/mergetasks=!runcode", "/quiet"], - "checksum": "ce6593a1520591e7dea2b93fd03116e3fc3b3821a0525322b0a430faa6b3c0b4", - "download_url": "https://aka.ms/vs/17/release/17.2svcbaseline/VC_redist.x64.exe" - }, - "uninstallation": { - "registry": { - "check_name_in_installed_softwares": [ - {"name": "Microsoft Visual C++ 2015-2022 Redistributable (x64) - 14.32.31332", "version": "14.32.31332.0"} - ], - "quiteuninstall_flags": ["/norestart", "/quiet"] - } - }, - "prechecks": { - "registry": { - "registry_keys": ["SOFTWARE\\Microsoft\\VisualStudio\\14.0\\VC\\Runtimes\\x64"], - "registry_value": "Version" - } - }, - "logs": { - "option": "/log", - "file_name": "VCRedist_Install.log" - } - }, - { - "name": "Cmake", - "target_version": "3.30.2", - "installation": { - "installer_path": "Cmake", - "installer_exe": "cmake-3.30.2-windows-x86_64.msi", - "install_flags": ["/norestart", "ALLUSERS=1", "ADD_CMAKE_TO_PATH=System"], - "install_command": ["msiexec", "/i"], - "quiteinstall_flags": ["/quiet", "/norestart", "ALLUSERS=1", "ADD_CMAKE_TO_PATH=System"], - "checksum": "31f799a9e7756305f74cd821970a793e599ead230925392886f45aed897a3c0e", - "download_url": "https://github.com/Kitware/CMake/releases/download/v3.30.2/cmake-3.30.2-windows-x86_64.msi" - }, - "uninstallation": { - "registry": { - "check_name_in_installed_softwares": [{"name": "CMake"}], - "quiteuninstall_flags": ["/norestart", "/quiet"] - } - }, - "prechecks": { - "registry": { - "check_name_in_installed_softwares": "CMake", - "registry_value": "DisplayVersion" - } - }, - "logs": { - "option": "/log", - "file_name": "CMake_Install.log" - } - }, - { - "name": "Git", - "target_version": "2.46.0", - "installation": { - "installer_path": "Git", - "installer_exe": "Git-2.46.0-64-bit.exe", - "install_flags": ["/norestart"], - "quiteinstall_flags": ["/SP-", "/verysilent", "/norestart"], - "checksum": "e6337d172590cea1f673acfeef218733e9352adeb863a3a9e8fa20ee0719a40f", - "download_url": "https://github.com/git-for-windows/git/releases/download/v2.46.0.windows.1/Git-2.46.0-64-bit.exe" - }, - "uninstallation": { - "registry": { - "check_name_in_installed_softwares": [{"name": "Git"}], - "quiteuninstall_flags": ["/SP-", "/verysilent", "/norestart"] - } - }, - "prechecks": { - "registry": { - "registry_keys": ["SOFTWARE\\GitForWindows"], - "registry_value": "CurrentVersion" - } - }, - "logs": { - "option": "/LOG=", - "file_name": "Git_Install.log" - } - }, - { - "name": "OpenCV", - "target_version": "4.10.0", - "installation": { - "installer_path": "opencv", - "installer_exe": "opencv-4.10.0-windows.exe", - "install_flags": ["-y", "-oC:\\Intel"], - "quiteinstall_flags": ["-y", "-oC:\\Intel"], - "checksum": "bff38466091c313dac21a0b73eea8278316a89c1d434c6f0b10697e087670168", - "download_url": "https://github.com/opencv/opencv/releases/download/4.10.0/opencv-4.10.0-windows.exe" - }, - "prechecks": { - "command_check": { - "command": ["C:\\Intel\\opencv\\build\\x64\\vc16\\bin\\opencv_version.exe"] - } - }, - "logs": { - "option": "/log", - "file_name": "OpenCV_Install.log" - } - }, - { - "name": "VIM", - "target_version": "9.1.0", - "installation": { - "installer_path": "vim", - "installer_exe": "gvim_9.1.0_x64_signed.exe", - "install_flags": ["/package"], - "quiteinstall_flags": ["/S", "/package"], - "checksum": "daf645c53a3a4e62743093c674d7530e3a741e8a758a63f63e88c00d6b467719", - "download_url": "https://github.com/vim/vim-win32-installer/releases/download/v9.1.0/gvim_9.1.0_x64_signed.exe" - }, - "uninstallation": { - "registry": { - "check_name_in_installed_softwares": [{"name": "Vim 9.1 (x64)"}], - "uninstall_flags": ["/S"], - "quiteuninstall_flags": ["/S"] - } - }, - "prechecks": { - "registry": { - "check_name_in_installed_softwares": "Vim 9.1 (x64)", - "registry_value": "DisplayVersion" - } - }, - "logs": { - "file_name": "Vim_Install.log", - "option": "/log=" - } - }, - { - "name": "Intel Driver & Support Assistant", - "target_version": "24.4.32.8", - "installation": { - "installer_path": "IDSA", - "installer_exe": "Intel-Driver-and-Support-Assistant-Installer.exe", - "install_flags": [], - "quiteinstall_flags": ["-install", "-q", "-norestart"], - "checksum": "", - "download_url": "https://dsadata.intel.com/installer" - }, - "prechecks": { - "registry": { - "check_name_in_installed_softwares": "Intel Driver & Support Assistant", - "registry_value": "DisplayVersion" - } - }, - "logs": { - "file_name": "IDSA_Install.log", - "option": "" - } - } - ] -} \ No newline at end of file diff --git a/Installation_Guide.md b/Installation_Guide.md deleted file mode 100644 index dba3278..0000000 --- a/Installation_Guide.md +++ /dev/null @@ -1,109 +0,0 @@ -# Intel® AI PC Development Kit -## VERSION 2024.10.2 README -### October 30, 2024 - -## Table of Contents - -1. [Introduction](#1-introduction) -2. [System Requirements](#2-system-requirements) -3. [Installation Instructions](#3-installation-instructions) -4. [Uninstallation Instructions](#4-uninstallation-instructions) -5. [Usage Information](#5-usage-information) -6. [Known Issues](#6-known-issues) -7. [License Agreement](#7-license-agreement) - - -## 1. Introduction - -This README file provides comprehensive information about the Intel® AI PC Development Kit. - -The Intel® AI PC Development Kit will install the following software on your system: - -- **Python** : 3.10.11 -- **Visual Studio Code** : 1.91.0 -- **Git** : 2.46.0 -- **Vim** : 9.1.0 -- **Visual C++ Redistributable** : 14.32.31332.0 -- **Cmake** : 3.30.2 -- **OpenCV** : 4.10.0 -- **Intel Driver & Support Assistant** : 24.4.32.8 -- **OpenVino** : 2024.4.1 -- **OpenVino Notebooks** : 2024.4 -- **Intel Demos** : 2024.4 -- **Open Model Zoo** : 2024.3.0 -- **Dependent Python Modules** - -## 2. System Requirements - -- **Operating System**: Windows 11 -- **Internet Connection**: Required -- **Environment Variables**: - - `PIP_TRUSTED_HOST=pypi.org files.pythonhosted.org` - - Ensure the Git path is included in the system environment variable, e.g., `set PATH=%PATH%;C:\Program Files\Git\bin` - -## 3. Installation Instructions - -**Note 1:** These steps are not required, if the system is pre-installed. - -**Note 2:** If you are building the installer from source with the help of [README.md](README.md), then skip first 3 steps and continue with step 4 - -1. Copy `IntelAIPCDevkit_2024.10.2.zip` to `C:\Intel\Setup`. -2. Unzip the contents of the zip file into the `Setup` folder. -3. Navigate to `C:\Intel\Setup\IntelAIPCDevkit_2024.10.2`. -4. Run `installer.exe` with administrative privileges. -5. The license agreement will appear. Click "I accept the license agreement" to start the installation. -6. Click "Install". -7. The installation will begin, and the software listed in section 1 will be installed sequentially. -8. Accept the licenses as needed. -9. The installations will proceed with default options. -10. After the installation completes, the AI PC virtual environment will be available, and Jupyter Notebook will open in the browser. - -## 4. Uninstallation Instructions - -1. The uninstaller can be found at `C:\Intel\aipcdevkit`. -2. Run `uninstall.exe` with administrative privileges to remove all the software installed during the installation process. Note that the Intel Driver & Support Assistant (IDSA) will not be uninstalled. -3. Uninstallation logs will not be removed and can be found at `C:\Intel\UninstallLogs`. - -## 5. Usage Information - -1. Set up your browser to enable WebNN flags. This is not enabled by default for security reasons. - - **Google Chrome**: Type `chrome://flags` in the browser and search for WebNN. Select "Enabled" in the dropdown that appears. - - **Microsoft Edge**: Type `edge://flags` in the browser and search for WebNN. Select "Enabled" in the dropdown that appears. -2. You can restart Jupyter Labs anytime after the installation by running `start_lab.cmd` from `C:\Intel\aipcdevkit`. - -## 6. Known Issues - -1. **Unable to download software**: - - Ensure Internet connection is available and proxies are set as required. -2. **Jupyter Kernel not working**: - - A Jupyter Lab Kernel HTTP Connection error may occur, preventing the installation of Python modules. - - Add the environment variable: `PIP_TRUSTED_HOST=pypi.org files.pythonhosted.org`. -3. **`git+https` module is not working**: - - The `git+https` module is not functioning on the dev kit for Jupyter Notebooks, preventing the execution of notebooks that use Hugging Face models and the Intel Optimum package. - - Add the environment variable: `PIP_TRUSTED_HOST=pypi.org files.pythonhosted.org`. -4. **Internet/Network stability**: - - The installer requires a stable internet connection as software is downloaded during the installation. The Python modules download timeout is set to 2 minutes. Delays may cause the download/installation of modules to fail. - -## 7. License Agreement - -Copyright © 2024 Intel Corporation - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in the -Software without restriction, including without limitation the rights to use, copy, -modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, -and to permit persons to whom the Software is furnished to do so, subject to the -following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. diff --git a/License.txt b/License.txt deleted file mode 100644 index f9d60ff..0000000 --- a/License.txt +++ /dev/null @@ -1,7 +0,0 @@ -Copyright © 2024 Intel Corporation - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/Prerequisites/PythonModules/requirements.txt b/Prerequisites/PythonModules/requirements.txt deleted file mode 100644 index 1fd0cec..0000000 --- a/Prerequisites/PythonModules/requirements.txt +++ /dev/null @@ -1,1224 +0,0 @@ -## Copyright (C) 2024 Intel Corporation -## Author: Krishna Lakhotia -## Author: Balasubramanyam Agalukote Lakshmipathi -## -## This software and the related documents are Intel copyrighted materials, and your use of them is -## governed by the express license under which they were provided to you ("License"). Unless the -## License provides otherwise, you may not use, modify, copy, publish, distribute, disclose or -## transmit this software or the related documents without Intel's prior written permission. -## -## This software and the related documents are provided as is, with no express or implied warranties, -## other than those that are expressly stated in the License. - -# -# This file is autogenerated by pip-compile with Python 3.10 -# by the following command: -# -# pip-compile --output-file=requirementsnew.txt requirementsbase.in -# -about-time==4.2.1 - # via alive-progress -absl-py==2.2.2 - # via - # -r requirementsbase.in - # keras - # tensorboard - # tensorflow -aiohappyeyeballs==2.6.1 - # via aiohttp -aiohttp==3.11.16 - # via - # -r requirementsbase.in - # datasets - # fsspec -aiosignal==1.3.2 - # via - # -r requirementsbase.in - # aiohttp -alive-progress==3.2.0 - # via - # -r requirementsbase.in - # pymoo -altgraph==0.17.4 - # via pyinstaller -anyio==4.9.0 - # via - # -r requirementsbase.in - # httpx - # jupyter-server -argon2-cffi==23.1.0 - # via - # -r requirementsbase.in - # jupyter-server -argon2-cffi-bindings==21.2.0 - # via - # -r requirementsbase.in - # argon2-cffi -arrow==1.3.0 - # via - # -r requirementsbase.in - # isoduration -asttokens==3.0.0 - # via - # -r requirementsbase.in - # stack-data -astunparse==1.6.3 - # via - # -r requirementsbase.in - # tensorflow -async-lru==2.0.5 - # via - # -r requirementsbase.in - # jupyterlab -async-timeout==5.0.1 - # via - # -r requirementsbase.in - # aiohttp -attrs==25.3.0 - # via - # -r requirementsbase.in - # aiohttp - # jsonschema - # referencing -audioread==3.0.1 - # via - # -r requirementsbase.in - # librosa -autograd==1.7.0 - # via - # -r requirementsbase.in - # pymoo -babel==2.17.0 - # via - # -r requirementsbase.in - # jupyterlab-server -backports-tarfile==1.2.0 - # via jaraco-context -beautifulsoup4==4.13.3 - # via - # -r requirementsbase.in - # nbconvert -bleach[css]==6.2.0 - # via - # -r requirementsbase.in - # nbconvert -build==1.2.2.post1 - # via tensorflow-intel -cachetools==5.5.2 - # via - # -r requirementsbase.in - # google-auth -certifi==2025.1.31 - # via - # -r requirementsbase.in - # httpcore - # httpx - # requests - # sentry-sdk -cffi==1.17.1 - # via - # -r requirementsbase.in - # argon2-cffi-bindings - # soundfile -charset-normalizer==3.4.1 - # via - # -r requirementsbase.in - # requests -click==8.1.8 - # via - # -r requirementsbase.in - # jiwer - # typer -cma==3.2.2 - # via - # -r requirementsbase.in - # pymoo -colorama==0.4.6 - # via - # -r requirementsbase.in - # build - # click - # ipython - # pytest - # tqdm -coloredlogs==15.0.1 - # via - # -r requirementsbase.in - # onnxruntime -comm==0.2.2 - # via - # -r requirementsbase.in - # ipykernel - # ipywidgets -contourpy==1.3.1 - # via - # -r requirementsbase.in - # matplotlib -cycler==0.12.1 - # via - # -r requirementsbase.in - # matplotlib -datasets==3.5.0 - # via - # -r requirementsbase.in - # optimum-intel -debugpy==1.8.13 - # via - # -r requirementsbase.in - # ipykernel -decorator==5.2.1 - # via - # -r requirementsbase.in - # ipython - # librosa -defusedxml==0.7.1 - # via - # -r requirementsbase.in - # nbconvert -deprecated==1.2.18 - # via - # -r requirementsbase.in - # neural-compressor - # pymoo -diffusers==0.32.2 - # via -r requirementsbase.in -dill==0.3.8 - # via - # -r requirementsbase.in - # datasets - # multiprocess - # pymoo -docutils==0.21.2 - # via readme-renderer -exceptiongroup==1.2.2 - # via - # -r requirementsbase.in - # anyio - # ipython - # pytest -executing==2.2.0 - # via - # -r requirementsbase.in - # stack-data -fastjsonschema==2.21.1 - # via - # -r requirementsbase.in - # nbformat -filelock==3.18.0 - # via - # -r requirementsbase.in - # datasets - # diffusers - # huggingface-hub - # torch - # transformers -flatbuffers==25.2.10 - # via - # -r requirementsbase.in - # onnxruntime - # tensorflow -fonttools==4.57.0 - # via - # -r requirementsbase.in - # matplotlib -fqdn==1.5.1 - # via - # -r requirementsbase.in - # jsonschema -frozenlist==1.5.0 - # via - # -r requirementsbase.in - # aiohttp - # aiosignal -fsspec[http]==2024.12.0 - # via - # -r requirementsbase.in - # datasets - # huggingface-hub - # torch -future==1.0.0 - # via -r requirementsbase.in -gast==0.6.0 - # via - # -r requirementsbase.in - # tensorflow -google-auth==2.38.0 - # via - # -r requirementsbase.in - # google-auth-oauthlib -google-auth-oauthlib==1.2.1 - # via -r requirementsbase.in -google-pasta==0.2.0 - # via - # -r requirementsbase.in - # tensorflow -grapheme==0.6.0 - # via - # -r requirementsbase.in - # alive-progress -grpcio==1.71.0 - # via - # -r requirementsbase.in - # tensorboard - # tensorflow -h11==0.14.0 - # via - # -r requirementsbase.in - # httpcore -h5py==3.13.0 - # via - # -r requirementsbase.in - # keras - # tensorflow -httpcore==1.0.7 - # via - # -r requirementsbase.in - # httpx -httpx==0.28.1 - # via - # -r requirementsbase.in - # jupyterlab -huggingface-hub==0.30.2 - # via - # -r requirementsbase.in - # datasets - # diffusers - # optimum - # tokenizers - # transformers -humanfriendly==10.0 - # via - # -r requirementsbase.in - # coloredlogs -id==1.5.0 - # via twine -idna==3.10 - # via - # -r requirementsbase.in - # anyio - # httpx - # jsonschema - # requests - # yarl -imageio==2.37.0 - # via - # -r requirementsbase.in - # scikit-image -importlib-metadata==8.6.1 - # via - # -r requirementsbase.in - # diffusers - # keyring -iniconfig==2.1.0 - # via - # -r requirementsbase.in - # pytest -intel-cmplr-lib-ur==2025.1.0 - # via intel-openmp -intel-npu-acceleration-library==1.4.0 - # via -r requirementsbase.in -intel-openmp==2025.1.0 - # via mkl -ipykernel==6.29.5 - # via - # -r requirementsbase.in - # jupyterlab -ipython==8.35.0 - # via - # -r requirementsbase.in - # ipykernel - # ipywidgets -ipywidgets==8.1.5 - # via -r requirementsbase.in -isoduration==20.11.0 - # via - # -r requirementsbase.in - # jsonschema -jaraco-classes==3.4.0 - # via keyring -jaraco-context==6.0.1 - # via keyring -jaraco-functools==4.1.0 - # via keyring -jedi==0.19.2 - # via - # -r requirementsbase.in - # ipython -jinja2==3.1.6 - # via - # -r requirementsbase.in - # jupyter-server - # jupyterlab - # jupyterlab-server - # nbconvert - # torch -jiwer==3.1.0 - # via -r requirementsbase.in -joblib==1.4.2 - # via - # -r requirementsbase.in - # librosa - # scikit-learn -json5==0.12.0 - # via - # -r requirementsbase.in - # jupyterlab-server -jsonpointer==3.0.0 - # via - # -r requirementsbase.in - # jsonschema -jsonschema[format-nongpl]==4.23.0 - # via - # -r requirementsbase.in - # jupyter-events - # jupyterlab-server - # nbformat - # nncf -jsonschema-specifications==2024.10.1 - # via - # -r requirementsbase.in - # jsonschema -jstyleson==0.0.2 - # via - # -r requirementsbase.in - # nncf -jupyter-client==8.6.3 - # via - # -r requirementsbase.in - # ipykernel - # jupyter-server - # nbclient -jupyter-core==5.7.2 - # via - # -r requirementsbase.in - # ipykernel - # jupyter-client - # jupyter-server - # jupyterlab - # nbclient - # nbconvert - # nbformat -jupyter-events==0.12.0 - # via - # -r requirementsbase.in - # jupyter-server -jupyter-lsp==2.2.5 - # via - # -r requirementsbase.in - # jupyterlab -jupyter-server==2.15.0 - # via - # -r requirementsbase.in - # jupyter-lsp - # jupyterlab - # jupyterlab-server - # notebook-shim -jupyter-server-terminals==0.5.3 - # via - # -r requirementsbase.in - # jupyter-server -jupyterlab==4.4.0 - # via -r requirementsbase.in -jupyterlab-pygments==0.3.0 - # via - # -r requirementsbase.in - # nbconvert -jupyterlab-server==2.27.3 - # via - # -r requirementsbase.in - # jupyterlab -jupyterlab-widgets==3.0.13 - # via - # -r requirementsbase.in - # ipywidgets -keras==3.9.2 - # via - # -r requirementsbase.in - # tensorflow -keyring==25.6.0 - # via twine -kiwisolver==1.4.8 - # via - # -r requirementsbase.in - # matplotlib -lazy-loader==0.4 - # via - # -r requirementsbase.in - # librosa - # scikit-image -libclang==18.1.1 - # via - # -r requirementsbase.in - # tensorflow -librosa==0.11.0 - # via -r requirementsbase.in -llvmlite==0.44.0 - # via - # -r requirementsbase.in - # numba -markdown==3.7 - # via - # -r requirementsbase.in - # tensorboard -markdown-it-py==3.0.0 - # via - # -r requirementsbase.in - # rich -markupsafe==3.0.2 - # via - # -r requirementsbase.in - # jinja2 - # nbconvert - # werkzeug -matplotlib==3.10.1 - # via - # -r requirementsbase.in - # pycocotools - # pymoo - # seaborn - # ultralytics -matplotlib-inline==0.1.7 - # via - # -r requirementsbase.in - # ipykernel - # ipython -mdurl==0.1.2 - # via - # -r requirementsbase.in - # markdown-it-py -mistune==3.1.3 - # via - # -r requirementsbase.in - # nbconvert -mkl==2025.1.0 - # via -r requirementsbase.in -ml-dtypes==0.5.1 - # via - # -r requirementsbase.in - # keras - # tensorflow -more-itertools==10.6.0 - # via - # jaraco-classes - # jaraco-functools -mpmath==1.3.0 - # via - # -r requirementsbase.in - # sympy -msgpack==1.1.0 - # via - # -r requirementsbase.in - # librosa -multidict==6.2.0 - # via - # -r requirementsbase.in - # aiohttp - # yarl -multiprocess==0.70.16 - # via - # -r requirementsbase.in - # datasets -namex==0.0.8 - # via - # -r requirementsbase.in - # keras -natsort==8.4.0 - # via - # -r requirementsbase.in - # nncf -nbclient==0.10.2 - # via - # -r requirementsbase.in - # nbconvert -nbconvert==7.16.6 - # via - # -r requirementsbase.in - # jupyter-server -nbformat==5.10.4 - # via - # -r requirementsbase.in - # jupyter-server - # nbclient - # nbconvert -nest-asyncio==1.6.0 - # via - # -r requirementsbase.in - # ipykernel -networkx==3.3 - # via - # -r requirementsbase.in - # nncf - # scikit-image - # torch -neural-compressor==3.3.1 - # via intel-npu-acceleration-library -nh3==0.2.21 - # via readme-renderer -ninja==1.11.1.4 - # via - # -r requirementsbase.in - # nncf -nncf==2.15.0 - # via -r requirementsbase.in -notebook-shim==0.2.4 - # via - # -r requirementsbase.in - # jupyterlab -numba==0.61.2 - # via - # -r requirementsbase.in - # librosa -numpy==1.26.4 - # via - # -r requirementsbase.in - # autograd - # cma - # contourpy - # datasets - # diffusers - # h5py - # imageio - # intel-npu-acceleration-library - # keras - # librosa - # matplotlib - # ml-dtypes - # neural-compressor - # nncf - # numba - # onnx - # onnxruntime - # opencv-python - # opencv-python-headless - # openvino - # optimum - # pandas - # pycocotools - # pymoo - # scikit-image - # scikit-learn - # scipy - # seaborn - # soundfile - # soxr - # tensorboard - # tensorflow - # tifffile - # torchvision - # transformers - # ultralytics - # ultralytics-thop -oauthlib==3.2.2 - # via - # -r requirementsbase.in - # requests-oauthlib -onnx==1.17.0 - # via - # -r requirementsbase.in - # optimum-intel -onnxruntime==1.21.0 - # via -r requirementsbase.in -opencv-python==4.11.0.86 - # via - # -r requirementsbase.in - # ultralytics -opencv-python-headless==4.11.0.86 - # via neural-compressor -openvino==2025.0.0 - # via -r requirementsbase.in -openvino-telemetry==2025.1.0 - # via - # -r requirementsbase.in - # nncf - # openvino -opt-einsum==3.4.0 - # via - # -r requirementsbase.in - # tensorflow -optimum==1.24.0 - # via - # -r requirementsbase.in - # optimum-intel -optimum-intel==1.22.0 - # via -r requirementsbase.in -optree==0.15.0 - # via - # -r requirementsbase.in - # keras -overrides==7.7.0 - # via - # -r requirementsbase.in - # jupyter-server -packaging==24.2 - # via - # -r requirementsbase.in - # build - # datasets - # huggingface-hub - # ipykernel - # jupyter-events - # jupyter-server - # jupyterlab - # jupyterlab-server - # keras - # lazy-loader - # matplotlib - # nbconvert - # nncf - # onnxruntime - # openvino - # optimum - # pooch - # pyinstaller - # pyinstaller-hooks-contrib - # pytest - # scikit-image - # tensorboard - # tensorflow - # transformers - # twine - # wheel -pandas==2.2.3 - # via - # -r requirementsbase.in - # datasets - # neural-compressor - # nncf - # seaborn - # ultralytics -pandocfilters==1.5.1 - # via - # -r requirementsbase.in - # nbconvert -parso==0.8.4 - # via - # -r requirementsbase.in - # jedi -pdfkit==1.0.0 - # via -r requirementsbase.in -pefile==2023.2.7 - # via pyinstaller -pillow==11.1.0 - # via - # -r requirementsbase.in - # diffusers - # imageio - # matplotlib - # neural-compressor - # scikit-image - # torchvision - # ultralytics -platformdirs==4.3.7 - # via - # -r requirementsbase.in - # jupyter-core - # pooch -pluggy==1.5.0 - # via - # -r requirementsbase.in - # pytest -pooch==1.8.2 - # via - # -r requirementsbase.in - # librosa -prettytable==3.16.0 - # via neural-compressor -prometheus-client==0.21.1 - # via - # -r requirementsbase.in - # jupyter-server -prompt-toolkit==3.0.50 - # via - # -r requirementsbase.in - # ipython -propcache==0.3.1 - # via - # aiohttp - # yarl -protobuf==5.29.4 - # via - # -r requirementsbase.in - # onnx - # onnxruntime - # tensorboard - # tensorflow -psutil==7.0.0 - # via - # -r requirementsbase.in - # ipykernel - # neural-compressor - # nncf - # ultralytics -pure-eval==0.2.3 - # via - # -r requirementsbase.in - # stack-data -py-cpuinfo==9.0.0 - # via - # neural-compressor - # nncf - # ultralytics -pyarrow==19.0.1 - # via - # -r requirementsbase.in - # datasets -pyarrow-hotfix==0.6 - # via -r requirementsbase.in -pyasn1==0.6.1 - # via - # -r requirementsbase.in - # pyasn1-modules - # rsa -pyasn1-modules==0.4.2 - # via - # -r requirementsbase.in - # google-auth -pycocotools==2.0.8 - # via neural-compressor -pycparser==2.22 - # via - # -r requirementsbase.in - # cffi -pydot==2.0.0 - # via - # -r requirementsbase.in - # nncf -pygments==2.19.1 - # via - # -r requirementsbase.in - # ipython - # nbconvert - # readme-renderer - # rich -pyinstaller==6.12.0 - # via tensorflow-intel -pyinstaller-hooks-contrib==2025.2 - # via pyinstaller -pymoo==0.6.1.3 - # via - # -r requirementsbase.in - # nncf -pyparsing==3.2.3 - # via - # -r requirementsbase.in - # matplotlib - # pydot -pyproject-hooks==1.2.0 - # via build -pyreadline3==3.5.4 - # via - # -r requirementsbase.in - # humanfriendly -pytest==8.3.5 - # via -r requirementsbase.in -python-dateutil==2.9.0.post0 - # via - # -r requirementsbase.in - # arrow - # jupyter-client - # matplotlib - # pandas -python-json-logger==3.3.0 - # via - # -r requirementsbase.in - # jupyter-events -pytz==2025.2 - # via - # -r requirementsbase.in - # pandas -pywin32==310 - # via - # -r requirementsbase.in - # jupyter-core -pywin32-ctypes==0.2.3 - # via - # keyring - # pyinstaller -pywinpty==2.0.15 - # via - # -r requirementsbase.in - # jupyter-server - # jupyter-server-terminals - # terminado -pyyaml==6.0.2 - # via - # -r requirementsbase.in - # datasets - # huggingface-hub - # jupyter-events - # neural-compressor - # transformers - # ultralytics -pyzmq==26.4.0 - # via - # -r requirementsbase.in - # ipykernel - # jupyter-client - # jupyter-server -rapidfuzz==3.13.0 - # via - # -r requirementsbase.in - # jiwer -readme-renderer==44.0 - # via twine -referencing==0.36.2 - # via - # -r requirementsbase.in - # jsonschema - # jsonschema-specifications - # jupyter-events -regex==2024.11.6 - # via - # -r requirementsbase.in - # diffusers - # transformers -requests==2.32.3 - # via - # -r requirementsbase.in - # datasets - # diffusers - # huggingface-hub - # id - # jupyterlab-server - # neural-compressor - # pooch - # requests-oauthlib - # requests-toolbelt - # tensorflow - # transformers - # twine - # ultralytics -requests-oauthlib==2.0.0 - # via - # -r requirementsbase.in - # google-auth-oauthlib -requests-toolbelt==1.0.0 - # via twine -rfc3339-validator==0.1.4 - # via - # -r requirementsbase.in - # jsonschema - # jupyter-events -rfc3986==2.0.0 - # via twine -rfc3986-validator==0.1.1 - # via - # -r requirementsbase.in - # jsonschema - # jupyter-events -rich==14.0.0 - # via - # -r requirementsbase.in - # keras - # nncf - # twine - # typer -rpds-py==0.24.0 - # via - # -r requirementsbase.in - # jsonschema - # referencing -rsa==4.9 - # via - # -r requirementsbase.in - # google-auth -safetensors==0.5.3 - # via - # -r requirementsbase.in - # diffusers - # nncf - # transformers -schema==0.7.7 - # via neural-compressor -scikit-image==0.25.2 - # via -r requirementsbase.in -scikit-learn==1.6.1 - # via - # -r requirementsbase.in - # librosa - # neural-compressor - # nncf -scipy==1.15.2 - # via - # -r requirementsbase.in - # librosa - # nncf - # optimum-intel - # pymoo - # scikit-image - # scikit-learn - # spicy - # ultralytics -seaborn==0.13.2 - # via - # -r requirementsbase.in - # ultralytics -send2trash==1.8.3 - # via - # -r requirementsbase.in - # jupyter-server -sentencepiece==0.2.0 - # via - # -r requirementsbase.in - # optimum-intel -sentry-sdk==2.25.1 - # via -r requirementsbase.in -shellingham==1.5.4 - # via - # -r requirementsbase.in - # typer -six==1.17.0 - # via - # -r requirementsbase.in - # astunparse - # google-pasta - # python-dateutil - # rfc3339-validator - # tensorboard - # tensorflow -sniffio==1.3.1 - # via - # -r requirementsbase.in - # anyio -soundfile==0.13.1 - # via - # -r requirementsbase.in - # librosa -soupsieve==2.6 - # via - # -r requirementsbase.in - # beautifulsoup4 -soxr==0.5.0.post1 - # via - # -r requirementsbase.in - # librosa -spicy==0.16.0 - # via -r requirementsbase.in -stack-data==0.6.3 - # via - # -r requirementsbase.in - # ipython -sympy==1.13.1 - # via - # -r requirementsbase.in - # onnxruntime - # torch -tabulate==0.9.0 - # via nncf -tbb==2022.1.0 - # via mkl -tcmlib==1.3.0 - # via - # tbb - # umf -tdqm==0.0.1 - # via -r requirementsbase.in -tensorboard==2.19.0 - # via - # -r requirementsbase.in - # tensorflow -tensorboard-data-server==0.7.2 - # via - # -r requirementsbase.in - # tensorboard -tensorflow==2.19.0 - # via - # -r requirementsbase.in - # tf-keras -tensorflow-estimator==2.15.0 - # via -r requirementsbase.in -tensorflow-intel==0.0.1 - # via -r requirementsbase.in -tensorflow-io-gcs-filesystem==0.31.0 - # via - # -r requirementsbase.in - # tensorflow -termcolor==2.3.0 - # via - # -r requirementsbase.in - # tensorflow - # yaspin -terminado==0.18.1 - # via - # -r requirementsbase.in - # jupyter-server - # jupyter-server-terminals -texttable==1.7.0 - # via -r requirementsbase.in -tf-keras==2.19.0 - # via -r requirementsbase.in -thop==0.1.1.post2209072238 - # via -r requirementsbase.in -threadpoolctl==3.6.0 - # via - # -r requirementsbase.in - # scikit-learn -tifffile==2025.3.30 - # via - # -r requirementsbase.in - # scikit-image -tinycss2==1.4.0 - # via - # -r requirementsbase.in - # bleach -tokenizers==0.21.1 - # via - # -r requirementsbase.in - # transformers -tomli==2.2.1 - # via - # -r requirementsbase.in - # build - # jupyterlab - # pytest -torch==2.6.0 - # via - # -r requirementsbase.in - # intel-npu-acceleration-library - # optimum - # optimum-intel - # thop - # torchaudio - # torchvision - # ultralytics - # ultralytics-thop -torchaudio==2.6.0 - # via -r requirementsbase.in -torchvision==0.21.0 - # via - # -r requirementsbase.in - # ultralytics -tornado==6.4.2 - # via - # -r requirementsbase.in - # ipykernel - # jupyter-client - # jupyter-server - # jupyterlab - # terminado -tqdm==4.67.1 - # via - # -r requirementsbase.in - # datasets - # huggingface-hub - # tdqm - # transformers - # ultralytics -traitlets==5.14.3 - # via - # -r requirementsbase.in - # comm - # ipykernel - # ipython - # ipywidgets - # jupyter-client - # jupyter-core - # jupyter-events - # jupyter-server - # jupyterlab - # matplotlib-inline - # nbclient - # nbconvert - # nbformat -transformers==4.48.3 - # via - # -r requirementsbase.in - # intel-npu-acceleration-library - # optimum - # optimum-intel -twine==6.1.0 - # via tensorflow-intel -typer==0.15.2 - # via -r requirementsbase.in -types-python-dateutil==2.9.0.20241206 - # via - # -r requirementsbase.in - # arrow -typing-extensions==4.13.1 - # via - # -r requirementsbase.in - # anyio - # async-lru - # beautifulsoup4 - # huggingface-hub - # ipython - # librosa - # mistune - # multidict - # optree - # referencing - # rich - # tensorflow - # torch - # typer -tzdata==2025.2 - # via - # -r requirementsbase.in - # pandas -ultralytics==8.3.105 - # via -r requirementsbase.in -ultralytics-thop==2.0.14 - # via ultralytics -umf==0.10.0 - # via intel-cmplr-lib-ur -uri-template==1.3.0 - # via - # -r requirementsbase.in - # jsonschema -urllib3==2.3.0 - # via - # -r requirementsbase.in - # requests - # sentry-sdk - # twine -wcwidth==0.2.13 - # via - # -r requirementsbase.in - # prettytable - # prompt-toolkit -webcolors==24.11.1 - # via - # -r requirementsbase.in - # jsonschema -webencodings==0.5.1 - # via - # -r requirementsbase.in - # bleach - # tinycss2 -websocket-client==1.8.0 - # via - # -r requirementsbase.in - # jupyter-server -werkzeug==3.1.3 - # via - # -r requirementsbase.in - # tensorboard -wheel==0.46.1 - # via astunparse -widgetsnbextension==4.0.13 - # via - # -r requirementsbase.in - # ipywidgets -wrapt==1.17.2 - # via - # -r requirementsbase.in - # deprecated - # tensorflow -xxhash==3.5.0 - # via - # -r requirementsbase.in - # datasets -yarl==1.19.0 - # via - # -r requirementsbase.in - # aiohttp -yaspin==3.1.0 - # via -r requirementsbase.in -zipp==3.21.0 - # via - # -r requirementsbase.in - # importlib-metadata - -# The following packages are considered to be unsafe in a requirements file: -# pip -# setuptools diff --git a/Prerequisites/PythonModules/requirementsbase.in b/Prerequisites/PythonModules/requirementsbase.in deleted file mode 100644 index 0f41789..0000000 --- a/Prerequisites/PythonModules/requirementsbase.in +++ /dev/null @@ -1,247 +0,0 @@ -## Copyright (C) 2024 Intel Corporation -## Author: Krishna Lakhotia -## Author: Balasubramanyam Agalukote Lakshmipathi -## -## This software and the related documents are Intel copyrighted materials, and your use of them is -## governed by the express license under which they were provided to you ("License"). Unless the -## License provides otherwise, you may not use, modify, copy, publish, distribute, disclose or -## transmit this software or the related documents without Intel's prior written permission. -## -## This software and the related documents are provided as is, with no express or implied warranties, -## other than those that are expressly stated in the License. - -absl-py -aiohttp -aiosignal -alive-progress -anyio -argon2-cffi -argon2-cffi-bindings -arrow -asttokens -astunparse -async-lru -async-timeout -attrs -audioread -autograd -Babel -beautifulsoup4 -bleach -cachetools -certifi -cffi -charset-normalizer -click -cma -colorama -coloredlogs -comm -contourpy -cycler -datasets -debugpy -decorator -defusedxml -Deprecated -diffusers -dill -exceptiongroup -executing -fastjsonschema -filelock -flatbuffers -fonttools -fqdn -frozenlist -fsspec -future -gast -google-auth -google-auth-oauthlib -google-pasta -grapheme -grpcio -h11 -h5py -httpcore -httpx -huggingface-hub -humanfriendly -idna -imageio -importlib_metadata -iniconfig -intel_npu_acceleration_library -ipykernel -ipython -ipywidgets -isoduration -jedi -Jinja2 -jiwer -jiwer -joblib -json5 -jsonpointer -jsonschema -jsonschema-specifications -jstyleson -jupyter_client -jupyter_core -jupyter_server_terminals -jupyter_server -jupyter-events -jupyterlab_pygments -jupyterlab_server -jupyterlab_widgets -jupyterlab -jupyter-lsp -keras -kiwisolver -lazy_loader -libclang -librosa -llvmlite -Markdown -markdown-it-py -MarkupSafe -matplotlib -matplotlib-inline -mdurl -mistune -mkl -ml-dtypes -mpmath -msgpack -multidict -multiprocess -namex -natsort -nbclient -nbconvert -nbformat -nest-asyncio -networkx -ninja -nncf -notebook_shim -numba -numpy -numpy -oauthlib -onnx -onnxruntime -opencv-python -openvino -## openvino-dev -openvino-telemetry -opt-einsum -optimum -optimum_intel -optree -overrides -packaging -pandas -pandocfilters -parso -pdfkit -pillow -pip -platformdirs -pluggy -pooch -prometheus_client -prompt-toolkit -protobuf -psutil -pure-eval -pyarrow -pyarrow-hotfix -pyasn1 -pyasn1-modules -pycparser -pydot -Pygments -pymoo -pyparsing -pyreadline3 -pytest -python-dateutil -python-json-logger -pytz -pywin32 -pywinpty -PyYAML -pyzmq -rapidfuzz -referencing -regex -requests -requests-oauthlib -rfc3339-validator -rfc3986-validator -rich -rpds-py -rsa -safetensors -scikit-image -scikit-learn -scipy -seaborn -Send2Trash -sentencepiece -sentry-sdk -setuptools -shellingham -six -sniffio -soundfile -soupsieve -soxr -spicy -stack-data -sympy -tdqm -tdqm -tensorboard -tensorboard-data-server -tensorflow -tensorflow-estimator -tensorflow-intel -tensorflow-io-gcs-filesystem -termcolor -terminado -texttable -tf-keras -thop -threadpoolctl -tifffile -tinycss2 -tokenizers -tomli -torch -torchaudio -torchvision -tornado -tqdm -traitlets -transformers -typer -types-python-dateutil -typing_extensions -tzdata -ultralytics -uri-template -urllib3 -wcwidth -webcolors -webencodings -websocket-client -Werkzeug -widgetsnbextension -wrapt -xxhash -yarl -yaspin -zipp diff --git a/README.md b/README.md index d7e0153..2010820 100644 --- a/README.md +++ b/README.md @@ -1,94 +1,3 @@ -# PROJECT NOT UNDER ACTIVE MANAGEMENT -This project will no longer be maintained by Intel. -This project has been identified as having known security escapes. -Intel has ceased development and contributions including, but not limited to, maintenance, bug fixes, new releases, or updates, to this project. -Intel no longer accepts patches to this project. +# New SDK Installer Coming Soon! -# Intel® AI PC Development Kit -#### Version 2024.10.2 -#### October 30 2024 - -## README Contents - -1. [Introduction](#1-introduction) -2. [Requirements](#2-requirements) -3. [Build Instructions](#3-build-instructions) -4. [Installation](#4-installation) -5. [Running Notebooks](#5-running-notebooks) -6. [License Agreement](#6-license-agreement) - -## 1. Introduction - -The Intel® AI PC Development Kit is designed to equip AI developers with a comprehensive suite of tools, libraries, and frameworks necessary for building, training, and deploying AI systems. - -This kit facilitates the entire AI development lifecycle, from data preprocessing and model training to deployment and monitoring. - -This readme file contains information on how to build the installer for the Intel® AI PC Development Kit from the source code. - -## 2. Requirements - -1. **Operating System**: Windows 11. -2. **Internet Connection**: Required. Please include proxy settings as needed. -3. **Python**: Version 3.10.11 installed under `C:\python310` with path variable updated. -4. **System environment variable**: - - `PIP_TRUSTED_HOST= pypi.org files.pythonhosted.org` - -## 3. Build Instructions - -Follow the below steps: -1. Open a command line terminal and clone the repo. - - `git clone https://github.com/intel/aipc-devkit-install.git` -2. Change the working directory to the repo folder `aipc-devkit-install`. -3. Create the Virtual environment with python 3.10 - - If multiple versions of python is installed in the system, use below command - - `py -3.10 -m venv venv` - - If only python 3.10 version is installed in the system, use below command - - `python -3.10 -m venv venv` -4. Activate the Virtual environment - - `.\venv\Scripts\activate` -5. Install "pyinstaller" and "pyinstaller_versionfile" modules (Make sure proxy is included as needed) - - `pip install pyinstaller` - - `pip install pyinstaller_versionfile` -6. Set a version for the Build - - `set BuildVersion=1.1.0.0` -7. Build the installer - - `cd build` - - `Run Build.bat` -8. `installer.exe` and `uninstall.exe` is created under `aipc-devkit-install\dist` folder. - -## 4. Installation - -1. Copy the `installer.exe` and `uninstall.exe` under repo folder `aipc-devkit-install`. -2. Continue with the installation process by following the steps provided in the [Installation_Guide.md](Installation_Guide.md) starting from step 3 of section 4 - **Installation Instructions**. This will guide you through the remaining installation steps to complete installation under `C:\Intel\aipcdevkit`. -3. Once the installation is complete, the AI PC virtual environment will be set up, and Jupyter Notebook will automatically open in your browser. - -## 5. Running Notebooks - -In Jupiter notebooks browser, navigate to one of the following notebooks and run it to verify correct execution (requires internet connection). -- hello-world\hello-world.ipynb -- llm-chatbot\llm-chatbot.ipynb -- yolov8-optimization\yolov8-instance-segmentation.ipynb - -## 6. License Agreement - -Copyright © 2024 Intel Corporation - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in the -Software without restriction, including without limitation the rights to use, copy, -modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, -and to permit persons to whom the Software is furnished to do so, subject to the -following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. +* We are excited to announce that a new SDK installer is currently in development and will be available soon. This new installer aims to enhance the user experience by providing a more streamlined and efficient installation process. \ No newline at end of file diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index cb59eb8..0000000 --- a/SECURITY.md +++ /dev/null @@ -1,5 +0,0 @@ -# Security Policy -Intel is committed to rapidly addressing security vulnerabilities affecting our customers and providing clear guidance on the solution, impact, severity and mitigation. - -## Reporting a Vulnerability -Please report any security vulnerabilities in this project utilizing the guidelines [here](https://www.intel.com/content/www/us/en/security-center/vulnerability-handling-guidelines.html). diff --git a/Script/__init__.py b/Script/__init__.py deleted file mode 100644 index 8dd85f0..0000000 --- a/Script/__init__.py +++ /dev/null @@ -1,11 +0,0 @@ -## Copyright (C) 2024 Intel Corporation -## Author: Krishna Lakhotia -## Author: Balasubramanyam Agalukote Lakshmipathi -## -## This software and the related documents are Intel copyrighted materials, and your use of them is -## governed by the express license under which they were provided to you ("License"). Unless the -## License provides otherwise, you may not use, modify, copy, publish, distribute, disclose or -## transmit this software or the related documents without Intel's prior written permission. -## -## This software and the related documents are provided as is, with no express or implied warranties, -## other than those that are expressly stated in the License. diff --git a/Script/installer.py b/Script/installer.py deleted file mode 100644 index 9ba1faf..0000000 --- a/Script/installer.py +++ /dev/null @@ -1,1648 +0,0 @@ -## Copyright (C) 2024 Intel Corporation -## Author: Krishna Lakhotia -## Author: Balasubramanyam Agalukote Lakshmipathi -## -## This software and the related documents are Intel copyrighted materials, and your use of them is -## governed by the express license under which they were provided to you ("License"). Unless the -## License provides otherwise, you may not use, modify, copy, publish, distribute, disclose or -## transmit this software or the related documents without Intel's prior written permission. -## -## This software and the related documents are provided as is, with no express or implied warranties, -## other than those that are expressly stated in the License. - -import argparse -import subprocess -import os -import sys -import logging -import shutil -import json -import winreg -import string -import time -from winreg import KEY_WOW64_32KEY, KEY_WOW64_64KEY, KEY_READ -from typing import Dict, List, Any, Tuple -import ctypes -import warnings -import re -from abc import ABC, abstractmethod -import shlex -from urllib.request import urlopen, Request -from urllib.error import URLError, HTTPError -import ssl -from hashlib import sha256 -from zipfile import ZipFile, ZipInfo, ZIP_STORED -from version import VERSION -import contextlib - -with warnings.catch_warnings(): - warnings.filterwarnings("ignore", category=DeprecationWarning) - from pkg_resources import parse_version -from dataclasses import dataclass, field - -# This is to check if running from a bundle(exe created from pyinstaller) or as python script -if getattr(sys, "frozen", False) and hasattr(sys, "_MEIPASS"): - EXE_PATH = sys._MEIPASS - CURRENT_DIR_PATH = os.path.dirname(sys.executable) - FILE_NAME = os.path.basename(sys.executable) - CALLER_COMMAND = sys.executable -else: - CURRENT_DIR_PATH = os.path.dirname(os.path.realpath(__file__)) - EXE_PATH = CURRENT_DIR_PATH - FILE_NAME = os.path.basename(__file__) - CALLER_COMMAND = f"{sys.executable} {__file__}" - -configuration_file = os.path.join(EXE_PATH, "installation_config.json") -if not os.path.isfile(configuration_file): - logging.error(f"The configuration file: {configuration_file} does not exist") - sys.exit(1) - -with open(configuration_file, "r") as config_file: - configurations = json.load(config_file) - -default_paths = configurations.get("default_paths", {}) -logger = logging.getLogger() - - -def remove_unwanted_characters(line: str): - printable = set(string.printable) - return "".join(filter(lambda x: x in printable, line)) - - -def split_command(command: str): - new_command = [] - if command.startswith(('"', "'", "MsiExec.exe")): - new_command = shlex.split(command) - else: - new_command = [command] - - return new_command - - -@dataclass -class Installation: - installers_dir_path: str - installer_path: str - installer_exe: str - install_flags: List[str] = field(default_factory=list) - install_command: List[str] = field(default_factory=list) - quiteinstall_flags: List[str] = field(default_factory=list) - download_url: str = field(default="") - online: bool = field(default=False) - checksum: str = field(default="") - max_file_size: int = field(default=1024 * 1024 * 1024) - - def identify_installer_exe(self, log_error: bool = True): - """ - The installer_exe can be in a subdirectory under installer_path. - Need to get the exact installer path - """ - exe_path = None - installer_path = get_absolute_path(self.installers_dir_path, self.installer_path) - exe_path = find_file_in_directory(installer_path, self.installer_exe) - if not exe_path: - if log_error: - logger.error(f"Failed to locate the executable: {self.installer_exe}") - - return exe_path - - def get_install_command(self, log_option: List[str] = None, silent: bool = False): - install_command = self.install_command - exe_path = self.identify_installer_exe(log_error=False) - if not (exe_path and verify_checksum(exe_path, self.checksum)): - download_file( - self.installers_dir_path, - self.installer_path, - self.installer_exe, - self.online, - self.download_url, - self.max_file_size, - ) - exe_path = self.identify_installer_exe() - if not exe_path: - return None - if not verify_checksum(exe_path, self.checksum): - logger.error("The checksum of the file is not valid") - return None - install_command.append(exe_path) - if silent: - install_command.extend(self.quiteinstall_flags) - else: - install_command.extend(self.install_flags) - - if log_option: - install_command.extend(log_option) - - return install_command - - -@dataclass -class ArchiveInstallation: - installers_dir_path: str - installation_dir: str - source_path: str - source_file: str - destination_dir: str - members: List[str] = field(default=None) - download_url: str = field(default="") - online: bool = field(default=False) - checksum: str = field(default="") - max_file_size: int = field(default=1024 * 1024 * 1024) - skip_top_dir: bool = field(default=False) - - def identify_archive(self, log_error: bool = True): - """ - The archive can be in a subdirectory under source_path. - Need to get the exact archive path - """ - archive_path = None - installer_path = get_absolute_path(self.installers_dir_path, self.source_path) - archive_path = find_file_in_directory(installer_path, self.source_file) - if not archive_path: - if log_error: - logger.error(f"Failed to locate the archive: {self.source_file}") - - return archive_path - - def verify_archive(self): - archive_file = self.identify_archive(log_error=False) - if not (archive_file and verify_checksum(archive_file, self.checksum)): - download_file( - self.installers_dir_path, - self.source_path, - self.source_file, - self.online, - self.download_url, - self.max_file_size, - ) - archive_file = self.identify_archive() - if not archive_file: - return None - if not verify_checksum(archive_file, self.checksum): - logger.error("The checksum of the file is not valid") - return None - - return archive_file - - def get_destination_path(self): - return get_absolute_path(self.installation_dir, self.destination_dir) - - -@dataclass -class Logs: - logs_dir: str - file_name: str = field(default="install.log") - option: str = field(default="") - - def get_log_option(self): - if not self.option: - return [] - if self.option.endswith("="): - log_option = [self.option.strip() + self.get_log_file()] - else: - log_option = [self.option.strip(), self.get_log_file()] - return log_option - - def get_log_file(self): - return get_absolute_path(self.logs_dir, self.file_name.strip()) - - -class CmdVersionIdentifier: - def __init__(self, name: str, command: List[str] = None, options: List[str] = None, delimeter: str = " ") -> None: - self.name = name - self.command = command - self.additional_options = options - self.delimeter = delimeter - - def get_version_from_command(self): - if not self.command: - return None - cmd = self.command - if self.additional_options: - cmd.extend(self.additional_options) - try: - result = subprocess.check_output(cmd, text=True, encoding="utf-8").splitlines()[0] - return result.strip().split(self.delimeter)[-1].strip() - except (subprocess.CalledProcessError, FileNotFoundError, IndexError): - pass - return None - - -class CMakeCmdVersionIdentifier(CmdVersionIdentifier): - def __init__(self, name: str, command: List[str] = None, options: List[str] = None, delimeter: str = " ") -> None: - super().__init__(name, command, options, delimeter) - - -class PrecheckBase(ABC): - def __init__(self, name: str, desired_version: str, exact_match: bool = False) -> None: - self.name = name - self.desired_version = desired_version - self.exact_match = exact_match - - def desired_version_installed(self, installed_versions: List[str]): - if not installed_versions: - return False - installed_versions = list(map(parse_version, installed_versions)) - desired_version = parse_version(self.desired_version) - if self.exact_match: - return desired_version in installed_versions - return any(version >= desired_version for version in installed_versions) - - @abstractmethod - def enabled(self) -> bool: - pass - - @abstractmethod - def versions_found(self) -> Tuple[bool, List[str]]: - pass - - -class RegistryQuery: - def __init__(self, hkey: str = winreg.HKEY_LOCAL_MACHINE) -> None: - self.hkey = hkey - - def get_values(self, registry_key_path: str, names: List[str] = None, arch_key: int = 0): - values = {} - try: - with winreg.OpenKey(self.hkey, registry_key_path, 0, access=KEY_READ | arch_key) as reg_key: - if not names: - names = [winreg.EnumValue(reg_key, index)[0] for index in range(winreg.QueryInfoKey(reg_key)[1])] - for name in names: - try: - value, _ = winreg.QueryValueEx(reg_key, name) - values[name] = value - except (FileNotFoundError, OSError, KeyError, WindowsError, TypeError): - pass - except WindowsError: - pass - except Exception as e: - logger.error(f"get_values: An error occurred while checking the registry: {e}") - return values - - def get_values_from_subkeys(self, registry_key_path: str, names: List[str] = None, arch_key: int = 0): - combined_values = {} - try: - with winreg.OpenKey(self.hkey, registry_key_path, 0, access=KEY_READ | arch_key) as reg_key: - sub_key_count, _, _ = winreg.QueryInfoKey(reg_key) - for index in range(sub_key_count): - try: - key_name = winreg.EnumKey(reg_key, index) - sub_key_path = f"{registry_key_path}\\{key_name}" - values = self.get_values(sub_key_path, names, arch_key) - if values: - combined_values[sub_key_path] = values - except (OSError, KeyError): - pass - except (FileNotFoundError, OSError, WindowsError): - pass - except Exception as e: - logger.error(f"get_values_from_subkeys: An error occurred while checking the registry: {e}") - - return combined_values - - def get_32_64_arch_values(self, registry_key_path: str, include_sub_keys: bool = False, names: List[str] = None): - combined_values = {} - for arch_key in [KEY_WOW64_64KEY, KEY_WOW64_32KEY]: - if include_sub_keys: - combined_values.update(self.get_values_from_subkeys(registry_key_path, names=names, arch_key=arch_key)) - else: - if not registry_key_path in combined_values: - combined_values[registry_key_path] = {} - combined_values[registry_key_path].update( - self.get_values(registry_key_path, names=names, arch_key=arch_key) - ) - - return combined_values - - -def get_installed_programs(registry_key_path: str = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall"): - installed = {} - hkeys = [winreg.HKEY_LOCAL_MACHINE, winreg.HKEY_CURRENT_USER] - for hkey in hkeys: - registry = RegistryQuery(hkey) - for _, values in registry.get_32_64_arch_values( - registry_key_path=registry_key_path, include_sub_keys=True - ).items(): - name, value = values.get("DisplayName"), values.get("DisplayVersion") - if name and value: - name = remove_unwanted_characters(name).casefold().strip() - if name not in installed: - installed[name] = [] - installed[name].append(values) - - return installed - - -def get_registry_value(registry_key_path: str, name: str): - values_found = [] - hkeys = [winreg.HKEY_LOCAL_MACHINE] - for hkey in hkeys: - registry = RegistryQuery(hkey) - for _, values in registry.get_32_64_arch_values( - registry_key_path=registry_key_path, include_sub_keys=False, names=[name] - ).items(): - registry_value = values.get(name) - if registry_value: - values_found.append(registry_value) - - return values_found - - -class RegistryPrecheck(PrecheckBase): - def __init__( - self, - name: str, - desired_version: str, - registry_keys: List[str] = None, - registry_value: str = None, - check_name_in_installed_softwares: str = None, - exact_match: bool = False, - ) -> None: - self.registry_keys = registry_keys - if not self.registry_keys: - self.registry_keys = [] - self.registry_value = registry_value - self.check_name = check_name_in_installed_softwares - super().__init__(name, desired_version, exact_match) - - def find_in_installed_softwares(self, **kwargs): - versions = [] - if not self.check_name: - return versions - entries = current_installed_softwares.get(self.check_name.strip().casefold(), []) - if kwargs: - entries = [entry for entry in entries if all((entry.get(key) == value) for key, value in kwargs.items())] - if entries: - versions = [entry.get(self.registry_value) for entry in entries if entry.get(self.registry_value)] - return versions - - def enabled(self): - if self.registry_value and (self.registry_keys or self.check_name): - return True - return False - - def get_registry_entries(self, **kwargs): - registry_entries = [] - registry_entries.extend(self.find_in_installed_softwares(**kwargs)) - for registry_key in self.registry_keys: - registry_entries.extend(get_registry_value(registry_key_path=registry_key, name=self.registry_value)) - return registry_entries - - def versions_found(self): - registry_entries = self.get_registry_entries() - return self.desired_version_installed(registry_entries), registry_entries - - -class CommandPrecheck(PrecheckBase): - def __init__( - self, - name: str, - desired_version: str, - command: List[str] = None, - options: List[str] = None, - delimeter: str = " ", - exact_match: bool = False, - ) -> None: - self.command = command - self.delimeter = delimeter - self.options = options - super().__init__(name, desired_version, exact_match) - common_args = {"name": self.name, "command": self.command, "options": self.options, "delimeter": self.delimeter} - self.version_identifiers = {"default": CmdVersionIdentifier(**common_args)} - - def get_version(self): - version_identifier = self.version_identifiers.get( - self.name.strip().casefold(), self.version_identifiers["default"] - ) - return version_identifier.get_version_from_command() - - def enabled(self): - return True if self.command else False - - def versions_found(self): - cmd_versions_found = [] - cmd_version = self.get_version() - if cmd_version: - cmd_versions_found.append(cmd_version) - return self.desired_version_installed(cmd_versions_found), cmd_versions_found - - -class DirectoryPrecheck(PrecheckBase): - def __init__( - self, - name: str, - desired_version: str, - file_paths: List[str] = None, - any_path: bool = False, - exact_match: bool = False, - ) -> None: - self.file_paths = file_paths - self.any_path = any_path - super().__init__(name, desired_version, exact_match) - - def path_exists(self): - if not self.file_paths: - return False - if self.any_path: - return any(os.path.exists(file_path) for file_path in self.file_paths) - return all(os.path.exists(file_path) for file_path in self.file_paths) - - def enabled(self): - return True if self.file_paths else False - - def versions_found(self): - dir_versions_found = [] - if self.path_exists(): - dir_versions_found.append(self.desired_version) - return self.desired_version_installed(dir_versions_found), dir_versions_found - - -class RegistryDirPrecheck(RegistryPrecheck): - def __init__( - self, - name: str, - desired_version: str, - registry_keys: List[str] = None, - registry_value: str = None, - check_name_in_installed_softwares: str = None, - append_path: str = None, - exact_match: bool = False, - ) -> None: - self.append_path = append_path - super().__init__( - name, desired_version, registry_keys, registry_value, check_name_in_installed_softwares, exact_match - ) - - def path_check(self): - exe_paths = self.get_registry_entries() - if self.append_path: - exe_paths = [get_absolute_path(exe_path.rstrip("\\"), self.append_path) for exe_path in exe_paths] - return exe_paths - - def versions_found(self): - return DirectoryPrecheck( - name=self.name, desired_version=self.desired_version, file_paths=self.path_check(), any_path=True - ).versions_found() - - -class RegistryCmdPrecheck(RegistryDirPrecheck): - def __init__( - self, - name: str, - desired_version: str, - registry_keys: List[str] = None, - registry_value: str = None, - check_name_in_installed_softwares: str = None, - append_path: str = None, - command_options: List[str] = None, - exact_match: bool = False, - ) -> None: - self.command_options = command_options - super().__init__( - name, - desired_version, - registry_keys, - registry_value, - check_name_in_installed_softwares, - append_path, - exact_match, - ) - - def versions_found(self): - found_desired = False - found_versions = [] - exe_paths = self.path_check() - for exe_path in exe_paths: - found, versions = CommandPrecheck( - name=self.name, desired_version=self.desired_version, command=[exe_path], options=self.command_options - ).versions_found() - found_desired |= found - found_versions.extend(versions) - return found_desired, found_versions - - -class Prechecks: - _supported = { - "registry": RegistryPrecheck, - "command_check": CommandPrecheck, - "directory_check": DirectoryPrecheck, - "registry_cmd_check": RegistryCmdPrecheck, - "registry_dir_check": RegistryDirPrecheck, - } - - def __init__(self, name: str, desired_version: str, checks: Dict[str, Any]) -> None: - self.desired_version = desired_version - self.verify_prechecks = [] - for precheck, precheck_class in Prechecks._supported.items(): - self.verify_prechecks.append( - precheck_class(name=name, desired_version=self.desired_version, **checks.get(precheck, {})) - ) - - def versions_found(self): - found = True - all_versions = [] - for precheck in self.verify_prechecks: - if precheck.enabled(): - success, versions_found = precheck.versions_found() - found &= success - all_versions.extend(versions_found) - - return found, set(all_versions) - - -@dataclass -class UnInstallation: - name: str - installers_dir_path: str - desired_version: str - all_versions: bool = False - command: Dict[str, str] = field(default_factory=dict) - registry: Dict[str, str] = field(default_factory=dict) - - def identify_installer_exe(self, installer_path: str, installer_exe: str): - """ - The installer_exe can be in a subdirectory under installer_path. - Need to get the exact installer path - """ - exe_path = None - installer_path = get_absolute_path(self.installers_dir_path, installer_path) - exe_path = find_file_in_directory(installer_path, installer_exe) - if not exe_path: - logger.error(f"Failed to locate the executable: {installer_exe}") - - return exe_path - - def uninstallation_command_from_exe(self, log_option: List[str] = None, silent: bool = False): - uninstall_command = self.command.get("uninstall_command", []) - installer_path = self.command.get("installer_path", "") - installer_exe = self.command.get("installer_exe", "") - uninstall_flags = self.command.get("uninstall_flags", []) - silent_uninstall_flags = self.command.get("quiteuninstall_flags", []) - exe_path = None - if installer_exe: - exe_path = self.identify_installer_exe(installer_path, installer_exe) - if not exe_path: - return None - uninstall_command.append(exe_path) - if silent: - uninstall_command.extend(silent_uninstall_flags) - else: - uninstall_command.extend(uninstall_flags) - - if log_option: - uninstall_command.extend(log_option) - - return [uninstall_command] - - def uninstallation_command_from_registry(self, log_option: List[str] = None, silent: bool = False): - commands = [] - entries = [] - check_names = self.registry.get("check_name_in_installed_softwares", []) - registry_value = self.registry.get("registry_value", "UninstallString") - uninstall_flags = self.registry.get("uninstall_flags", []) - silent_uninstall_flags = self.registry.get("quiteuninstall_flags", []) - registry_keys = self.registry.get("registry_keys", []) - if not check_names: - entries = RegistryPrecheck( - name=self.name, - desired_version=self.desired_version, - registry_keys=registry_keys, - registry_value=registry_value, - exact_match=True, - ).get_registry_entries() - else: - for check_name in check_names: - all_versions_found = [check_name.get("version", self.desired_version)] - if self.all_versions: - all_versions_found = RegistryPrecheck( - name=check_name["name"], - desired_version=check_name.get("version", self.desired_version), - registry_keys=registry_keys, - registry_value="DisplayVersion", - check_name_in_installed_softwares=check_name["name"], - exact_match=not self.all_versions, - ).get_registry_entries() - for version in set(all_versions_found): - uninstall_entries = RegistryPrecheck( - name=check_name["name"], - desired_version=version, - registry_keys=registry_keys, - registry_value=registry_value, - check_name_in_installed_softwares=check_name["name"], - exact_match=True, - ).get_registry_entries(DisplayVersion=version) - entries.extend(uninstall_entries) - for entry in set(entries): - command = split_command(entry) - if silent: - command.extend(silent_uninstall_flags) - else: - command.extend(uninstall_flags) - if log_option: - command.extend(log_option) - commands.append(command) - return commands - - def get_uninstallation_command(self, log_option: List[str] = None, silent: bool = False): - uninstall_commands = [] - if self.command: - uninstall_commands = self.uninstallation_command_from_exe(log_option, silent) - elif self.registry: - uninstall_commands = self.uninstallation_command_from_registry(log_option, silent) - return uninstall_commands - - -class PostInstall: - def __init__( - self, workspace: str, command: List[str], run_on_file_contents: str = "", fallback_command: List[str] = None - ) -> None: - self.workspace = workspace - self.command = command - self.run_on_file_contents = run_on_file_contents - self.fallback_command = fallback_command - - def run(self, line: str = None): - success = True - error = "" - exec_cmd = self.command - exec_fallback_cmd = self.fallback_command if self.fallback_command else [] - if line: - exec_cmd = exec_cmd + [line] - exec_fallback_cmd = exec_fallback_cmd + [line] if exec_fallback_cmd else [] - try: - subprocess.run(exec_cmd, check=True, cwd=self.workspace) - except (subprocess.CalledProcessError, FileNotFoundError) as ex: - error = str(ex) - if exec_fallback_cmd: - try: - subprocess.run(exec_fallback_cmd, check=True, cwd=self.workspace) - except (subprocess.CalledProcessError, FileNotFoundError) as ex: - error = str(ex) - success = False - else: - success = False - - return success, error - - def postprocess(self): - logger.info("Running Post-install ...") - success = True - if self.run_on_file_contents: - file_path = find_file_in_directory(self.workspace, self.run_on_file_contents) - if not file_path: - error = f"The file does not exist: {self.run_on_file_contents}" - return False, error - with open(file_path, "r", encoding="utf-8") as in_file: - lines = json.load(in_file) - for line in lines: - line = line.strip() - if line: - ret, error = self.run(find_file_in_directory(self.workspace, line)) - success &= ret - else: - success, error = self.run() - if not success: - logger.error(f"Post install commands failed") - return success, error - - -class SoftwareInstall: - def __init__( - self, - software: Dict[str, str], - installers_dir_path: str, - logs_dir: str, - silent: bool = False, - force_reinstall: bool = False, - online: bool = False, - ) -> None: - self.logs_dir = logs_dir - self.installers_dir_path = installers_dir_path - self.silent = silent - self.force_reinstall = force_reinstall - os.makedirs(self.logs_dir, exist_ok=True) - self.name = software["name"] - self.desired_version = software.get("target_version", "") - self.installation = Installation( - installers_dir_path=installers_dir_path, online=online, **software["installation"] - ) - self.prechecks = Prechecks(self.name, self.desired_version, software.get("prechecks", {})) - self.logs = Logs(logs_dir=self.logs_dir, **software.get("logs", {})) - self.post_install = software.get("post_install", []) - self.installer_path = get_absolute_path(self.installers_dir_path, self.installation.installer_path) - - # Function to compare software versions - def upgrade_required(self, installed_versions: List[str]): - if not installed_versions: - return False - return all(parse_version(version) < parse_version(self.desired_version) for version in installed_versions) - - def install_required(self): - logger.info(f"Installing {self.name} ...") - if self.force_reinstall: - return True - desired_version_found, versions_found = self.prechecks.versions_found() - if desired_version_found: - logger.info(f"The desired/higher version is already installed for {self.name}: {versions_found}") - return False - if self.upgrade_required(versions_found): - logger.info(f"Older version of {self.name} found. Upgrading to the version: {self.desired_version}") - - return True - - # Function to install software - def install(self): - if not self.install_required(): - return True - install_command = self.installation.get_install_command( - log_option=self.logs.get_log_option(), silent=self.silent - ) - if not install_command: - logger.error(f"Installation failed for {self.name}") - return False - # logger.debug(f"Installation command: {install_command}") - try: - subprocess.run(install_command, text=True, encoding="utf-8", check=True, cwd=self.installer_path) - if not self.post_process(): - return False - logger.info(f"Installation completed successfully for {self.name}.") - return True - except subprocess.CalledProcessError: - logger.error(f"Installation failed for {self.name}") - logger.error(f"Please check the logs for more details: {self.logs.get_log_file()}") - - return False - - def post_process(self): - success = True - for post_cmd in self.post_install: - post_install = PostInstall(workspace=self.installer_path, **post_cmd) - ret, _ = post_install.postprocess() - success &= ret - return success - - -class SoftwareUninstall: - def __init__(self, software: Dict[str, str], installers_dir_path: str, logs_dir: str, silent: bool = False): - self.logs_dir = logs_dir - self.installers_dir_path = installers_dir_path - os.makedirs(self.logs_dir, exist_ok=True) - self.name = software["name"] - self.desired_version = software.get("target_version", "") - self.uninstallation_spec = software.get("uninstallation", {}) - self.uninstallation = UnInstallation( - name=self.name, - installers_dir_path=installers_dir_path, - desired_version=self.desired_version, - **self.uninstallation_spec, - ) - self.exact_match = self.uninstallation.all_versions is False - prechecks = { - key: {**value, **{"exact_match": self.exact_match}} for key, value in software.get("prechecks", {}).items() - } - self.prechecks = Prechecks(self.name, self.desired_version, prechecks) - self.logs = Logs(logs_dir=self.logs_dir, **software.get("logs", {})) - self.silent = silent - - def uninstall_required(self): - if not self.uninstallation_spec: - return False - logger.info(f"Un-Installing {self.name} ...") - desired_version_found, versions_found = self.prechecks.versions_found() - if self.exact_match and desired_version_found: - return True - if not self.exact_match and versions_found: - return True - logger.info(f"The version is not installed on the system for {self.name}: {self.desired_version}") - - return False - - def uninstall(self): - ret = True - if not self.uninstall_required(): - return True - uninstall_commands = self.uninstallation.get_uninstallation_command( - log_option=self.logs.get_log_option(), silent=self.silent - ) - if not uninstall_commands: - logger.error(f"Un-Installation command not found for: {self.name}") - return False - for uninstall_command in uninstall_commands: - try: - subprocess.run(uninstall_command, text=True, encoding="utf-8", check=True) - except subprocess.CalledProcessError: - logger.error(f"Un-Installation failed for {self.name}. Command: {uninstall_command}") - logger.error(f"Please check the logs for more details: {self.logs.get_log_file()}") - ret &= False - except FileNotFoundError: - logger.error(f"Un-Installation failed for {self.name}") - logger.error(f"Could not locate the uninstaller: {uninstall_command}") - ret &= False - - if ret: - logger.info(f"Un-Installation completed successfully for {self.name}.") - return ret - - -class ArchiveInstall: - def __init__( - self, - archive: Dict[str, str], - installers_dir_path: str, - installation_dir: str, - force_reinstall: bool = False, - online: bool = False, - ) -> None: - self.installers_dir_path = installers_dir_path - self.installation_dir = installation_dir - self.force_reinstall = force_reinstall - self.online = online - self.name = archive["name"] - self.desired_version = archive.get("target_version", "") - self.archive = ArchiveInstallation( - installers_dir_path=self.installers_dir_path, - installation_dir=self.installation_dir, - online=self.online, - **archive["installation"], - ) - - def unarchive(self): - logger.info(f"Installing package for {self.name}") - archive_path = self.archive.verify_archive() - if not archive_path: - logger.error("Archive path not found") - return False - - if self.archive.skip_top_dir: - return unzip_file_skip_topdir( - archive_path, self.archive.get_destination_path(), self.archive.members, self.force_reinstall - ) - - return unzip_file(archive_path, self.archive.get_destination_path(), self.archive.members, self.force_reinstall) - - -class BatchFileCreation: - def __init__(self, workspace: str, file_path: str, file_name: str = "AIDevKit.bat") -> None: - self.workspace = workspace - self.file_path = get_absolute_path(workspace, file_path) - self.file_name = get_absolute_path(self.file_path, file_name) - - def create_empty(self): - with open(self.file_name, "w", encoding="UTF-8") as infile: - infile.write("@echo off") - - def add_line(self, line: str): - with open(self.file_name, "a+", encoding="UTF-8") as infile: - infile.write(f"\n\n") - infile.write(line) - - def add_bat_file_call(self, bat_file: str): - with open(self.file_name, "a+", encoding="UTF-8") as infile: - infile.write(f"\n\n") - infile.write( - f'IF NOT EXIST "{bat_file}" echo Please setup the environment using {os.path.join(CURRENT_DIR_PATH, FILE_NAME)} && exit /b 0' - ) - infile.write(f'\nCALL "{bat_file}"\n') - - def run_file(self): - command = [self.file_name] - subprocess.run(command, cwd=self.file_path, check=True) - - def remove_file(self): - try: - os.remove(self.file_name) - except (OSError, FileNotFoundError): - pass - - -class SoftwaresToInstall: - def __init__(self, softwares: List = None) -> None: - self.softwares = softwares - if not softwares: - self.softwares = configurations.get("software_installations", []) - - def get_by_name(self, name: str): - for software in self.softwares: - if software.get("name", "").casefold() == name.casefold(): - return software - return None - - def get_list(self, software_names: List[str] = None): - softwares_list = [] - if not software_names: - return self.softwares - for name in software_names: - software = self.get_by_name(name=name) - if software: - softwares_list.append(software) - return softwares_list - - def names(self): - return [software["name"] for software in self.softwares] - - -# This class is not being used currently -# Would enable this in the next release to add dependency between softwares to be installed -class SoftwaresWithDependency(SoftwaresToInstall): - def __init__(self, softwares: List = None, software_names: List[str] = None) -> None: - self.software_names = software_names - super().__init__(softwares) - if not software_names: - self.software_names = self.names() - self.dependency_list = [] - - def find_item(self, name: str): - return name in self.dependency_list - - def add_dependencies(self, depends_on: List[str] = None): - if not depends_on: - depends_on = [] - for name in depends_on: - if self.find_item(name): - continue - dependent_sw = self.get_by_name(name) - if dependent_sw: - self.add_dependencies(dependent_sw.get("depends_on", [])) - self.dependency_list.append(name) - - def get_dependency_list(self): - for name in self.software_names: - sw = self.get_by_name(name=name) - if sw: - self.add_dependencies(sw.get("depends_on", [])) - self.dependency_list.append(name) - return self.dependency_list - - def get_ordered_list(self): - ordered_softwares = self.get_dependency_list() - return self.get_list(ordered_softwares) - - -class ZipFileExactPath(ZipFile): - def __init__( - self, file, mode="r", compression=ZIP_STORED, allowZip64=True, compresslevel=None, *, strict_timestamps=True - ) -> None: - super().__init__(file, mode, compression, allowZip64, compresslevel, strict_timestamps=strict_timestamps) - - def _extract_member(self, member, targetpath, pwd): - """Extract the ZipInfo object 'member' to a physical - file on the path targetpath. - """ - if not isinstance(member, ZipInfo): - member = self.getinfo(member) - - # build the destination pathname, replacing - # forward slashes to platform specific separators. - arcname = member.filename.replace("/", os.path.sep) - - if os.path.altsep: - arcname = arcname.replace(os.path.altsep, os.path.sep) - # interpret absolute pathname as relative, remove drive letter or - # UNC path, redundant separators, "." and ".." components. - arcname = os.path.splitdrive(arcname)[1] - invalid_path_parts = ("", os.path.curdir, os.path.pardir) - arcname = os.path.sep.join(x for x in arcname.split(os.path.sep) if x not in invalid_path_parts) - if os.path.sep == "\\": - # filter illegal characters on Windows - arcname = self._sanitize_windows_name(arcname, os.path.sep) - - # Commenting this line to unzip the member to exact targetpath - # targetpath = os.path.join(targetpath, arcname) - targetpath = os.path.normpath(targetpath) - - # Create all upper directories if necessary. - upperdirs = os.path.dirname(targetpath) - if upperdirs and not os.path.exists(upperdirs): - os.makedirs(upperdirs) - - if member.is_dir(): - if not os.path.isdir(targetpath): - os.mkdir(targetpath) - return targetpath - - with self.open(member, pwd=pwd) as source, open(targetpath, "wb") as target: - shutil.copyfileobj(source, target) - - return targetpath - - -current_installed_softwares = get_installed_programs() - - -def download_file( - installers_dir_path: str, - installer_path: str, - installer_exe: str, - online: bool = False, - download_url: str = None, - max_file_size=1024 * 1024 * 1024, -): - if not online or not download_url or not download_url.casefold().startswith("http"): - return None - installer_path = get_absolute_path(installers_dir_path, installer_path) - os.makedirs(installer_path, exist_ok=True) - file_path = os.path.join(installer_path, installer_exe) - ssl_file = os.getenv("SSL_CA_CERTIFICATE_FILE", None) - ssl_path = os.getenv("SSL_CA_CERTIFICATES_PATH", None) - ctx = ssl.create_default_context(cafile=ssl_file, capath=ssl_path) - if not (ssl_file or ssl_path): - ctx.check_hostname = False - ctx.verify_mode = ssl.CERT_NONE - try: - logger.info(f"Downloading the file: {download_url}") - req = Request(url=download_url) - with contextlib.closing(urlopen(req, context=ctx, timeout=300)) as response: - file_size = response.getheader("Content-Length") - if file_size and int(file_size) > int(max_file_size): - logger.error(f"File size exceeds the limit: {max_file_size} bytes") - return None - - if response.status in (200, 201): - bs = 1024 * 1024 - with open(file_path, mode="wb") as exe_file: - while block := response.read(bs): - exe_file.write(block) - else: - logger.error(f"Failed to connect to: {download_url}") - return None - except (URLError, HTTPError, TimeoutError) as ex: - logger.error(f"Failed to download the file from {download_url}: {str(ex)}") - return None - - return file_path - - -def verify_checksum(file_path: str, checksum: str = None): - if not checksum: - return True - with open(file_path, mode="rb") as fd: - return checksum == sha256(fd.read(), usedforsecurity=False).hexdigest() - - -def find_file_in_directory(search_dir: str, file_to_search: str): - search_dir = os.path.dirname(get_absolute_path(search_dir, file_to_search)) - file_to_search = os.path.basename(file_to_search) - for root, _, files in os.walk(search_dir): - for file_name in files: - if os.path.basename(file_name).casefold() == file_to_search.casefold(): - file_path = get_absolute_path(root, file_name) - return file_path - - return None - - -def get_python_path(): - default_python_path = default_paths.get("default_python_path") - if default_python_path and os.path.isfile(default_python_path): - return default_python_path - - return "python" - - -def isUserAdmin(): - try: - return ctypes.windll.shell32.IsUserAnAdmin() - except: - return False - - -def members_to_extract_with_dest(zip_ref: ZipFile, members: List[Dict[str, str]] = None): - namelist = zip_ref.namelist() - - def get_dest_path(member: str, replace_str: str): - path_with_exclude_dir = member.replace(replace_str, "", 1).replace("/", os.path.sep) - if os.path.altsep: - path_with_exclude_dir = path_with_exclude_dir.replace(os.path.altsep, os.path.sep) - return path_with_exclude_dir if path_with_exclude_dir else None - - if not members: - return [{"src": member, "dest": get_dest_path(member, namelist[0])} for member in namelist] - - extract_members = [] - for member in members: - replace_str = namelist[0] - member_path = member["path"] - keep_only_base = member.get("keep_only_base", False) - if keep_only_base: - replace_str = os.path.dirname(member_path.rstrip("/")) + "/" - if member_path.endswith("/"): # Include contents of the directory - extract_members.extend( - [ - {"src": mem, "dest": get_dest_path(mem, replace_str)} - for mem in namelist - if mem.startswith(member_path) - ] - ) - else: - extract_members.append({"src": member_path, "dest": get_dest_path(member_path, replace_str)}) - - return extract_members - - -def members_to_extract(zip_ref: ZipFile, members: List[str] = None): - namelist = zip_ref.namelist() - extract_members = [] - if not members: - extract_members = namelist - else: - for member in members: - if member.endswith("/"): # Include contents of the directory - extract_members.extend([name for name in namelist if name.startswith(member)]) - else: - extract_members.append(member) - return list(set(extract_members)) - - -def unzip_file(source_file: str, destination_dir: str, members: List[str] = None, force: str = False): - logger.info(f"Unzipping {source_file}") - ret = True - try: - if os.path.exists(destination_dir) and force: - shutil.rmtree(destination_dir) - os.makedirs(destination_dir, exist_ok=True) - with ZipFile(source_file, "r") as zip_ref: - members = members_to_extract(zip_ref, members=members) - zip_ref.extractall(destination_dir, members=members) - except (OSError, shutil.Error, FileNotFoundError) as err: - ret = False - logger.error(f"Failed to unzip the file: {str(err)}") - else: - logger.info(f"Successfully unzipped to: {destination_dir}") - - return ret - - -def unzip_file_skip_topdir( - source_file: str, destination_dir: str, members: List[Dict[str, str]] = None, force: str = False -): - logger.info(f"Unzipping {source_file}") - ret = True - try: - if os.path.exists(destination_dir) and force: - shutil.rmtree(destination_dir) - os.makedirs(destination_dir, exist_ok=True) - with ZipFileExactPath(source_file, "r") as zip_ref: - members = members_to_extract_with_dest(zip_ref, members=members) - for member in members: - src_path = member["src"] - dest_path = member["dest"] - if dest_path: - abs_dest_path = os.path.join(destination_dir, dest_path) - zip_ref.extract(member=src_path, path=abs_dest_path) - except (OSError, shutil.Error, FileNotFoundError) as err: - ret = False - logger.error(f"Failed to unzip the file: {str(err)}") - else: - logger.info(f"Successfully unzipped to: {destination_dir}") - - return ret - - -def install_softwares( - softwares_to_install: List[Dict[str, str]], - installer_path: str, - logs_dir: str, - silent: bool = False, - force_reinstall: bool = False, - online: bool = False, -): - sw_error_code = 0 - for software in softwares_to_install: - sw = SoftwareInstall( - software=software, - installers_dir_path=installer_path, - logs_dir=logs_dir, - silent=silent, - force_reinstall=force_reinstall, - online=online, - ) - if not sw.install(): - sw_error_code = 1 - return sw_error_code - - -def install_archives( - archives_to_install: List[Dict[str, str]], - installers_dir_path: str, - installation_dir: str, - force_reinstall: bool = False, - online: bool = False, -): - error_code = 0 - for archive in archives_to_install: - ar = ArchiveInstall( - archive=archive, - installers_dir_path=installers_dir_path, - installation_dir=installation_dir, - force_reinstall=force_reinstall, - online=online, - ) - if not ar.unarchive(): - error_code = 1 - return error_code - - -def delete_files(workspace: str, files: List[str] = None): - exit_value = True - if not files: - return True - for file_name in files: - try: - file_path = get_absolute_path(workspace, file_name) - if os.path.isdir(file_path): - if re.match(r"^\D:\\+$", file_path): - logger.warning(f"Cannot delete drives: {file_path}") - else: - logger.info(f"Removing the directory: {file_path}") - shutil.rmtree(file_path) - logger.info(f"Successfully removed the directory: {file_path}") - elif os.path.isfile(file_path): - logger.info(f"Deleting the file: {file_path}") - os.remove(file_path) - logger.info(f"Successfully deleted the file: {file_path}") - except (OSError, IOError) as err: - logger.error(f"Error occurred while deleting the file/folder: {str(err)}") - exit_value &= False - return exit_value - - -def uninstall_softwares( - softwares_to_uninstall: List[Dict[str, str]], - installer_path: str, - logs_dir: str, - workspace: str, - files_to_delete: List[str] = None, - silent: bool = False, -): - sw_error_code = 0 - for software in softwares_to_uninstall: - sw = SoftwareUninstall(software, installer_path, logs_dir, silent) - if not sw.uninstall(): - sw_error_code = 1 - if not delete_files(workspace, files_to_delete): - sw_error_code = 1 - return sw_error_code - - -def post_install_softwares( - softwares_to_install: List[Dict[str, str]], - installer_path: str, - logs_dir: str, - silent: bool = False, - online: bool = False, -): - sw_error_code = 0 - for software in softwares_to_install: - sw = SoftwareInstall( - software=software, installers_dir_path=installer_path, logs_dir=logs_dir, silent=silent, online=online - ) - if not sw.post_process(): - sw_error_code = 1 - return sw_error_code - - -def copy_files(source_dir: str, destination_dir: str, files: List[str] = None): - exit_value = True - os.makedirs(destination_dir, exist_ok=True) - try: - if files: - for file_name in files: - try: - file_path = get_absolute_path(source_dir, file_name) - destination_path = get_absolute_path(destination_dir, file_name) - if os.path.isfile(file_path): - shutil.copyfile(file_path, destination_path) - elif os.path.isdir(file_path): - shutil.copytree(file_path, destination_path, dirs_exist_ok=True) - except (OSError, shutil.Error) as err: - logger.error(f"Error occurred while copying the files: {file_path}: {str(err)}") - exit_value &= False - else: - shutil.copytree(source_dir, destination_dir, dirs_exist_ok=True) - except (OSError, shutil.Error) as err: - logger.error(f"Error occurred while copying the files: {source_dir}: {str(err)}") - exit_value &= False - return exit_value - - -def openvino_script(destination_dir): - setup_script = os.path.join(destination_dir, "scripts", "setupvars", "setupvars.bat") - if not os.path.isfile(setup_script): - logger.error("Openvino setup script could not be located") - return None - return setup_script - - -def install_packages( - workspace, - venv_python, - requirements_file, - local_wheel_dir, - online: bool = False, - force_reinstall=False, - log_file="venv_install.log", - store_output: bool = False, -): - logger.info("Installing Python packages ...") - ret = 0 - local_wheel_dir = get_absolute_path(workspace, local_wheel_dir) - requirements_file = find_file_in_directory(workspace, requirements_file) - if not requirements_file: - logger.error(f"Error occurred while installing packages. Failed to locate requirements.txt") - return 1 - try: - pip_cmd = [venv_python, "&&", "python", "-m", "pip", "install", "-r", requirements_file, "--timeout", "120"] - if not online: - pip_cmd.extend(["--no-index", "--find-links", local_wheel_dir]) - if force_reinstall: - pip_cmd.append("--ignore-installed") - if store_output: - with open(log_file, "w", encoding="utf-8") as fd: - subprocess.run(pip_cmd, check=True, stdout=fd, stderr=fd, cwd=workspace) - else: - subprocess.run(pip_cmd, check=True, cwd=workspace) - logger.info("Python packages installed successfully") - except (subprocess.CalledProcessError, FileNotFoundError, TimeoutError) as ex: - logger.error(f"Error occurred while installing packages: {str(ex)}") - logger.error(f"Please check the logs for more details: {log_file}") - ret = 1 - return ret - - -def create_venv(workspace: str, venv_path: str): - python_path = get_python_path() - os.makedirs(workspace, exist_ok=True) - venv_path = get_absolute_path(workspace, venv_path) - logger.info(f"Creating virtual environment: {venv_path}") - if not os.path.exists(venv_path): - try: - subprocess.check_call([python_path, "-m", "venv", venv_path], cwd=workspace) - logger.info(f"Virtual environment is created at {venv_path}") - except subprocess.CalledProcessError as e: - logger.error(f"Failed to create virtual environment: {e.stderr}") - return None - except FileNotFoundError as e: - logger.error(f"python exe not found: {e.strerror}") - return None - else: - logger.info(f"Virtual environment is created at {venv_path}") - return os.path.join(venv_path, "Scripts", "activate.bat") - - -def get_absolute_path(workspace, path): - if not os.path.isabs(path): - path = os.path.join(workspace, path) - - return path - - -def validate_input(workspace): - if not os.path.isdir(workspace) or not os.path.isabs(workspace): - logger.error("The provided root for DevKit is not valid. This should be an absolute existent path.") - return 1 - - try: - installer_path = get_absolute_path(workspace, default_paths["local_installers_path"]) - if not os.path.isdir(installer_path): - logger.error(f"The installer path: {installer_path} does not exist") - return 1 - - openvino_source_dir = get_absolute_path(workspace, default_paths["openvino_source_dir"]) - if not os.path.isdir(openvino_source_dir): - logger.error(f"The openvino source directory: {openvino_source_dir} does not exist") - return 1 - - default_python_whls = default_paths["local_python_wheel_dir"] - python_whls_dir = get_absolute_path(workspace, default_python_whls) - if not os.path.isdir(python_whls_dir): - logger.error(f"The local directory path for installing python wheels: {default_python_whls} does not exist") - return 1 - - samples_dir = get_absolute_path(workspace, default_paths["samples_dir"]) - if not os.path.isdir(samples_dir): - logger.error(f"The AI samples directory: {samples_dir} does not exist") - return 1 - except KeyError as ex: - logger.error(f"The path is not defined: {str(ex)}") - return 1 - - return 0 - - -def create_batch_file( - workspace: str, - file_path: str, - file_name: str, - prepend_lines: List[str] = None, - call_scripts: List[str] = None, - append_lines: List[str] = None, -): - bat_file = BatchFileCreation(workspace=workspace, file_path=file_path, file_name=file_name) - try: - bat_file.create_empty() - if prepend_lines: - for line in prepend_lines: - bat_file.add_line(line) - if call_scripts: - for script in call_scripts: - bat_file.add_bat_file_call(script) - if append_lines: - for line in append_lines: - bat_file.add_line(line) - except (IOError, subprocess.CalledProcessError) as ex: - logger.error(f"Failed to create the file {bat_file.file_name}: {str(ex)}") - return None - - logger.info(f"Successfully created the batch file: {bat_file.file_name}") - return bat_file - - -def setup_logging(log_file, logging_level=logging.DEBUG, output_handler: logging.Handler = None): - if not output_handler: - output_handler = logging.StreamHandler() - fmt_stdout = "[AIPCDevKitInstaller - %(levelname)-8s] %(message)s" - fmt_file = "%(asctime)s [AIPCDevKitInstaller - %(levelname)-8s] %(message)s" - formatter_file = logging.Formatter(fmt_file, datefmt="%Y-%m-%d %H:%M:%S") - formatter_stdout = logging.Formatter(fmt_stdout) - logger = logging.getLogger() - - # Clear existing handlers - for handler in logger.handlers[:]: - logger.removeHandler(handler) - - output_handler.setFormatter(formatter_stdout) - file_handler = logging.FileHandler(log_file, mode="w") - file_handler.setFormatter(formatter_file) - logger.setLevel(logging_level) - logger.addHandler(output_handler) - logger.addHandler(file_handler) - return logger - - -def main(args=None, ui_log_handler: logging.Handler = None): - parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter) - parser.add_argument( - "--workspace", "-w", default=CURRENT_DIR_PATH, help="Workspace path for all the relative computations" - ) - parser.add_argument( - "--installation-dir", - default=default_paths.get("installation_dir", CURRENT_DIR_PATH), - help="Absolute Path to installation directory", - ) - parser.add_argument( - "--venv-path", default=default_paths.get("venv_path", "aipc-venv"), help="Virtual environment path" - ) - parser.add_argument( - "--force-reinstall", "-f", action="store_true", help="Set this flag to force re-install the packages" - ) - parser.add_argument("--post-install-only", "-po", action="store_true", help="Set this flag to do post installation") - parser.add_argument("--silent", "-s", action="store_true", help="Set this flag for silent installation of packages") - parser.add_argument("--uninstall", action="store_true", help="Set this flag to uninstall packages") - parser.add_argument("--online", action="store_true", help="Set this flag to install from online", default=True) - parser.add_argument("--version", action="store_true", help="Print the version information and exit") - parser.add_argument( - "--only-softwares", - nargs="*", - help="Space delimeted list of softwares to install/uninstall", - action="store", - choices=SoftwaresToInstall().names(), - ) - - pargs = parser.parse_args(args) - if pargs.version: - print(VERSION) - return 0 - - logs_dir = get_absolute_path(pargs.workspace, default_paths.get("logs_dir", "SetupLogs")) - logs_file = get_absolute_path(logs_dir, "install.log") - if pargs.uninstall: - logs_dir = get_absolute_path(pargs.workspace, default_paths.get("uninstall_logs_dir", "UninstallLogs")) - logs_file = get_absolute_path(logs_dir, "uninstall.log") - - os.makedirs(logs_dir, exist_ok=True) - set_logger = setup_logging(logs_file, output_handler=ui_log_handler) - global logger - logger = set_logger - logger.info(f"Intel AI PC Development Kit version {VERSION}") - local_installers_path = os.path.expandvars(default_paths["local_installers_path"]) - openvino_dest_dir = default_paths.get("openvino_dest_dir", CURRENT_DIR_PATH) - installer_path = get_absolute_path(pargs.workspace, local_installers_path) - installation_dir = get_absolute_path(pargs.workspace, os.path.expandvars(pargs.installation_dir)) - softwares_to_install = SoftwaresToInstall().get_list(software_names=pargs.only_softwares) - if pargs.uninstall: - sw_error_code = uninstall_softwares( - softwares_to_uninstall=softwares_to_install, - installer_path=installer_path, - logs_dir=logs_dir, - workspace=installation_dir, - files_to_delete=default_paths.get("delete_files", []) - + [openvino_dest_dir, os.path.expandvars(pargs.venv_path)], - silent=pargs.silent, - ) - if sw_error_code: - logger.error( - f"ERROR: Not all the software is un-installed properly. Please check the logs: {logs_file} for more details" - ) - return sw_error_code - - if default_paths.get("copy_files"): - copy_files(pargs.workspace, installation_dir, files=default_paths["copy_files"]) - - if not pargs.online: - invalid_input = validate_input(pargs.workspace) - if invalid_input: - return invalid_input - - requirements_file = get_absolute_path(EXE_PATH, default_paths["python_requirements_file"]) - python_whls_dir = default_paths["local_python_wheel_dir"] - samples_dir = default_paths["samples_dir"] - - if pargs.post_install_only: - return post_install_softwares(softwares_to_install, installer_path, logs_dir, pargs.silent, pargs.online) - - sw_error_code = install_softwares( - softwares_to_install, installer_path, logs_dir, pargs.silent, pargs.force_reinstall, pargs.online - ) - archives_to_install = configurations.get("archive_installations", []) - sw_error_code |= install_archives( - archives_to_install=archives_to_install, - installers_dir_path=installer_path, - installation_dir=installation_dir, - force_reinstall=pargs.force_reinstall, - online=pargs.online, - ) - openvino_setup_script = openvino_script(openvino_dest_dir) - if not openvino_setup_script: - sw_error_code = 1 - - samples_dir = get_absolute_path(pargs.workspace, samples_dir) - - logger.info(f"Copying samples to {installation_dir}") - if not copy_files(samples_dir, installation_dir): - logger.error("Failed to copy the samples") - sw_error_code = 1 - else: - logger.info("Samples copied successfully") - aipc_env_path = get_absolute_path(installation_dir, pargs.venv_path) - - venv_python = create_venv(installation_dir, pargs.venv_path) - if venv_python: - venv_log_file = get_absolute_path(logs_dir, "venv_install.log") - if install_packages( - workspace=pargs.workspace, - venv_python=venv_python, - requirements_file=requirements_file, - local_wheel_dir=python_whls_dir, - online=pargs.online, - force_reinstall=pargs.force_reinstall, - log_file=venv_log_file, - store_output=ui_log_handler is not None, - ): - sw_error_code = 1 - else: - sw_error_code = 1 - - setup_message = ["AI PC Development Kit setup is now complete."] - if sw_error_code: - setup_message.append( - f"ERROR: Not all the software is installed properly. Please check the logs: {logs_file} for more details" - ) - bat_file_obj = create_batch_file( - workspace=pargs.workspace, - file_path=aipc_env_path, - file_name="aipcdevkit.bat", - call_scripts=[openvino_setup_script, venv_python], - ) - if not bat_file_obj: - sw_error_code = 1 - jupyter_bat_obj = create_batch_file( - workspace=pargs.workspace, - file_path=installation_dir, - file_name="start_lab.cmd", - call_scripts=[bat_file_obj.file_name], - append_lines=[ - f'start /D "{installation_dir}\\openvino_notebooks" jupyter lab', - "start https://microsoft.github.io/webnn-developer-preview", - "start https://github.com/webmachinelearning/awesome-webnn", - f'cmd /K cd "{installation_dir}"', - ], - ) - if not jupyter_bat_obj: - sw_error_code = 1 - - logger.info("\n\n".join(setup_message)) - jupyter_bat_obj.run_file() - - return sw_error_code - - -if __name__ == "__main__": - try: - if isUserAdmin(): - sys.exit(main()) - else: - logging.warning("This installer should be executed with admin privilege !!!") - time.sleep(20) - sys.exit(0) - except KeyboardInterrupt: - sys.exit(0) diff --git a/Script/ui_installer.py b/Script/ui_installer.py deleted file mode 100644 index 42fc5bb..0000000 --- a/Script/ui_installer.py +++ /dev/null @@ -1,223 +0,0 @@ -## Copyright (C) 2024 Intel Corporation -## Author: Krishna Lakhotia -## Author: Balasubramanyam Agalukote Lakshmipathi -## -## This software and the related documents are Intel copyrighted materials, and your use of them is -## governed by the express license under which they were provided to you ("License"). Unless the -## License provides otherwise, you may not use, modify, copy, publish, distribute, disclose or -## transmit this software or the related documents without Intel's prior written permission. -## -## This software and the related documents are provided as is, with no express or implied warranties, -## other than those that are expressly stated in the License. - -import tkinter as tk -from tkinter import messagebox, ttk -import threading -import installer # Ensure this module is secure and handles all installation logic. -import logging -import os -import argparse -import sys -import time -from version import VERSION - - -class InstallerApp(tk.Tk): - def __init__(self): - super().__init__() - self.setup_window_title() - self.configure(bg="#FFFFFF") - self.create_styles() - self.center_window(600, 400) - self.content_frame = ttk.Frame(self) - self.content_frame.pack(fill="both", expand=True) - self.show_license_window() - self.protocol("WM_DELETE_WINDOW", self.on_close) # Bind the close event - - def setup_window_title(self): - self.title(f"Intel AI PC Development Kit Setup - Installation Wizard v.{VERSION}") - - def finish_installation(self): - self.destroy() - - def on_close(self): - # If the installation is active, prompt the user before closing - if messagebox.askyesno(title="Confirm Exit", message="Confirm Exit"): - self.destroy() - - def create_styles(self): - style = ttk.Style() - style.theme_use("clam") - - # Refined color palette - primary_color = "#2C3E50" # Dark shade of blue - secondary_color = "#5D6D7E" # A softer shade of blue-gray for secondary elements - background_color = "#F4F6F7" # A very light gray that's softer than pure white - foreground_color = "#FFFFFF" # White for text on primary elements - text_color = "#17202A" # A very dark shade of blue-gray for text, providing high contrast - active_color = "#3498DB" # A brighter blue for active/hover states - button_hover = "#D6DBDF" # A light gray for button hover, less intense than the active color - - # Frame style - style.configure("TFrame", background=background_color) - - # Button style - style.configure("TButton", background=secondary_color, foreground=foreground_color, borderwidth=0) - style.map("TButton", background=[("active", button_hover)], foreground=[("active", foreground_color)]) - - # Label style - style.configure("TLabel", background=background_color, foreground=text_color) - - # Checkbutton style - style.configure("TCheckbutton", background=background_color, foreground=text_color) - - # Primary button style (for important actions) - style.configure("Primary.TButton", background=primary_color, foreground=foreground_color) - style.map("Primary.TButton", background=[("active", active_color)], foreground=[("active", foreground_color)]) - - def center_window(self, width, height): - screen_width = self.winfo_screenwidth() - screen_height = self.winfo_screenheight() - x = (screen_width // 2) - (width // 2) - y = (screen_height // 2) - (height // 2) - self.geometry(f"{width}x{height}+{x}+{y}") - - def confirm_quit(self): - if messagebox.askyesno(title="Confirm Cancellation", message="Confirm Cancellation"): - self.destroy() - - def show_license_window(self): - # Clear the current content frame - for widget in self.content_frame.winfo_children(): - widget.destroy() - - software_name = "License Agreement" - ttk.Label(self.content_frame, text=software_name, font=("calibri", 14, "bold")).pack(pady=(20, 10)) - - # Instructions text - instructions_text = "Please read the following important license agreement before continuing:" - instructions_label = ttk.Label(self.content_frame, text=instructions_text, font=("Segoe UI", 10)) - # Pack the instructions_label with the same padx as the accept_license_checkbutton - instructions_label.pack(anchor="w", padx=25, pady=(0, 0)) - - # Create a frame for the license text - license_frame = ttk.Frame(self.content_frame) - # Pack the license_frame with the same padx as the instructions_label and accept_license_checkbutton - license_frame.pack(fill="both", expand=True, padx=25, pady=(10, 0)) - - # Create a Text widget with no wrap (allows horizontal scrolling) - text_widget = tk.Text(license_frame, wrap="word", height=10, width=66, font=("Segoe UI", 10)) - text_widget.config(state="disabled", takefocus=False) - - # Unbind mouse events to prevent text selection - text_widget.bind("<1>", lambda event: "break") # Unbind left mouse click - text_widget.bind("", lambda event: "break") # Unbind mouse move while button held - - # Determine the path to the license.txt file relative to the script's directory - script_dir = os.path.dirname(os.path.realpath(__file__)) - license_file_path = os.path.join(script_dir, "License.txt") - - # License agreement variable and Checkbutton - self.license_var = tk.BooleanVar(value=False) - self.accept_license_checkbutton = ttk.Checkbutton( - self.content_frame, - text="I accept the license agreement", - variable=self.license_var, - state="disable", - command=self.on_license_accept, # Link the checkbox to the callback - ) - self.accept_license_checkbutton.pack(anchor="w", padx=25, pady=(5, 2)) - - # Create a vertical scrollbar and attach it to the Text widget - v_scrollbar = ttk.Scrollbar(license_frame, orient="vertical", command=text_widget.yview) - text_widget.config(yscrollcommand=v_scrollbar.set) - v_scrollbar.pack(side="right", fill="y") - - # Create a horizontal scrollbar and attach it to the Text widget - h_scrollbar = ttk.Scrollbar(license_frame, orient="horizontal", command=text_widget.xview) - text_widget.config(xscrollcommand=h_scrollbar.set) - h_scrollbar.pack(side="bottom", fill="x") - - # Pack the Text widget after the scrollbars to ensure it fills the remaining space - text_widget.pack(side="left", fill="both", expand=True) - - # Define the button container for the "Install" and "Cancel" buttons - button_container = ttk.Frame(self.content_frame) - button_container.pack(side="bottom", fill="x", pady=20) - - # Cancel button - cancel_button = ttk.Button(button_container, text="Cancel", command=self.confirm_quit) - cancel_button.pack(side="right", padx=25) - - # Install button (initially disabled) - self.install_button = ttk.Button( - button_container, text="Install", state="disabled", command=self.perform_installation - ) - self.install_button.pack(side="right", padx=10) - - # Read the license agreement text from the file - try: - with open(license_file_path, "r", encoding="utf-8") as file: - license_text = file.read() - text_widget.config(state="normal") - text_widget.insert("end", license_text) - text_widget.config(state="disabled") # Ensure the text widget is read-only - self.accept_license_checkbutton.config(state="normal") - except FileNotFoundError: - logging.error("License file not found.") - self.disable_ui_elements() - except Exception as e: - logging.error(f"Error reading license file: {e}") - self.disable_ui_elements() - - def disable_ui_elements(self): - if hasattr(self, "accept_license_checkbutton") and self.accept_license_checkbutton: - self.accept_license_checkbutton.config(state="disabled") - # Optionally, display a message box to inform the user - messagebox.showerror( - "Installation Error", "The license agreement file is missing. Installation cannot proceed." - ) - - def on_license_accept(self, *args): - # Enable the "Next" button when the license is accepted - if self.license_var.get(): - self.install_button.config(state="normal") - else: - self.install_button.config(state="disabled") - - def perform_installation(self): - installation_thread = threading.Thread(target=installer.main) - installation_thread.start() - self.finish_installation() - - -# Main application window -if __name__ == "__main__": - if getattr(sys, "frozen", False) and hasattr(sys, "_MEIPASS"): - from pyi_rth_installer import restore_original - - global ACLS_CHANGED - - application_dir = os.path.dirname(sys.executable) - relocation_dir = os.path.join(application_dir, "temporary_folder_AIDevKit") - restore_original(relocation_dir, application_dir, acl_changed=ACLS_CHANGED) - - parser = argparse.ArgumentParser() - parser.add_argument("--version", action="store_true", help="Print the version information and exit") - pargs = parser.parse_args() - if pargs.version: - print(VERSION) - sys.exit(0) - try: - if installer.isUserAdmin(): - app = InstallerApp() - app.mainloop() - else: - logging.warning("This installer should be executed with admin privilege !!!") - time.sleep(20) - sys.exit(0) - except KeyboardInterrupt: - sys.exit(0) - except Exception as e: - logging.error(f"Application error: {e}") - messagebox.showerror("Application Error", "An unexpected error occurred.") diff --git a/Script/uninstall.py b/Script/uninstall.py deleted file mode 100644 index ba1da30..0000000 --- a/Script/uninstall.py +++ /dev/null @@ -1,44 +0,0 @@ -## Copyright (C) 2024 Intel Corporation -## Author: Krishna Lakhotia -## Author: Balasubramanyam Agalukote Lakshmipathi -## -## This software and the related documents are Intel copyrighted materials, and your use of them is -## governed by the express license under which they were provided to you ("License"). Unless the -## License provides otherwise, you may not use, modify, copy, publish, distribute, disclose or -## transmit this software or the related documents without Intel's prior written permission. -## -## This software and the related documents are provided as is, with no express or implied warranties, -## other than those that are expressly stated in the License. - -import sys -import ctypes -import logging -import time -import os - -from installer import main as installer_main - - -def isUserAdmin(): - try: - return ctypes.windll.shell32.IsUserAnAdmin() - except: - return False - - -if __name__ == "__main__": - if getattr(sys, "frozen", False) and hasattr(sys, "_MEIPASS"): - from pyi_rth_installer import restore_original - - global ACLS_CHANGED - - application_dir = os.path.dirname(sys.executable) - relocation_dir = os.path.join(application_dir, "temporary_folder_AIDevKit") - restore_original(relocation_dir, application_dir, acl_changed=ACLS_CHANGED) - - if isUserAdmin(): - sys.exit(installer_main(["--uninstall", "--silent"])) - else: - logging.warning("This un-installer should be executed with admin privilege !!!") - time.sleep(20) - sys.exit(0) diff --git a/Script/version.py b/Script/version.py deleted file mode 100644 index f48f475..0000000 --- a/Script/version.py +++ /dev/null @@ -1,14 +0,0 @@ -## Copyright (C) 2024 Intel Corporation -## Author: Krishna Lakhotia -## Author: Balasubramanyam Agalukote Lakshmipathi -## -## This software and the related documents are Intel copyrighted materials, and your use of them is -## governed by the express license under which they were provided to you ("License"). Unless the -## License provides otherwise, you may not use, modify, copy, publish, distribute, disclose or -## transmit this software or the related documents without Intel's prior written permission. -## -## This software and the related documents are provided as is, with no express or implied warranties, -## other than those that are expressly stated in the License. - -# version.py -VERSION = "2024.10.2" diff --git a/archive_ps_codebase/IntelOpenVinoSetupV2.txt b/archive_ps_codebase/IntelOpenVinoSetupV2.txt deleted file mode 100644 index c1aeddc..0000000 --- a/archive_ps_codebase/IntelOpenVinoSetupV2.txt +++ /dev/null @@ -1,400 +0,0 @@ -#Requires -RunAsAdministrator - -## Copyright (C) 2024 Intel Corporation -## Author: Sanjay Aghara -## This software and the related documents are Intel copyrighted materials, and your use of them is -## governed by the express license under which they were provided to you ("License"). Unless the -## License provides otherwise, you may not use, modify, copy, publish, distribute, disclose or -## transmit this software or the related documents without Intel's prior written permission. -## -## This software and the related documents are provided as is, with no express or implied warranties, -## other than those that are expressly stated in the License. - -Set-StrictMode -Version 2 - -Function Prepend_Path ([string]$element) { - $ENV:PATH="$element;$($ENV:PATH)" -} - -Function Add_Path ([string]$element) { - # Adds a path to $ENV:PATH unless it is already added - $parts = $ENV:PATH -split ';' - if (-Not ($parts -contains $element)) { - $ENV:PATH=(($parts + $element) -join ';').Replace(';;',';') - } -} - -Function Install_Git { - Get-Package 'Git' 2>&1 | Out-Null - if ($?) { - Write-Host "SKIP install (already installed): 'Git'" - return - } - - $gitfile="$dloadPath\Git-2.43.0-64-bit.exe" - if ( -Not ( Test-Path $gitfile ) ) { - C:\Windows\System32\curl.exe -L -o $gitfile "https://github.com/git-for-windows/git/releases/download/v2.43.0.windows.1/Git-2.43.0-64-bit.exe" - } - - $config=@' -[Setup] -Lang=default -Dir=C:\Program Files\Git -Group=Git -NoIcons=0 -SetupType=default -Components=ext,ext\shellhere,ext\guihere,gitlfs,assoc,assoc_sh,windowsterminal,scalar -Tasks= -EditorOption=VIM -CustomEditorPath= -DefaultBranchOption= -PathOption=Cmd -SSHOption=OpenSSH -TortoiseOption=false -CURLOption=OpenSSL -CRLFOption=CRLFAlways -BashTerminalOption=ConHost -GitPullBehaviorOption=Merge -UseCredentialManager=Enabled -PerformanceTweaksFSCache=Enabled -EnableSymlinks=Disabled -EnablePseudoConsoleSupport=Disabled -EnableFSMonitor=Disabled -DisableStartupPrompt=No -'@ - - $config_file="$dloadPath\git-install-options.ini" - Out-File -FilePath $config_file -Encoding ascii -InputObject $config - - Start-Process $gitfile -argumentList "/norestart /nocancel /loadinf=$config_file" -wait - - if ( $? -eq $true ) { - Write-Host "Git install completed" - } else { - Write-Host "Git install failed" - } -} - -Function Install_Visual_C_Redist { - Get-ItemProperty -path 'HKLM:\Software\Microsoft\VisualStudio\14.0\VC' 2>&1 | Out-NULL - if ($?) { - Write-Host "SKIP already installed (VC++ Redistributable)" - return - } - $exe = ".\VC_Redist.x64.exe" - if ( -Not (Test-Path $exe) ) { - C:\Windows\system32\curl.exe -L -o $exe "https://aka.ms/vs/16/release/vc_redist.x64.exe" - if ($? -eq $False) { - Write-Host "Download failed" - exit 1 - } - } - Write-Host "Installing Visual C++ Redistributable library" - $p = Start-process -FilePath $exe -ArgumentList "/install" -Wait -PassThru - if ($p.ExitCode -eq 0) { - Write-Host "Install ok" - } else { - Write-Host "Install failed" - exit 1 - } -} - -Function Install_VSCode_plugins { - get-command 'code' - if ($? -eq $False) { - Write-Host "SKIP installing plugins. Code not found in path." - Write-Host "Please install Visual Studio Code plugins manually: ms-python.python and ms-toolsai.jupyter" - return - } - Write-Host "Installing code plugin ms-python.python" - code --install-extension ms-python.python - Write-Host "Installing code plugin ms-python.jupyter" - code --install-extension ms-toolsai.jupyter -} - -Function Create_VSCode_INF ([string] $ver) { - $infname="VSCodeUserSetup-X64-$ver.inf" - $buf=@" -[Setup] -Lang=english -Dir=$ENV:LOCALAPPDATA\Programs\Microsoft VS Code -Group=Visual Studio Code -NoIcons=0 -Tasks=associatewithfiles,addtopath -"@ - Out-File -FilePath $infname -Encoding ASCII -InputObject $buf - Write-Host "Created file: $infname" -} - -Function Install_VSCode ([string] $ver = '1.88.1') { - Get-Package 'Microsoft Visual Studio Code*' 2>&1 | Out-Null - if ($?) { - $pkg = Get-Package 'Microsoft Visual Studio Code*' - Write-Host "SKIP install (already installed): '$($pkg.name)'" - return - } - # If you want the latest version use 'latest' for $ver in the URL. - # plus you can curl the header and get the filename from the Content-Disposition field if you want to know the version before installing - $exename="$dloadPath\VSCodeSetup-X64-$ver.exe" - $infname="$dloadPath\VSCodeSetup-X64-$ver.inf" - - if ( -Not ( Test-Path $exename )) { - Write-Host "Downloading $exename" - $url="https://update.code.visualstudio.com/$ver/win32-x64/stable" - C:\Windows\system32\curl.exe -L -o $exename $url - if ($? -eq $False) { - Write-Host "Failed downloading Visual Studio Code installer" - return - } - } else { - Write-Host "SKIP download of $exename (file exists)" - } - Create_VSCode_INF $ver - - Write-Host "Installing Visual Studio Code..." - Start-Process -FilePath $exename -ArgumentList "/NORESTART /NOCANCEL /LOADINF=$infname" -Wait - Get-Package 'Microsoft Visual Studio Code*' 2>&1 | Out-Null - if ($?) { - Write-Host "VSCode installed okay" - $codepath = $ENV:PROGRAMFILES + '\Microsoft VS Code\bin' - Add_Path $codepath - } else { - Write-Host "Failed installing VSCode" - return - } -} - -Function Install_Cmake { - get-package "CMake" 2>&1 | Out-Null - if ($? -eq $True) { - Write-Host "SKIP: CMake is installed" - return - } - #Get and Install CMake 3.27.7 - https://github.com/Kitware/CMake/releases/download/v3.29.2/cmake-3.29.2-windows-x86_64.msi - if (-Not (Test-Path "$dloadPath\cmake-3.27.7-windows-x86_64.msi")) { - Write-Host "Downloading CMake..." - Start-BitsTransfer "https://github.com/Kitware/CMake/releases/download/v3.29.2/cmake-3.29.2-windows-x86_64.msi" -Destination $dloadPath -TransferType Download - } - - Write-Host "Installing CMake..." - Start-Process -FilePath "$env:systemroot\system32\msiexec.exe" -ArgumentList "/i `"$dloadPath\cmake-3.29.2-windows-x86_64.msi`" ALLUSERS=1 ADD_CMAKE_TO_PATH=System DESKTOP_SHORTCUT_REQUESTED=1 /norestart" -Wait - if ( $? -ne $True ) { - Write-host "Command failed." - exit 1 - } -} - -Function Install_Python { - get-package 'Python 3.11.0 (64-bit)' 2>&1 | Out-Null - if ($? -eq $True) { - Write-Host "SKIP: Python is installed" - return - } - $python_license_url = 'https://docs.python.org/3/license.html' - $prompt = "`nThe Python License can be found at $python_license_url`n`nPlease enter one of the following:`n 'accept' to accept the license`n 'show' to view the license by opening a browser to the URL, or`n 'quit' to exit`nYour choice?" - do { - $response = Read-Host -Prompt $prompt - if ($response -eq 'show') { - Start-Process $python_license_url -WindowStyle Normal - } - if ($response -eq 'quit') { - Write-host "quitting" - exit - } - } while ($response -ne 'accept') - - #Get and Install Python 3.11.0 - if (-Not (Test-Path "$dloadPath\python-3.11.0-amd64.exe")) { - Write-Host "Downloading Python 3.11.0 ..." - Start-BitsTransfer "https://www.python.org/ftp/python/3.11.0/python-3.11.0-amd64.exe" -Destination $dloadPath -TransferType Download - } - - Write-Host "Installing Python 3.11.0 ..." - Start-Process -FilePath "$dloadPath\python-3.11.0-amd64.exe" -ArgumentList "/quiet /passive PrependPath=1 InstallAllUsers=1" -Wait - #Start-Process -FilePath "$dloadPath\python-3.10.11-amd64.exe" -ArgumentList "PrependPath=1 InstallAllUsers=1" -Wait - get-package 'Python 3.11.0 (64-bit)' 2>&1 | Out-Null - if ( $? -ne $True ) { - Write-host "Python install failed. Quitting" - exit 1 - } -} - -Function Install_OpenCV { - if ( Test-Path ( "$OpenVinoWorkingDir\opencv" )) { - Write-Host "SKIP: OpenCV is installed" - return - } - #Get and Setup OpenCV 4.6.0 - Write-Host "Downloading OpenCV..." - Start-BitsTransfer "https://github.com/opencv/opencv/releases/download/4.6.0/opencv-4.6.0-vc14_vc15.exe" -Destination $dloadPath -TransferType Download - Write-Host "Installing OpenCV under $OpenVinoWorkingDir" - Start-Process -FilePath "$dloadPath\opencv-4.6.0-vc14_vc15.exe" -ArgumentList "-o$OpenVinoWorkingDir -y" -Wait - if ( $? -ne $True ) { - Write-host "Command failed." - exit 1 - } -} - -Function Install_OpenVINO { - if ( Test-Path "$OpenVinoPath\openvino_2024.0.0" ) { - Write-Host "SKIP: OpenVINO is installed" - return - } - - Write-Host "Downloading OpenVINO 2024.1.0 ..." - Start-BitsTransfer $OpenVinoDownloadLink -Destination "$dloadPath\openvino_2024.1.0.zip" -TransferType Download - if ( $? -ne $True ) { - Write-host "Command failed." - exit 1 - } - - Write-Host "Extracting OpenVINO 2024.1.0 to $OpenVinoPath\openvino_2024.1.0" - Expand-Archive -Path "$dloadPath\openvino_2024.1.0.zip" -DestinationPath $dloadPath -Force - Rename-Item -Path "$dloadPath\w_openvino_toolkit_windows_2024.1.0.15008.f4afc983258_x86_64" -NewName "$dloadPath\openvino_2024.1.0" - Move-Item "$dloadPath\openvino_2024.1.0" -Destination $OpenVinoPath -Force - - # why change $OpenVinoPath variable to point to the extracted download after installing in C:\Prog... ?? -ce -} - -Function Install_Packages_in_Virtual_Environment() { - - $venvRoot = "$OpenVinoworkingDir\venv" - - if ( -Not ( Test-Path "$venvRoot" ) ) { - Write-Host "Creating Virtual Environment at $venvRoot ..." - python -m venv $venvRoot - } - - & "$venvRoot\Scripts\activate.ps1" - $py = (get-command python).Path - - $nightly = "openvino-nightly==2024.1.0.dev20240216" - $reqfile = 'C:\Intel\openvino_notebooks\requirements.txt' - - # pip upgrade - Invoke-Expression "$py -m pip install --upgrade pip" - # packages for openvino_notebooks in general - Invoke-Expression "$py -m pip install -r `"$reqfile`"" - # packages for 254-llm-chatbot - Invoke-Expression "$py -m pip uninstall -q -y openvino openvino-nightly optimum optimum-intel" - Invoke-Expression "$py -m pip install --extra-index-url 'https://download.pytorch.org/whl/cpu' 'git+https://github.com/huggingface/optimum-intel.git' 'git+https://github.com/openvinotoolkit/nncf.git' 'datasets' 'accelerate' 'openvino-nightly' 'gradio' 'onnx' 'einops' 'transformers_stream_generator' 'tiktoken' 'transformers>=4.38.1' 'bitsandbytes'" - # packages from original script - Invoke-Expression "$py -m pip install ipykernel requests seaborn wget onnxruntime netron py-cpuinfo py3nvml" - # packages for 234 - Invoke-Expression "$py -m pip install 'ultralytics==8.0.43' --extra-index-url 'https://download.pytorch.org/whl/cpu'" - #Invoke-Expression "$py -m pip install openvino-nightly --force-reinstall" - - # deactivate -} - -Set-Location $PSScriptRoot # start from where the script is located - -if ( Test-Path ENV:HTTP_PROXY ) { - [System.Console]::WriteLine('$ENV:HTTP_PROXY = {0}', $ENV:HTTP_PROXY) -} else { - [System.Console]::WriteLine('$ENV:HTTP_PROXY is not set') -} - -Import-Module BitsTransfer - -$OpenVinoPath = "C:\Program Files (x86)\Intel" -$dloadPath = "$ENV:HOMEDRIVE\$ENV:HOMEPATH\Downloads\OpenVinoBins" -$OpenVinoDownloadLink = "https://storage.openvinotoolkit.org/repositories/openvino/packages/2024.1/windows/w_openvino_toolkit_windows_2024.1.0.15008.f4afc983258_x86_64.zip" -$OpenVinoWorkingDir = "C:\Intel" - - -New-Item -ItemType Directory -Path $dloadPath -ErrorAction Ignore -New-Item -ItemType Directory -Path $OpenVinoPath -ErrorAction Ignore -New-Item -ItemType Directory -Path $OpenVinoWorkingDir -ErrorAction Ignore - -if (Test-Path -Path $dloadPath) -{ - ### Installing Prerequisites - BEGIN ### - Install_Visual_C_Redist - Install_CMake - Install_Python - Install_OpenCV - Install_Git - add_path 'C:\Program Files\Git\cmd' - - ### Installing Prerequisites - END ### - - Install_VSCode - Install_VSCode_Plugins - Install_OpenVINO - - # $OpenVinoPath = "$dloadPath\openvino_2023.2.0" - - $python_path = "$($ENV:PROGRAMFILES)\Python311" - $python_scripts = "$($ENV:PROGRAMFILES)\Scripts" - Prepend_Path "$python_scripts;$python_path" - - Set-Location $OpenVinoWorkingDir - New-Item -ItemType Directory -Path "$OpenVinoWorkingDir\omz_root" -ErrorAction Ignore - - [System.Environment]::SetEnvironmentVariable("OMZ_ROOT","$OpenVinoWorkingDir\omz_root", "User") - Add_Path "C:\Program Files\CMake\bin;C:\Intel\OpenCV\opencv\build\bin" - $ENV:Path | Out-Host - -## why download master.zip? It does not get used later(?). open_model_zoo gets clone from git! -ce -# -# #Start-BitsTransfer "https://github.com/openvinotoolkit/open_model_zoo/archive/refs/heads/master.zip" -Destination "$OpenVinoWorkingDir" -# if ( Test-Path "$OpenVinoWorkingDir\master.zip" ) { -# Write-Host "SKIP: Download of open_model_zoo master.zip -- file exists" -# } else { -# Write-Host "Downloading open_model_zoo master.zip file..." -# C:\Windows\system32\curl.exe -L -o "$OpenVinoWorkingDir\master.zip" "https://github.com/openvinotoolkit/open_model_zoo/archive/refs/heads/master.zip" -# if ( $? -ne $True ) { -# Write-host "WARNING: Command failed." -# } -# } -# # - - get-package 'git' 2>&1 | Out-Null - if ( $? -eq $False ) { - Write-Host "Please manually install git and then clone repos with the following commands:" - Write-Host " git clone https://github.com/openvinotoolkit/open_model_zoo.git" - Write-Host " git clone --depth=1 https://github.com/openvinotoolkit/openvino_notebooks.git" - Write-Host " git clone https://github.com/microsoft/onnxruntime" - Write-Host " git clone --recurse-submodules https://github.com/webmachinelearning/webnn-samples" - Write-Host " git clone --recurse-submodules https://github.com/huggingface/optimum-intel" - exit 1 - } - - if ( -Not ( Test-Path "openvino_notebooks" ) ) { - Start-Process -FilePath "C:\Program Files\Git\bin\git.exe" -ArgumentList "clone --depth=1 https://github.com/openvinotoolkit/openvino_notebooks.git" -Wait - } else { - Write-Host "SKIP cloneing (folder exists): openvino_notebooks" - } - - if ( -Not ( Test-Path "open_model_zoo" ) ) { - Start-Process -FilePath "C:\Program Files\Git\bin\git.exe" -ArgumentList "clone --depth=1 https://github.com/openvinotoolkit/open_model_zoo.git" -Wait - } else { - Write-Host "Skip cloning (folder exists): open_model_zoo" - } - - if ( -Not ( Test-Path "onnxruntime" ) ) { - Start-Process -FilePath "C:\Program Files\Git\bin\git.exe" -ArgumentList "clone https://github.com/microsoft/onnxruntime" -Wait - } else { - Write-Host "Skip cloning (folder exists): onnxruntime" - } - - if ( -Not ( Test-Path "webnn-samples" ) ) { - Start-Process -FilePath "C:\Program Files\Git\bin\git.exe" -ArgumentList "clone --recurse-submodules https://github.com/webmachinelearning/webnn-samples" -Wait - } else { - Write-Host "Skip cloning (folder exists): webnn-samples" - } - - if ( -Not ( Test-Path "optimum-intel" ) ) { - Start-Process -FilePath "C:\Program Files\Git\bin\git.exe" -ArgumentList "clone --recurse-submodules https://github.com/huggingface/optimum-intel" -Wait - } else { - Write-Host "Skip cloning (folder exists): optimum-intel" - } - - - Install_Packages_in_Virtual_Environment - - Set-Location "$OpenVinoWorkingDir\openvino_notebooks" - - Write-Host "OpenVINO Installation is done. Also openvino_notebooks project has been checked out" -} diff --git a/archive_ps_codebase/IntelOpenVinoSetupV5.txt b/archive_ps_codebase/IntelOpenVinoSetupV5.txt deleted file mode 100644 index 9ba1f54..0000000 --- a/archive_ps_codebase/IntelOpenVinoSetupV5.txt +++ /dev/null @@ -1,399 +0,0 @@ -#Requires -RunAsAdministrator - -## Copyright (C) 2024 Intel Corporation -## Author: Sanjay Aghara -## This software and the related documents are Intel copyrighted materials, and your use of them is -## governed by the express license under which they were provided to you ("License"). Unless the -## License provides otherwise, you may not use, modify, copy, publish, distribute, disclose or -## transmit this software or the related documents without Intel's prior written permission. -## -## This software and the related documents are provided as is, with no express or implied warranties, -## other than those that are expressly stated in the License. - -Set-StrictMode -Version 2 - -Function Prepend_Path ([string]$element) { - $ENV:PATH="$element;$($ENV:PATH)" -} - -Function Add_Path ([string]$element) { - # Adds a path to $ENV:PATH unless it is already added - $parts = $ENV:PATH -split ';' - if (-Not ($parts -contains $element)) { - $ENV:PATH=(($parts + $element) -join ';').Replace(';;',';') - } -} - -Function Install_Git { - Get-Package 'Git' 2>&1 | Out-Null - if ($?) { - Write-Host "SKIP install (already installed): 'Git'" - return - } - - $gitfile="$dloadPath\Git-2.46.2-64-bit.exe" - if ( -Not ( Test-Path $gitfile ) ) { - C:\Windows\System32\curl.exe -L -o $gitfile "https://github.com/git-for-windows/git/releases/download/v2.46.2.windows.1/Git-2.46.2-64-bit.exe" - } - - $config=@' -[Setup] -Lang=default -Dir=C:\Program Files\Git -Group=Git -NoIcons=0 -SetupType=default -Components=ext,ext\shellhere,ext\guihere,gitlfs,assoc,assoc_sh,windowsterminal,scalar -Tasks= -EditorOption=VIM -CustomEditorPath= -DefaultBranchOption= -PathOption=Cmd -SSHOption=OpenSSH -TortoiseOption=false -CURLOption=OpenSSL -CRLFOption=CRLFAlways -BashTerminalOption=ConHost -GitPullBehaviorOption=Merge -UseCredentialManager=Enabled -PerformanceTweaksFSCache=Enabled -EnableSymlinks=Disabled -EnablePseudoConsoleSupport=Disabled -EnableFSMonitor=Disabled -DisableStartupPrompt=No -'@ - - $config_file="$dloadPath\git-install-options.ini" - Out-File -FilePath $config_file -Encoding ascii -InputObject $config - - Start-Process $gitfile -argumentList "/norestart /nocancel /loadinf=$config_file" -wait - - if ( $? -eq $true ) { - Write-Host "Git install completed" - } else { - Write-Host "Git install failed" - } -} - -Function Install_Visual_C_Redist { - Get-ItemProperty -path 'HKLM:\Software\Microsoft\VisualStudio\14.0\VC' 2>&1 | Out-NULL - if ($?) { - Write-Host "SKIP already installed (VC++ Redistributable)" - return - } - $exe = ".\VC_Redist.x64.exe" - if ( -Not (Test-Path $exe) ) { - C:\Windows\system32\curl.exe -L -o $exe "https://aka.ms/vs/16/release/vc_redist.x64.exe" - if ($? -eq $False) { - Write-Host "Download failed" - exit 1 - } - } - Write-Host "Installing Visual C++ Redistributable library" - $p = Start-process -FilePath $exe -ArgumentList "/install" -Wait -PassThru - if ($p.ExitCode -eq 0) { - Write-Host "Install ok" - } else { - Write-Host "Install failed" - exit 1 - } -} - -Function Install_VSCode_plugins { - get-command 'code' - if ($? -eq $False) { - Write-Host "SKIP installing plugins. Code not found in path." - Write-Host "Please install Visual Studio Code plugins manually: ms-python.python and ms-toolsai.jupyter" - return - } - Write-Host "Installing code plugin ms-python.python" - code --install-extension ms-python.python - Write-Host "Installing code plugin ms-python.jupyter" - code --install-extension ms-toolsai.jupyter - Write-Host "Installing code plugin ritwickdey.LiveServer" - code --install-extension ritwickdey.LiveServer - - -} - -Function Create_VSCode_INF ([string] $ver) { - $infname="VSCodeUserSetup-X64-$ver.inf" - $buf=@" -[Setup] -Lang=english -Dir=$ENV:LOCALAPPDATA\Programs\Microsoft VS Code -Group=Visual Studio Code -NoIcons=0 -Tasks=associatewithfiles,addtopath -"@ - Out-File -FilePath $infname -Encoding ASCII -InputObject $buf - Write-Host "Created file: $infname" -} - -Function Install_VSCode ([string] $ver = '1.93.1') { - Get-Package 'Microsoft Visual Studio Code*' 2>&1 | Out-Null - if ($?) { - $pkg = Get-Package 'Microsoft Visual Studio Code*' - Write-Host "SKIP install (already installed): '$($pkg.name)'" - return - } - # If you want the latest version use 'latest' for $ver in the URL. - # plus you can curl the header and get the filename from the Content-Disposition field if you want to know the version before installing - $exename="$dloadPath\VSCodeSetup-X64-$ver.exe" - $infname="$dloadPath\VSCodeSetup-X64-$ver.inf" - - if ( -Not ( Test-Path $exename )) { - Write-Host "Downloading $exename" - $url="https://update.code.visualstudio.com/$ver/win32-x64/stable" - C:\Windows\system32\curl.exe -L -o $exename $url - if ($? -eq $False) { - Write-Host "Failed downloading Visual Studio Code installer" - return - } - } else { - Write-Host "SKIP download of $exename (file exists)" - } - Create_VSCode_INF $ver - - Write-Host "Installing Visual Studio Code..." - Start-Process -FilePath $exename -ArgumentList "/NORESTART /NOCANCEL /LOADINF=$infname" -Wait - Get-Package 'Microsoft Visual Studio Code*' 2>&1 | Out-Null - if ($?) { - Write-Host "VSCode installed okay" - $codepath = $ENV:PROGRAMFILES + '\Microsoft VS Code\bin' - Add_Path $codepath - } else { - Write-Host "Failed installing VSCode" - return - } -} - -Function Install_Cmake { - get-package "CMake" 2>&1 | Out-Null - if ($? -eq $True) { - Write-Host "SKIP: CMake is installed" - return - } - #Get and Install CMake 3.30.3 - https://github.com/Kitware/CMake/releases/download/v3.30.3/cmake-3.30.3-windows-x86_64.msi - if (-Not (Test-Path "$dloadPath\cmake-3.30.3-windows-x86_64.msi")) { - Write-Host "Downloading CMake..." - Start-BitsTransfer "https://github.com/Kitware/CMake/releases/download/v3.30.3/cmake-3.30.3-windows-x86_64.msi" -Destination $dloadPath -TransferType Download - } - - Write-Host "Installing CMake..." - Start-Process -FilePath "$env:systemroot\system32\msiexec.exe" -ArgumentList "/i `"$dloadPath\cmake-3.30.3-windows-x86_64.msi`" ALLUSERS=1 ADD_CMAKE_TO_PATH=System DESKTOP_SHORTCUT_REQUESTED=1 /norestart" -Wait - if ( $? -ne $True ) { - Write-host "Command failed." - exit 1 - } -} - -Function Install_Python { - get-package 'Python 3.12.6 (64-bit)' 2>&1 | Out-Null - if ($? -eq $True) { - Write-Host "SKIP: Python is installed" - return - } - $python_license_url = 'https://docs.python.org/3/license.html' - $prompt = "`nThe Python License can be found at $python_license_url`n`nPlease enter one of the following:`n 'accept' to accept the license`n 'show' to view the license by opening a browser to the URL, or`n 'quit' to exit`nYour choice?" - do { - $response = Read-Host -Prompt $prompt - if ($response -eq 'show') { - Start-Process $python_license_url -WindowStyle Normal - } - if ($response -eq 'quit') { - Write-host "quitting" - exit - } - } while ($response -ne 'accept') - - #Get and Install Python 3.12.6 - if (-Not (Test-Path "$dloadPath\python-3.12.6-amd64.exe")) { - Write-Host "Downloading Python 3.12.6 ..." - Start-BitsTransfer "https://www.python.org/ftp/python/3.12.6/python-3.12.6-amd64.exe" -Destination $dloadPath -TransferType Download - } - - Write-Host "Installing Python 3.12.6 ..." - Start-Process -FilePath "$dloadPath\python-3.12.6-amd64.exe" -ArgumentList "/quiet /passive PrependPath=1 InstallAllUsers=1" -Wait - #Start-Process -FilePath "$dloadPath\python-3.12.6-amd64.exe" -ArgumentList "PrependPath=1 InstallAllUsers=1" -Wait - get-package 'Python 3.12.6 (64-bit)' 2>&1 | Out-Null - if ( $? -ne $True ) { - Write-host "Python install failed. Quitting" - exit 1 - } -} - -Function Install_OpenCV { - if ( Test-Path ( "$OpenVinoWorkingDir\opencv" )) { - Write-Host "SKIP: OpenCV is installed" - return - } - #Get and Setup OpenCV 4.10.0 - Write-Host "Downloading OpenCV..." - Start-BitsTransfer "https://github.com/opencv/opencv/releases/download/4.10.0/opencv-4.10.0-windows.exe" -Destination $dloadPath -TransferType Download - Write-Host "Installing OpenCV under $OpenVinoWorkingDir" - Start-Process -FilePath "$dloadPath\opencv-4.10.0-windows.exe" -ArgumentList "-o$OpenVinoWorkingDir -y" -Wait - if ( $? -ne $True ) { - Write-host "Command failed." - exit 1 - } -} -#"https://github.com/opencv/opencv/releases/download/4.10.0/opencv-4.10.0-vc14_vc15.exe" -Destination $dloadPath -TransferType Download - -Function Install_OpenVINO { - if ( Test-Path "$OpenVinoPath\openvino_2024.4.0" ) { - Write-Host "SKIP: OpenVINO is installed" - return - } - - Write-Host "Downloading OpenVINO 2024.4.0 ..." - Start-BitsTransfer $OpenVinoDownloadLink -Destination "$dloadPath\openvino_2024.4.0.zip" -TransferType Download - if ( $? -ne $True ) { - Write-host "Command failed." - exit 1 - } - - Write-Host "Extracting OpenVINO 2024.4.0 to $OpenVinoPath\openvino_2024.4.0" - Expand-Archive -Path "$dloadPath\openvino_2024.4.0.zip" -DestinationPath $dloadPath -Force - Rename-Item -Path "$dloadPath\w_openvino_toolkit_windows_2024.4.0.16579.c3152d32c9c_x86_64" -NewName "$dloadPath\openvino_2024.4.0" - Move-Item "$dloadPath\openvino_2024.4.0" -Destination $OpenVinoPath -Force - - # why change $OpenVinoPath variable to point to the extracted download after installing in C:\Prog... ?? -ce -} - -Function Install_Packages_in_Virtual_Environment() { - - $venvRoot = "$OpenVinoworkingDir\venv" - - if ( -Not ( Test-Path "$venvRoot" ) ) { - Write-Host "Creating Virtual Environment at $venvRoot ..." - python -m venv $venvRoot - } - - & "$venvRoot\Scripts\activate.ps1" - $py = (get-command python).Path - - $nightly = "openvino-nightly==2024.5.0.dev20240924" - $reqfile = 'C:\Intel\openvino_notebooks\requirements.txt' - - # pip upgrade - Invoke-Expression "$py -m pip install --upgrade pip" - # packages for openvino_notebooks in general - Invoke-Expression "$py -m pip install -r `"$reqfile`"" - # packages for 254-llm-chatbot - Invoke-Expression "$py -m pip uninstall -q -y openvino openvino-nightly optimum optimum-intel" - Invoke-Expression "$py -m pip install --extra-index-url 'https://download.pytorch.org/whl/cpu' 'git+https://github.com/huggingface/optimum-intel.git' 'git+https://github.com/openvinotoolkit/nncf.git' 'datasets' 'accelerate' 'openvino-nightly' 'gradio' 'onnx' 'einops' 'transformers_stream_generator' 'tiktoken' 'transformers>=4.38.1' 'bitsandbytes'" - # packages from original script - Invoke-Expression "$py -m pip install ipykernel requests seaborn wget onnxruntime netron py-cpuinfo py3nvml" - # packages for 234 - Invoke-Expression "$py -m pip install 'ultralytics==8.0.43' --extra-index-url 'https://download.pytorch.org/whl/cpu'" - #Invoke-Expression "$py -m pip install openvino-nightly --force-reinstall" - - # deactivate -} - -Set-Location $PSScriptRoot # start from where the script is located - -if ( Test-Path ENV:HTTP_PROXY ) { - [System.Console]::WriteLine('$ENV:HTTP_PROXY = {0}', $ENV:HTTP_PROXY) -} else { - [System.Console]::WriteLine('$ENV:HTTP_PROXY is not set') -} - -Import-Module BitsTransfer - -$OpenVinoPath = "C:\Program Files (x86)\Intel" -$dloadPath = "$ENV:HOMEDRIVE\$ENV:HOMEPATH\Downloads\OpenVinoBins" -$OpenVinoDownloadLink = "https://storage.openvinotoolkit.org/repositories/openvino/packages/2024.4/windows/w_openvino_toolkit_windows_2024.4.0.16579.c3152d32c9c_x86_64.zip" -$OpenVinoWorkingDir = "C:\Intel" - - -New-Item -ItemType Directory -Path $dloadPath -ErrorAction Ignore -New-Item -ItemType Directory -Path $OpenVinoPath -ErrorAction Ignore -New-Item -ItemType Directory -Path $OpenVinoWorkingDir -ErrorAction Ignore - -if (Test-Path -Path $dloadPath) -{ - ### Installing Prerequisites - BEGIN ### - Install_Visual_C_Redist - Install_CMake - Install_Python - Install_OpenCV - Install_Git - add_path 'C:\Program Files\Git\cmd' - - ### Installing Prerequisites - END ### - - Install_VSCode - Install_VSCode_Plugins - Install_OpenVINO - - # $OpenVinoPath = "$dloadPath\openvino_2024.4.0" - - $python_path = "$($ENV:PROGRAMFILES)\Python312" - $python_scripts = "$($ENV:PROGRAMFILES)\Scripts" - Prepend_Path "$python_scripts;$python_path" - - Set-Location $OpenVinoWorkingDir - New-Item -ItemType Directory -Path "$OpenVinoWorkingDir\omz_root" -ErrorAction Ignore - - [System.Environment]::SetEnvironmentVariable("OMZ_ROOT","$OpenVinoWorkingDir\omz_root", "User") - Add_Path "C:\Program Files\CMake\bin;C:\Intel\OpenCV\opencv\build\bin" - $ENV:Path | Out-Host - -## why download master.zip? It does not get used later(?). open_model_zoo gets clone from git! -ce -# -# #Start-BitsTransfer "https://github.com/openvinotoolkit/open_model_zoo/archive/refs/heads/master.zip" -Destination "$OpenVinoWorkingDir" -# if ( Test-Path "$OpenVinoWorkingDir\master.zip" ) { -# Write-Host "SKIP: Download of open_model_zoo master.zip -- file exists" -# } else { -# Write-Host "Downloading open_model_zoo master.zip file..." -# C:\Windows\system32\curl.exe -L -o "$OpenVinoWorkingDir\master.zip" "https://github.com/openvinotoolkit/open_model_zoo/archive/refs/heads/master.zip" -# if ( $? -ne $True ) { -# Write-host "WARNING: Command failed." -# } -# } -# # - - get-package 'git' 2>&1 | Out-Null - if ( $? -eq $False ) { - Write-Host "Please manually install git and then clone repos with the following commands:" - Write-Host " git clone https://github.com/openvinotoolkit/open_model_zoo.git" - Write-Host " git clone --depth=1 https://github.com/openvinotoolkit/openvino_notebooks.git" - Write-Host " git clone https://github.com/microsoft/onnxruntime" - Write-Host " git clone --recurse-submodules https://github.com/huggingface/optimum-intel" - exit 1 - } - #Write-Host " git clone --recurse-submodules https://github.com/webmachinelearning/webnn-samples" - - if ( -Not ( Test-Path "openvino_notebooks" ) ) { - Start-Process -FilePath "C:\Program Files\Git\bin\git.exe" -ArgumentList "clone --depth=1 https://github.com/openvinotoolkit/openvino_notebooks.git" -Wait - } else { - Write-Host "SKIP cloneing (folder exists): openvino_notebooks" - } - - if ( -Not ( Test-Path "open_model_zoo" ) ) { - Start-Process -FilePath "C:\Program Files\Git\bin\git.exe" -ArgumentList "clone --depth=1 https://github.com/openvinotoolkit/open_model_zoo.git" -Wait - } else { - Write-Host "Skip cloning (folder exists): open_model_zoo" - } - - if ( -Not ( Test-Path "onnxruntime" ) ) { - Start-Process -FilePath "C:\Program Files\Git\bin\git.exe" -ArgumentList "clone https://github.com/microsoft/onnxruntime" -Wait - } else { - Write-Host "Skip cloning (folder exists): onnxruntime" - } - - if ( -Not ( Test-Path "optimum-intel" ) ) { - Start-Process -FilePath "C:\Program Files\Git\bin\git.exe" -ArgumentList "clone --recurse-submodules https://github.com/huggingface/optimum-intel" -Wait - } else { - Write-Host "Skip cloning (folder exists): optimum-intel" - } - - - Install_Packages_in_Virtual_Environment - - Set-Location "$OpenVinoWorkingDir\openvino_notebooks" - - Write-Host "OpenVINO Installation is done. Also openvino_notebooks project has been checked out" -} diff --git a/archive_ps_codebase/LICENSE b/archive_ps_codebase/LICENSE deleted file mode 100644 index cf75ceb..0000000 --- a/archive_ps_codebase/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2024 Intel Corporation - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/archive_ps_codebase/README.md b/archive_ps_codebase/README.md deleted file mode 100644 index 7831bc4..0000000 --- a/archive_ps_codebase/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# aipc-devkit-install -AI PC Dev Kit Installation Scripts - -* Run the script on a test system per the instructions below. -* Please also see the setup and usage instructions for these independent sub-project(s): - * [WebNN demo](WebNN-demo/WebNN-demo.md) - -# One-time setup instructions -1. Install Windows on the system. -2. Open an administrative PowerShell -3. Enable PowerShell scripts execution, either in dev Settings or by running the command: - ```Set-ExecutionPolicy -ExecutionPolicy bypass -Force``` -4. Download and rename the file IntelOpenVinoSetupV5.txt to IntelOpenVinoSetupV5.ps1. Run the script ```./IntelOpenVinoSetupV5.ps1``` - (Note that there may be some installation errors due to connection issue when running the installation script. Please run multiple times of this installation script if you get errors when running the following command.) -5. The script downloads and runs through installation of various AI software. Please accept licenses accordingly. -6. Run the command ```benchmark_app -h```. The last line of output should look something like this: - ``` - Available target devices: CPU GPU NPU - ``` - If benchmark_app is not found, then activate the virtual environment with the following command and try again. - ``` - C:\Intel\venv\Scripts\activate.ps1 - ``` - -# Instructions for running Notebooks -0. After running the install script, cd to C:\Intel\openvino_notebooks. - Assuming you are still in a Powershell: ```Set-Location C:\Intel\openvino_notebooks```. -1. Start Jupyter Notebooks - * To run notebooks in a browser: - * Start the notebooks by running this in command prompt - ```jupyter lab notebooks```, and follow the instructions to start the interface on browser (e.g., localhost:8080/lab) - * Or to run notebooks in Visual Studio Code - * Type the command ```code notebooks``` - -2. In the browser or VSCode sidebar navigate to one of the following notebooks and run it to verify correct execution (requires internet connection). - * hello-world\hello-world.ipynb - * llm-chatbot\llm-chatbot.ipynb - * yolov8-optimization\yolov8-instance-segmentation.ipynb - -# Notebooks Showcases -https://openvinotoolkit.github.io/openvino_notebooks/ - - diff --git a/archive_ps_codebase/WebNN-demo/WebNN-demo.md b/archive_ps_codebase/WebNN-demo/WebNN-demo.md deleted file mode 100644 index 879501e..0000000 --- a/archive_ps_codebase/WebNN-demo/WebNN-demo.md +++ /dev/null @@ -1,29 +0,0 @@ -# First-time setup -* Download the Google Chrome Canary for Windows 11 installer from https://www.google.com/chrome/canary/. - Run the downloaded file, "ChromeSetup.exe", to download and install Google Chrome Canary. - -* Navigate to the “chrome://flags” page. - -* Find “Enables WebNN API” and set it to "Enabled", then click "Relaunch" - - ![](images/Enable-WebNN-API.png) - ![](images/Relaunch.png) - -# Demo Instructions - -1. Open a command shell and enter the following commands to start a local server - > cd C:\intel\webnn-samples - > python -m http.server -b 127.0.0.1 8000 - - _If a Windows security prompt appears, click Allow_ - -2. Go to the Google Chrome Canary browser window. -Use the Windows start menu to launch Google Chrome Canary if it is not already running. - -3. In the browser's URL bar, type ```http://127.0.0.1:8000``` and press the Enter key. - -4. Move the mouse over "Image Classification" and click "Explore". -![](images/Image-Classification-explore.png) - -5. Select Backend:WebNN and Model:SqueezeNet -![](images/image-classification-backend-model.png) diff --git a/archive_ps_codebase/WebNN-demo/images/Enable-WebNN-API.png b/archive_ps_codebase/WebNN-demo/images/Enable-WebNN-API.png deleted file mode 100644 index 7d26528..0000000 Binary files a/archive_ps_codebase/WebNN-demo/images/Enable-WebNN-API.png and /dev/null differ diff --git a/archive_ps_codebase/WebNN-demo/images/Image-Classification-explore.png b/archive_ps_codebase/WebNN-demo/images/Image-Classification-explore.png deleted file mode 100644 index d12557a..0000000 Binary files a/archive_ps_codebase/WebNN-demo/images/Image-Classification-explore.png and /dev/null differ diff --git a/archive_ps_codebase/WebNN-demo/images/Relaunch.png b/archive_ps_codebase/WebNN-demo/images/Relaunch.png deleted file mode 100644 index 5dbaf5c..0000000 Binary files a/archive_ps_codebase/WebNN-demo/images/Relaunch.png and /dev/null differ diff --git a/archive_ps_codebase/WebNN-demo/images/image-classification-backend-model.png b/archive_ps_codebase/WebNN-demo/images/image-classification-backend-model.png deleted file mode 100644 index 3d60a00..0000000 Binary files a/archive_ps_codebase/WebNN-demo/images/image-classification-backend-model.png and /dev/null differ diff --git a/build/Build.bat b/build/Build.bat deleted file mode 100644 index eac4d35..0000000 --- a/build/Build.bat +++ /dev/null @@ -1,66 +0,0 @@ -@echo off -REM Copyright (C) 2024 Intel Corporation -REM Author: Krishna Lakhotia -REM Author: Balasubramanyam Agalukote Lakshmipathi - -REM This software and the related documents are Intel copyrighted materials, and your use of them is -REM governed by the express license under which they were provided to you ("License"). Unless the -REM License provides otherwise, you may not use, modify, copy, publish, distribute, disclose or -REM transmit this software or the related documents without Intel's prior written permission. - -REM This software and the related documents are provided as is, with no express or implied warranties, -REM other than those that are expressly stated in the License. -SetLocal EnableExtensions DisableDelayedExpansion - -For %%A In (Cmd Reg)Do Set "%%A=%SystemRoot%\System32\%%A.exe" - -set "PYTHON_REG_KEY=HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\3.10\InstallPath" -Set "Dir=" -For /F "Tokens=2*" %%A In (' - ""%Cmd%" /D /C ""%Reg%" Query "%PYTHON_REG_KEY%" /V "" 2^>Nul""')Do Set "Dir=%%~B" - -If Defined Dir GoTo found - -set "PYTHON_REG_KEY=HKEY_CURRENT_USER\Software\Python\PythonCore\3.10\InstallPath" -For /F "Tokens=2*" %%A In (' - ""%Cmd%" /D /C ""%Reg%" Query "%PYTHON_REG_KEY%" /V "" 2^>Nul""')Do Set "Dir=%%~B" - -If Defined Dir GoTo found - -set "Dir=C:\Python310" -If Exist "%Dir%\python.exe" GoTo found -GoTo end - -:found -If "%Dir:~-1%"=="\" Set "PYTHON_INSTALLPATH=%Dir:~,-1%" - -echo " Start Building Intel AI PC Development Kit" -set arg1=%BuildVersion% -CD .. -IF "%arg1%"=="" set arg1=1.1.0.0 - -create-version-file installer_metadata.yml --outfile file_version_info.txt --version %arg1% - -REM Verify the version file creation -if not exist file_version_info.txt ( - echo file_version_info.txt was not created. - exit /b 1 -) - -pyinstaller --clean --onefile Script/ui_installer.py --add-data Configuration/installation_config.json:. --add-data License.txt:. --add-data Prerequisites/PythonModules/requirements.txt:Prerequisites/PythonModules/requirements.txt --paths Script --paths hooks\rthooks --version-file=file_version_info.txt --name installer.exe --runtime-hook hooks\rthooks\pyi_rth_installer.py --add-binary "%PYTHON_INSTALLPATH%\python3.dll":. - -Del file_version_info.txt - -create-version-file uninstaller_metadata.yml --outfile file_version_info.txt --version %arg1% - -REM Verify the version file creation -if not exist file_version_info.txt ( - echo file_version_info.txt was not created. - exit /b 1 -) - -pyinstaller --clean --onefile Script/uninstall.py --add-data Configuration/installation_config.json:. --add-data Prerequisites/PythonModules/requirements.txt:Prerequisites/PythonModules/requirements.txt --paths Script --paths hooks\rthooks --version-file=file_version_info.txt --runtime-hook hooks\rthooks\pyi_rth_installer.py --add-binary "%PYTHON_INSTALLPATH%\python3.dll":. - -GoTo :EOF -:end -echo "Python installation path not defined" diff --git a/build/LocalBuild.bat b/build/LocalBuild.bat deleted file mode 100644 index 2fe1ef2..0000000 --- a/build/LocalBuild.bat +++ /dev/null @@ -1,26 +0,0 @@ -@echo off -REM Copyright (C) 2024 Intel Corporation -REM Author: Krishna Lakhotia -REM Author: Balasubramanyam Agalukote Lakshmipathi - -REM This software and the related documents are Intel copyrighted materials, and your use of them is -REM governed by the express license under which they were provided to you ("License"). Unless the -REM License provides otherwise, you may not use, modify, copy, publish, distribute, disclose or -REM transmit this software or the related documents without Intel's prior written permission. - -REM This software and the related documents are provided as is, with no express or implied warranties, -REM other than those that are expressly stated in the License. - -echo " Start Building Intel AI PC Development Kit" -CD .. -create-version-file installer_metadata.yml --outfile file_version_info.txt -pyinstaller --clean --onefile Script/installer.py --add-data Configuration/installation_config.json:. --version-file=file_version_info.txt - -create-version-file uninstaller_metadata.yml --outfile file_version_info.txt -pyinstaller --clean --onefile Script/uninstall.py --add-data Configuration/installation_config.json:. --paths Script --version-file=file_version_info.txt - -echo " Start Building Intel AI PC Development Kit zip file" -cd Build -.\7ZipToImage\7ZipToImage-1.0.0\7za.exe a ..\dist\IntelAIPCDevelopmentKit.zip ..\dist\installer.exe -.\7ZipToImage\7ZipToImage-1.0.0\7za.exe a -xr@exclude.txt ..\dist\IntelAIPCDevelopmentKit.zip ..\Prerequisites -.\7ZipToImage\7ZipToImage-1.0.0\7za.exe a -xr@exclude.txt ..\dist\IntelAIPCDevelopmentKit.zip ..\AIDevKit diff --git a/build/RequirementGenBackup.bat b/build/RequirementGenBackup.bat deleted file mode 100644 index 22cb80d..0000000 --- a/build/RequirementGenBackup.bat +++ /dev/null @@ -1,57 +0,0 @@ -@echo off -REM Copyright (C) 2024 Intel Corporation -REM Author: Krishna Lakhotia -REM Author: Balasubramanyam Agalukote Lakshmipathi - -REM This software and the related documents are Intel copyrighted materials, and your use of them is -REM governed by the express license under which they were provided to you ("License"). Unless the -REM License provides otherwise, you may not use, modify, copy, publish, distribute, disclose or -REM transmit this software or the related documents without Intel's prior written permission. - -REM This software and the related documents are provided as is, with no express or implied warranties, -REM other than those that are expressly stated in the License. - -SetLocal EnableExtensions DisableDelayedExpansion - -For %%A In (Cmd Reg)Do Set "%%A=%SystemRoot%\System32\%%A.exe" - -set "PYTHON_REG_KEY=HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\3.10\InstallPath" -Set "Dir=" -For /F "Tokens=2*" %%A In (' - ""%Cmd%" /D /C ""%Reg%" Query "%PYTHON_REG_KEY%" /V "" 2^>Nul""')Do Set "Dir=%%~B" - -If Defined Dir GoTo found - -set "PYTHON_REG_KEY=HKEY_CURRENT_USER\Software\Python\PythonCore\3.10\InstallPath" -For /F "Tokens=2*" %%A In (' - ""%Cmd%" /D /C ""%Reg%" Query "%PYTHON_REG_KEY%" /V "" 2^>Nul""')Do Set "Dir=%%~B" - -If Defined Dir GoTo found - -set "Dir=C:\Python310" -If Exist "%Dir%\python.exe" GoTo found -GoTo end - -:found -If "%Dir:~-1%"=="\" Set "PYTHON_INSTALLPATH=%Dir:~,-1%" - -CD .. -REM Ensuring pip-tools is installed -"%PYTHON_INSTALLPATH%\python.exe" -m pip install pip-tools - -REM Compile the requirements and Generating New Requirements.txt -pip-compile Prerequisites\PythonModules\requirementsbase.in -o Prerequisites\PythonModules\requirementsnew.txt - -REM Check if requirements.txt exists and rename it if it does -if exist Prerequisites\PythonModules\requirements.txt ( - ECHO Renaming the requirement to requirements_old.txt - move /Y Prerequisites\PythonModules\requirements.txt Prerequisites\PythonModules\requirements_old.txt -) - -REM Copy the new requirements file -ECHO Renaming the newrequirement to requirements.txt -copy /Y Prerequisites\PythonModules\requirementsnew.txt Prerequisites\PythonModules\requirements.txt - -GoTo :EOF -:end -echo "Python installation path not defined" diff --git a/documents/readme.txt b/documents/readme.txt deleted file mode 100644 index f06c044..0000000 --- a/documents/readme.txt +++ /dev/null @@ -1,112 +0,0 @@ ------------------------------------------------------------------------ -Intel® AI PC Development Kit -VERSION 2024.10.2 README -October 30 2024. ------------------------------------------------------------------------ - - -README Contents -============================================ -1. Introduction -2. System Requirements -3. Installation Instructions -4. Uninstallation Instructions -5. Usage Information -6. Known Issues -7. License Agreement - - -1. Introduction -============================================ -This readme file contains information on the Intel(R) AI PC Development Kit - -The Intel(R) AI PC Development Kit will install below listed softwares on your system: - -- Python : 3.10.11 -- Visual Studio Code : 1.91.0 -- Git : 2.46.0 -- Vim : 9.1.0 -- Visual C++ Redistributable : 14.32.31332.0 -- Cmake : 3.30.2 -- OpenCV : 4.10.0 -- Intel Driver & Support Assistant : 24.4.32.8 -- OpenVino : 2024.4.1 -- OpenVino Notebooks : 2024.4 -- Intel Demos : 2024.4 -- Open Model Zoo : 2024.3.0 -- Dependent Python Modules - -2. System Requirements -============================================ -a. Windows 11 Operating System. -b. The system must be connected to the Internet. -c. Set system environment variables: - 1c. PIP_TRUSTED_HOST= pypi.org files.pythonhosted.org - -3. Installation Instructions -============================================ -a. Copy IntelAIPCDevkit_2024.10.2.zip in C:\Intel\Setup. -b. Unzip the contents of the zip to the Setup folder. -c. Traverse to C:\Intel\Setup\IntelAIPCDevkit_2024.10.2 folder -d. Run “installer.exe” with admin privileges. -e. The license agreement will appear, click on "I accept the license agreement" to start installation. -f. Click on Install. -g. Installation will start, software's lusted in section 1 will be installed in a sequence. -h. Accept the licenses as needed. -i. The installations will continue with default installation options. -j. After the installation completes, the AI PC virtual environment will be available, Jupyter Notebook will open in the browser. - -4. Uninstallation Instructions -============================================ -1. The uninstaller can be found in the path - C:\Intel\aipcdevkit -2. Run uninstall.exe with admin privileges to remove all the software's that were installed as part of the installation process. Please note that IDSA is not uninstalled as part of this. -3. Uninstallation logs also will not be removed and can be found in the path - C:\Intel\UninstallLogs - -5. Usage Information -============================================ - -a. Setup browser to enable WebNN flags. This is not enabled by default for security reasons. -- For Google Chrome: Type chrome://flags in the browser and search for WebNN. Select Enabled in the dropdown that appears. -- For Microsoft Edge: Type edge://flags in the browser and search for WebNN. Select Enabled in the dropdown that appears. - -b.You can restart Jupyter labs anytime after the installation, by running start_lab.cmd from the path - C:\Intel\aipcdevkit. - -6. Known Issues -============================================ -a. Unable to download software's listed in section 2.4 -Make sure proxies are SET as required. - -b. Jupyter Kernel not working -Jupyter Lab Kernel HTTP Connection error is observed, due to which no python modules are able to install. - -Add Environment variable - PIP_TRUSTED_HOST= pypi.org files.pythonhosted.org - -c. git+https module is not working -git+https module is not working on dev kit for jupyter notebooks thats why not able to run any notebooks which uses huggingface model and intel optimum package. - -Add Environment variable - PIP_TRUSTED_HOST= pypi.org files.pythonhosted.org - -7. License Agreement -============================================ - -Copyright © 2024 Intel Corporation - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in the -Software without restriction, including without limitation the rights to use, copy, -modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, -and to permit persons to whom the Software is furnished to do so, subject to the -following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. diff --git a/hooks/rthooks/pyi_rth_installer.py b/hooks/rthooks/pyi_rth_installer.py deleted file mode 100644 index c850d88..0000000 --- a/hooks/rthooks/pyi_rth_installer.py +++ /dev/null @@ -1,197 +0,0 @@ -## Copyright (C) 2024 Intel Corporation -## Author: Krishna Lakhotia -## Author: Balasubramanyam Agalukote Lakshmipathi -## -## This software and the related documents are Intel copyrighted materials, and your use of them is -## governed by the express license under which they were provided to you ("License"). Unless the -## License provides otherwise, you may not use, modify, copy, publish, distribute, disclose or -## transmit this software or the related documents without Intel's prior written permission. -## -## This software and the related documents are provided as is, with no express or implied warranties, -## other than those that are expressly stated in the License. - -import os -import sys -import subprocess -import shutil -import platform -import re - -ACLS_CHANGED = False - - -class ACLChecks: - _user_allowlist = [ - "ADMINISTRATOR", - "ADMINISTRATORS", - "NT AUTHORITY", - "NT SERVICE", - "CREATOR", - "APPLICATION PACKAGE AUTHORITY", - "NT ", - ] - _permissions_blocklist = ["W", "M", "F", "D", "DE", "DC", "WDAC", "GW", "GA", "WD", "AD"] - - def __init__(self, file_name: str) -> None: - self.file_name = file_name - system32 = os.path.join( - os.environ["SystemRoot"], "SysNative" if platform.architecture()[0] == "32bit" else "System32" - ) - self.icacls_exe = os.path.join(system32, "icacls.exe") - - def get_acls(self): - acls = [] - cmd = [self.icacls_exe, self.file_name, "/Q"] - try: - output = subprocess.run(cmd, check=True, stdout=subprocess.PIPE, text=True).stdout - for line in output.splitlines(): - line = line.replace(self.file_name, "").strip().upper() - if line and not "SUCCESSFULLY PROCESSED" in line and not "FAILED PROCESSING" in line: - acls.append(line) - except (subprocess.CalledProcessError, OSError): - pass - return acls - - def remove_inheritance(self): - cmd = [self.icacls_exe, self.file_name, "/inheritancelevel:r", "/Q"] - try: - subprocess.call(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) - except: - pass - - def get_unsafe_users(self, acls=None): - unsafe_users = [] - if not acls: - acls = self.get_acls() - for user in acls: - if not any(allowed_user in user for allowed_user in self._user_allowlist): - unsafe_users.append(user) - return unsafe_users - - def unsafe_permission(self, acls=None): - unsafe = False - for user in self.get_unsafe_users(acls=acls): - acl_list = re.sub(r"[\(\)\s+]", ",", user.partition(":")[-1]) - acl_list = [acl.strip() for acl in acl_list.split(",") if acl.strip()] - if any(permission in acl_list for permission in self._permissions_blocklist): - unsafe = True - break - - return unsafe - - def fix_user_permissions(self, acls=None): - user_has_permission = False - current_user = os.getlogin() - if not acls: - acls = self.get_acls() - if any(current_user.upper() in acl_user for acl_user in acls): - user_has_permission = True - if not acls: - subprocess.call( - [self.icacls_exe, self.file_name, "/grant", current_user + ":(R)", "/Q", "/T"], - stdout=subprocess.DEVNULL, - stderr=subprocess.DEVNULL, - ) - subprocess.call( - [self.icacls_exe, self.file_name, "/grant", "Administrator" + ":(F)", "/Q", "/T"], - stdout=subprocess.DEVNULL, - stderr=subprocess.DEVNULL, - ) - subprocess.call( - [self.icacls_exe, self.file_name, "/grant", "System" + ":(F)", "/Q", "/T"], - stdout=subprocess.DEVNULL, - stderr=subprocess.DEVNULL, - ) - return - - for i in acls: - t = i.strip().split(":") - try: - u = t[0].strip().split("\\")[-1] - p = t[1].strip() - except: - continue - - if "administrator" in u.lower() or "system" in u.lower(): - subprocess.call( - [self.icacls_exe, self.file_name, "/grant", u + ":(F)", "/Q", "/T"], - stdout=subprocess.DEVNULL, - stderr=subprocess.DEVNULL, - ) - continue - subprocess.call([self.icacls_exe, self.file_name, "/remove", u, "/Q", "/T"]) - subprocess.call( - [self.icacls_exe, self.file_name, "/grant", u + ":(R)", "/Q", "/T"], - stdout=subprocess.DEVNULL, - stderr=subprocess.DEVNULL, - ) - - if not user_has_permission: - subprocess.call( - [self.icacls_exe, self.file_name, "/grant", current_user + ":(R)", "/Q", "/T"], - stdout=subprocess.DEVNULL, - stderr=subprocess.DEVNULL, - ) - - def reset_permissions(self): - cmd = [self.icacls_exe, self.file_name, "/reset", "/t"] - try: - subprocess.call(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) - except: - pass - - -def move_dlls(current_dir: str, destination_dir: str, restore: bool = False): - if not os.path.isdir(current_dir): - return - # restore should be set True when moving the dlls back to the original dir - if not restore: - try: - shutil.rmtree(destination_dir) - except: - pass - try: - os.makedirs(destination_dir, exist_ok=True) - except: - pass - - for dll_file in os.listdir(current_dir): - if dll_file.casefold().endswith(".dll"): - try: - shutil.move(os.path.join(current_dir, dll_file), destination_dir) - except: - pass - - if restore: - # If restore=True, the temporary folder(current_dir) created should be deleted - try: - shutil.rmtree(current_dir) - except: - pass - - -def restore_original(temporary_dir, application_dir, acl_changed=False): - if acl_changed: - acl_check = ACLChecks(file_name=application_dir) - acl_check.reset_permissions() - global ACLS_CHANGED - ACLS_CHANGED = False - move_dlls(temporary_dir, application_dir, restore=True) - - -def _pyi_rthook(): - application_dir = os.path.dirname(sys.executable) - relocation_dir = os.path.join(application_dir, "temporary_folder_AIDevKit") - move_dlls(application_dir, relocation_dir) - acl_check = ACLChecks(file_name=application_dir) - current_acls = acl_check.get_acls() - if acl_check.unsafe_permission(acls=current_acls): - global ACLS_CHANGED - ACLS_CHANGED = True - acl_check.remove_inheritance() - acl_check.fix_user_permissions(acls=current_acls) - - -if __name__ == "__main__": - _pyi_rthook() - del _pyi_rthook diff --git a/installer_metadata.yml b/installer_metadata.yml deleted file mode 100644 index 6315c0e..0000000 --- a/installer_metadata.yml +++ /dev/null @@ -1,10 +0,0 @@ -Version: 1.0.0.dev0 -CompanyName: Intel® Corporation -FileDescription: Intel® AI PC Development Kit -InternalName: Intel® AI PC Development Kit -LegalCopyright: Copyright © Intel Corporation. All rights reserved -OriginalFilename: installer.exe -ProductName: Intel® AI PC Development Kit -Translation: - - langID: 0x0409 - charsetID: 1200 diff --git a/uninstaller_metadata.yml b/uninstaller_metadata.yml deleted file mode 100644 index 7cce101..0000000 --- a/uninstaller_metadata.yml +++ /dev/null @@ -1,10 +0,0 @@ -Version: 1.0.0.dev0 -CompanyName: Intel® Corporation -FileDescription: Intel® AI PC Development Kit -InternalName: Intel® AI PC Development Kit -LegalCopyright: Copyright © Intel Corporation. All rights reserved -OriginalFilename: uninstaller.exe -ProductName: Intel® AI PC Development Kit -Translation: - - langID: 0x0409 - charsetID: 1200