├── .dockerignore ├── .github └── FUNDING.yml ├── .gitignore ├── LICENSE ├── README.md ├── base └── Dockerfile ├── build-docker-images.sh ├── download-tools.sh ├── msvc-cpp ├── .conan2 │ └── profiles │ │ └── default ├── Dockerfile ├── wine64-entrypoint └── x64.bat ├── test ├── CMakeLists.txt ├── README.md ├── build.bat ├── conanfile.py ├── run.sh └── test.cpp └── vagrant ├── Vagrantfile ├── install_tools.ps1 └── packages └── .PLACEHOLDER /.dockerignore: -------------------------------------------------------------------------------- 1 | * 2 | !vagrant/packages/*.zip 3 | !msvc-cpp/ -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: madduci 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | vagrant/packages/*.zip 2 | vagrant/.vagrant 3 | test/build 4 | test/*.json -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018-2024 Michele Adduci 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # docker-msvc-cpp 2 | 3 | This is a reproducible Linux-based Dockerfile for cross compiling with MSVC compiler, Conan, CMake, Ninja and Wix Toolset, usable as base image for Continuous Integration setups. 4 | 5 | This requires a zipped package of a real MSVC installation from Windows 6 | (currently only supporting MSVC 2022, tested until latest 17.8.5), which isn't freely redistributable, so you have to build it on your own. 7 | 8 | The MSVC installation can be performed using a Vagrant box and executing the installation of MSVC Community Edition: a Vagrantfile and a Powershell script to prepare the require packages are included in this repository. 9 | 10 | ## Requirements 11 | 12 | ### Hardware 13 | 14 | * Dual-Core CPU, with VT-x/AMD-v enabled 15 | * 8 GByte RAM (16 GByte recommended) 16 | * Enough Disk Space for Vagrant and Docker images (50 GByte free recommended) 17 | * Fast internet connection 18 | 19 | ### Software 20 | 21 | * Virtualbox (7.x) 22 | * Vagrant (2.x) 23 | * Docker Engine 20+ 24 | 25 | #### Vagrant Plugins 26 | 27 | * winrm 28 | * winrm-elevated 29 | 30 | ## Build 31 | 32 | To build the docker image, you need to run the following commands: 33 | 34 | ``` 35 | # starts the Vagrant box, installs MSVC and the other tools and prepares the zip packages 36 | ./download-tools.sh 37 | # Builds the docker images (the Ubuntu 22.04 image with wine and the one including also the tools) 38 | ./build-docker-images.sh 39 | ``` 40 | 41 | The first script will start a Vagrant/Virtualbox Virtual Machine with Windows 10, which will execute an unattended installation of Visual C++ tools, together with CMake, Conan and Wix Toolset. Once the installation is completed, the required files will be compressed in ZIP archives and put on the host machine. 42 | 43 | The second script will launch in background a python server on port 20000, self-hosting the ZIP archives and then build 2 docker images: 44 | 45 | * **docker-wine**, with only wine-stable (9.0 at time of writing), .NET 4.8 and initialized as Windows 10 46 | * **docker-wine-msvc**, with the required Visual C++ tools and libraries (cl, link, nmake, rc), the latest Windows 10 SDK, CMake, Conan, Ninja and Wix. 47 | 48 | ## Usage 49 | 50 | After building the final docker image, the working directory in the docker image is set to `/home/wine/.wine/drive_c/` and in the `/home/wine/.wine/drive_c/Tools` folder are stored all the required tools, plus a batch file that can set the 64 bit environment, in the specific: 51 | 52 | - /home/wine/.wine/drive_c/x64.bat 53 | 54 | It contains all the required Windows paths in Windows-style format (as 'C:\..'). 55 | 56 | The entrypoint of the Docker Image is set to be a `wine64-entrypoint` bash script that loads the 64bit Windows CMD console that waits for commands. 57 | 58 | To start the image and execute a prepared Windows command or script, you **have to** call it with double-double quotes as follows: 59 | ``` 60 | docker run --rm -it -v HOST_PATH_TO_MOUNT:TARGET_PATH madduci/docker-wine-msvc:17.8-2022 ""YOUR_SCRIPT_IN_TARGET_PATH"" 61 | 62 | docker run --rm -it madduci/docker-wine-msvc:17.8-2022 ""conan install --requires=openssl/3.2.0"" 63 | ``` 64 | 65 | alternatively, to issue interactive commands: 66 | 67 | ``` 68 | docker run --rm -it -v HOST_PATH_TO_MOUNT:TARGET_PATH madduci/docker-wine-msvc:17.8-2022 69 | C:>cl /? 70 | C:>conan --version 71 | C:>cmake --version 72 | ``` 73 | 74 | ## Caveats 75 | 76 | ### Encoding 77 | 78 | There are small issues when dealing with Windows-1252 encoding, that are unfortunately wine issues. For example, it has been observed that file names with bad encoding cannot be handled in the Windows CMD. 79 | 80 | ### Visual C++ 81 | 82 | It has been noticed that on some code, the 32 Bit compiler triggers internal compiler errors (like `C1001`), especially when dealing with some Windows-specific header file, such as ATL/MFC related code. The 32 Bit compiler is therefore not enabled. On a 64 Bit build, those problems don't appear and the build works fine. It seems that some compiler flags are also affecting those 32 Bit builds. 83 | 84 | ### CMake 85 | 86 | The *Visual Studio* CMake generator doesn't work, due to issues with MSBuild and wine. CMake can be used only with *NMake Makefiles* or, if you prefer, with *Ninja*, already included in the image. See the `test` project contained in this repository. 87 | 88 | In order to work under Wine/CMD, CMake requires the environment variable **MSVC_REDIST_DIR** and that must be transformed in Unix Path format. 89 | 90 | ``` 91 | set(MSVC_REDIST_DIR $ENV{VCToolsRedistDir}) 92 | string(REPLACE "\\" "/" MSVC_REDIST_DIR "${MSVC_REDIST_DIR}") 93 | ``` 94 | 95 | ### Conan 96 | 97 | Conan v2 by default tries to use Visual Studio as generator when used with CMake, but you can override it by using the extra configuration parameter `-c tools.cmake.cmaketoolchain:generator=Ninja`. 98 | 99 | The extended image comes also with Ninja, so you can speed up your builds by setting "Ninja" as generator, instead of "NMake MakeFiles". This is the default choice, as the default profile is configured with the CMake Generator set to "Ninja" in the x64.bat script. 100 | 101 | ### WIX Toolset 102 | 103 | Wix by default attempts to validate the generated MSI setup files and it can return the error LIGHT216. 104 | In case you have an incomplete setup (as in the test folder) or have issues with your Wix/MSI settings, you can pass the `-sval` flag to Wix `light` command in your CPack configuration: 105 | 106 | ``` 107 | # LIGHT216 error while building MSI package under wine 108 | set(CPACK_WIX_LIGHT_EXTRA_FLAGS -sval ) 109 | ``` 110 | -------------------------------------------------------------------------------- /base/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:22.04 2 | 3 | LABEL maintainer="Michele Adduci " 4 | 5 | ENV WINEARCH=win64 \ 6 | WINEDEBUG=-all,err \ 7 | DISPLAY=:0.0 \ 8 | WINETRICKS_VERSION=20240105 9 | 10 | RUN export DEBIAN_FRONTEND="noninteractive" \ 11 | && echo "Configuring Ubuntu with equired tools for Wine" \ 12 | && apt-get update \ 13 | && apt-get install -y \ 14 | gnupg2 \ 15 | ca-certificates \ 16 | curl \ 17 | p7zip \ 18 | unzip \ 19 | xz-utils \ 20 | zenity \ 21 | cabextract \ 22 | binutils \ 23 | winbind \ 24 | && echo "Configuring WineHQ mirror" \ 25 | && dpkg --add-architecture i386 \ 26 | && curl -L https://dl.winehq.org/wine-builds/winehq.key -o /etc/apt/winehq.key \ 27 | && apt-key add /etc/apt/winehq.key \ 28 | && echo "deb https://dl.winehq.org/wine-builds/ubuntu/ focal main" >> /etc/apt/sources.list \ 29 | && apt-get update \ 30 | && apt-get install -y --install-recommends \ 31 | winehq-stable \ 32 | && echo "Download winetricks" \ 33 | && curl -L https://raw.githubusercontent.com/Winetricks/winetricks/${WINETRICKS_VERSION}/src/winetricks -o /usr/local/bin/winetricks \ 34 | && chmod +rx /usr/local/bin/winetricks \ 35 | && echo "Cleaning system" \ 36 | && apt-get autoclean \ 37 | && apt-get clean \ 38 | && apt-get autoremove --purge \ 39 | && rm -rf /var/apt/cache/* \ 40 | && rm -rf /tmp/* \ 41 | && echo "Creating wine user" \ 42 | && mkdir -p /home/wine \ 43 | && useradd --system -d /home/wine --shell /bin/bash --uid 1000 --gid root wine \ 44 | && chown -R wine /home/wine 45 | 46 | USER wine 47 | 48 | WORKDIR /home/wine 49 | 50 | RUN echo "Initializing the wine environment for the current user" \ 51 | && wine wineboot --init \ 52 | && while pgrep wineserver > /dev/null; do sleep 1; done \ 53 | && winetricks --unattended win10 \ 54 | && echo "Installing .Net 4.8" \ 55 | && winetricks --unattended --force dotnet48 \ 56 | && echo "Deleting cache files" \ 57 | && rm -rf /home/wine/.cache/* 58 | 59 | ENTRYPOINT [ "/bin/bash", "-c", "wine64 cmd" ] -------------------------------------------------------------------------------- /build-docker-images.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Re-Build base Docker Wine image 4 | docker build --no-cache -t madduci/docker-wine:9-stable -f base/Dockerfile base/ 5 | 6 | # Build extended Docker Image (with CMake, Wix and Conan) 7 | docker build --no-cache -t madduci/docker-wine-msvc:17.8-2022 -f msvc-cpp/Dockerfile . -------------------------------------------------------------------------------- /download-tools.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | cd vagrant 3 | 4 | vagrant up 5 | vagrant halt 6 | vagrant destroy -f 7 | 8 | cd .. 9 | -------------------------------------------------------------------------------- /msvc-cpp/.conan2/profiles/default: -------------------------------------------------------------------------------- 1 | [settings] 2 | arch=x86_64 3 | build_type=Release 4 | compiler=msvc 5 | compiler.cppstd=20 6 | compiler.runtime=dynamic 7 | compiler.version=193 8 | os=Windows 9 | 10 | [conf] 11 | tools.cmake.cmaketoolchain:generator=Ninja 12 | -------------------------------------------------------------------------------- /msvc-cpp/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM madduci/docker-wine:9-stable as sources 2 | 3 | USER root 4 | 5 | COPY vagrant/packages/ /home/wine/ 6 | ADD https://github.com/git-for-windows/git/releases/download/v2.43.0.windows.1/MinGit-2.43.0-busybox-64-bit.zip Git.zip 7 | 8 | RUN echo "Extracting Visual C++ compiler" \ 9 | && mkdir -p Tools/VS2022 \ 10 | && unzip -d Tools/VS2022/ -q VC2022.zip; \ 11 | echo "Removing telemetry tool VCTIP from VC" \ 12 | && (find Tools/VS2022/ -type f -name 'VCTIP.exe' -exec rm -rf "{}" \; || echo "Done") \ 13 | && echo "Removing LLVM libraries from VC" \ 14 | && (find Tools/VS2022/ -type d -name 'Llvm' -exec rm -rf "{}" \; || echo "Done") \ 15 | && echo "Removing Hostx86 folder from VC" \ 16 | && (find Tools/VS2022/ -type d -name 'Hostx86' -exec rm -rf "{}" \; || echo "Done") \ 17 | && echo "Extracting Windows SDK" \ 18 | && mkdir -p Tools/SDK \ 19 | && unzip -d Tools/SDK/ -q SDK.zip; \ 20 | echo "Removing arm libraries from SDK" \ 21 | && (find ./Tools/SDK -type d -name 'arm*' -exec rm -rf "{}" \; || echo "Done") \ 22 | && echo "Removing old SDK versions" \ 23 | && (find ./Tools/SDK -type d -name '10.0.1[4-6]???.0' -exec rm -rf "{}" \; || echo "Done") \ 24 | && echo "Extracting CMake" \ 25 | && unzip -d Tools/ -q CMake.zip; \ 26 | echo "Extracting Conan" \ 27 | && unzip -d Tools/ -q Conan.zip; \ 28 | echo "Extracting Ninja" \ 29 | && unzip -d Tools/Ninja -q Ninja.zip; \ 30 | echo "Extracting Wix Toolset" \ 31 | && unzip -d Tools/Wix -q WIX.zip; \ 32 | echo "Extracting Git" \ 33 | && unzip -d Tools/Git -q Git.zip; 34 | 35 | FROM madduci/docker-wine:9-stable 36 | 37 | LABEL maintainer="Michele Adduci " 38 | 39 | # Set batch script to set 64 Bit environment 40 | COPY --chown=wine:root msvc-cpp/x64.bat /home/wine/.wine/drive_c/x64.bat 41 | 42 | # Set an application entrypoint that loads automatically the environment variables 43 | COPY --chown=wine:root msvc-cpp/wine64-entrypoint /usr/local/bin/wine64-entrypoint 44 | 45 | # Prepare Conan profile 46 | ADD --chown=wine:root msvc-cpp/.conan2 /home/wine/.wine/drive_c/users/wine/.conan2 47 | 48 | WORKDIR /home/wine/.wine/drive_c 49 | 50 | COPY --from=sources --chown=wine:root /home/wine/Tools /home/wine/.wine/drive_c/Tools 51 | 52 | USER root 53 | 54 | RUN echo "Fix Permissions" \ 55 | && chmod +x /usr/local/bin/wine64-entrypoint \ 56 | && chown -R wine:root ./Tools Tools/VS2022 Tools/SDK || echo "Done" \ 57 | && chmod -R 775 ./Tools Tools/VS2022 Tools/SDK || echo "Done" ; 58 | 59 | RUN sed -i 's/manager/store/g' /home/wine/.wine/drive_c/Tools/Git/etc/gitconfig 60 | 61 | USER wine 62 | 63 | ENTRYPOINT [ "/usr/local/bin/wine64-entrypoint" ] 64 | -------------------------------------------------------------------------------- /msvc-cpp/wine64-entrypoint: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cat > /home/wine/.wine/drive_c/entrypoint.bat < 2 | 3 | int main() 4 | { 5 | #ifdef _WIN64 6 | std::cout << "Hello from MSVC Wine 64!\n"; 7 | #else 8 | std::cout << "Hello from MSVC Wine 32!\n"; 9 | #endif 10 | return 0; 11 | } -------------------------------------------------------------------------------- /vagrant/Vagrantfile: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | Vagrant.configure("2") do |config| 5 | 6 | config.vm.box = "gusztavvargadr/windows-10" 7 | # Share an additional folder to the guest VM. 8 | # config.vm.synced_folder "../data", "/vagrant_data" 9 | config.vm.synced_folder "packages/", "C:\\Packages" 10 | 11 | config.vm.provider "virtualbox" do |vb| 12 | vb.name = "windows-10-cpp" 13 | vb.gui = true 14 | vb.cpus = 2 15 | vb.memory = "4098" 16 | end 17 | 18 | config.winrm.timeout = 1800 # 30 minutes 19 | config.vm.boot_timeout = 1800 # 30 minutes 20 | 21 | config.vm.provision "shell", path: "install_tools.ps1" 22 | end 23 | -------------------------------------------------------------------------------- /vagrant/install_tools.ps1: -------------------------------------------------------------------------------- 1 | ############################################ 2 | # 3 | # Author; Michele Adduci 4 | # Copyright 2019-Today. All rights reserved 5 | # 6 | # Powershell script to download and install automatically 7 | # Visual C++ 2019 tools, CMake, Conan, WIX and Ninja 8 | # 9 | ############################################ 10 | 11 | #################################### 12 | # Define Variables 13 | #################################### 14 | $start_time = Get-Date 15 | # Define where to download all the installers required 16 | $working_directory = "$env:temp" 17 | $packages_directory = "C:\Packages" 18 | 19 | #################################### 20 | # Define CMake information 21 | #################################### 22 | $cmake_version = "3.28.1" 23 | $cmake_platform = "windows-x86_64" 24 | $cmake_installer_url = "https://github.com/Kitware/CMake/releases/download/v$cmake_version/cmake-$cmake_version-$cmake_platform.msi" 25 | $cmake_installer_msi = "$working_directory\cmake.msi" 26 | $cmake_install_path = "C:\Program Files\CMake" 27 | $cmake_zip_output_path = "$packages_directory\CMake" 28 | 29 | #################################### 30 | # Define Conan information 31 | #################################### 32 | $conan_version = "2.0.17" 33 | $conan_version_classifier = "win-64" 34 | $conan_installer_url = "https://github.com/conan-io/conan/releases/download/$conan_version/conan-$conan_version_classifier.exe" 35 | $conan_installer_exe = "$working_directory\conan.exe" 36 | $conan_install_path = "C:\Program Files\Conan" 37 | $conan_zip_output_path = "$packages_directory\Conan" 38 | 39 | #################################### 40 | # Define WIX information 41 | #################################### 42 | $wix_version = "311" 43 | $wix_binaries_url = "https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311-binaries.zip" 44 | $wix_binaries = "$working_directory\wix.zip" 45 | $wix_install_path = "C:\Program Files\WIX" 46 | $wix_zip_output_path = "$packages_directory\WIX.zip" 47 | 48 | #################################### 49 | # Define Ninja information 50 | #################################### 51 | $ninja_version = "1.11.1" 52 | $ninja_binaries_url = "https://github.com/ninja-build/ninja/releases/download/v$ninja_version/ninja-win.zip" 53 | $ninja_binaries = "$working_directory\ninja.zip" 54 | $ninja_install_path = "C:\Program Files\Ninja" 55 | $ninja_zip_output_path = "$packages_directory\Ninja.zip" 56 | 57 | #################################### 58 | # Define Visual Studio information 59 | #################################### 60 | 61 | # Checkout Visual Studio Components 62 | # https://learn.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-build-tools?view=vs-2022 63 | 64 | # VS2022 Community Edition 65 | $vs_installer_url = "https://c2rsetup.officeapps.live.com/c2r/downloadVS.aspx?sku=community&channel=Release&version=VS2022&source=VSLandingPage&cid=2030" 66 | $vs_installer_exe = "$working_directory\vs_community.exe" 67 | # Defining where Visual Studio 2019 is installed 68 | $vs_install_path = "C:\Program Files\Microsoft Visual Studio\2022\Community" 69 | # Defining SDK version 70 | $windows_sdk_version_major = "10" 71 | $windows_sdk_version_minor = "20348" 72 | # Defining where Windows SDK is installed 73 | $windows_sdk_path = "C:\Program Files (x86)\Windows Kits\$windows_sdk_version_major" 74 | 75 | # Define all the desired components 76 | $module_core_build = "Microsoft.VisualStudio.Component.VC.CoreBuildTools" 77 | $module_compilerx86 = "Microsoft.VisualStudio.Component.VC.Tools.x86.x64" 78 | $module_vcredist ="Microsoft.VisualStudio.Component.VC.Redist.14.Latest" 79 | $module_atl = "Microsoft.VisualStudio.Component.VC.ATL" 80 | $module_atlfmfc = "Microsoft.VisualStudio.Component.VC.ATLMFC" 81 | $module_sdk = "Microsoft.VisualStudio.Component.Windows10SDK.$windows_sdk_version_minor" 82 | # Wait until the completion of the installer, do not restart the machine, don't show UI 83 | $vs_silent_args = "--quiet --wait --norestart" 84 | # Defining output path for archiving Visual C/C++ and Windows SDK 85 | $vs_zip_output_path = "$packages_directory\VC2022" 86 | $sdk_zip_output_path = "$packages_directory\SDK" 87 | 88 | #################################### 89 | # Prepare Visual Studio Package 90 | #################################### 91 | 92 | Write-Host "Downloading Visual Studio 2022 Community Edition" 93 | Invoke-WebRequest -Uri "$vs_installer_url" -OutFile "$vs_installer_exe" 94 | 95 | Write-Host "Installing C++ Development Environment" 96 | Start-Process -FilePath "$vs_installer_exe" -Wait -ArgumentList "$vs_silent_args --add $module_vcredist --add $module_core_build --add $module_sdk --add $module_atlfmfc --add $module_atl --add $module_compilerx86"; 97 | 98 | # Define the folders to exclude from final archive 99 | $DirsToInclude=@("$vs_install_path\Common7\Tools", "$vs_install_path\VC") 100 | 101 | Write-Host "Compressing Visual Studio 2022 files in an archive" 102 | Compress-Archive -DestinationPath $vs_zip_output_path $DirsToInclude 103 | 104 | Write-Host "Compressing Windows $windows_sdk_version_major-$windows_sdk_version_minor SDK files in an archive" 105 | Compress-Archive -Path "$windows_sdk_path" -DestinationPath "$sdk_zip_output_path" 106 | 107 | #################################### 108 | # Prepare Conan Package 109 | #################################### 110 | 111 | Write-Host "Downloading Conan $conan_version" 112 | Invoke-WebRequest -Uri "$conan_installer_url" -OutFile "$conan_installer_exe" 113 | 114 | Write-Host "Installing Conan" 115 | Start-Process -FilePath "$conan_installer_exe" -Wait -ArgumentList "/VERYSILENT /SUPPRESSMSGBOXES"; 116 | 117 | Write-Host "Compressing Conan files in an archive" 118 | Compress-Archive -Path "$conan_install_path" -DestinationPath "$conan_zip_output_path" 119 | 120 | #################################### 121 | # Prepare CMake Package 122 | #################################### 123 | 124 | Write-Host "Downloading CMake $cmake_version-$cmake_platform" 125 | Invoke-WebRequest -Uri "$cmake_installer_url" -OutFile "$cmake_installer_msi" 126 | 127 | Write-Host "Installing CMake" 128 | Start-Process -FilePath "msiexec" -Wait -ArgumentList "/i `"$cmake_installer_msi`" /qn /norestart"; 129 | 130 | Write-Host "Compressing CMake files in an archive" 131 | Compress-Archive -Path "$cmake_install_path" -DestinationPath "$cmake_zip_output_path" 132 | 133 | #################################### 134 | # Prepare WIX Package 135 | #################################### 136 | 137 | Write-Host "Downloading WIX $wix_version" 138 | Invoke-WebRequest -Uri "$wix_binaries_url" -OutFile "$wix_binaries" 139 | 140 | Write-Host "Extracting WIX Binaries into $wix_install_path" 141 | Expand-Archive -LiteralPath "$wix_binaries" -DestinationPath "$wix_install_path" 142 | 143 | Write-Host "Adding Wix to the environment Path" 144 | [Environment]::SetEnvironmentVariable( 145 | "Path", 146 | [Environment]::GetEnvironmentVariable("Path", [EnvironmentVariableTarget]::Machine) + ";$wix_install_path", 147 | [EnvironmentVariableTarget]::Machine) 148 | 149 | Write-Host "Copying WIX Binaries archive to the output folder" 150 | Copy-Item $wix_binaries -Destination "$wix_zip_output_path" 151 | 152 | #################################### 153 | # Prepare Ninja Package 154 | #################################### 155 | 156 | Write-Host "Downloading Ninja $ninja_version" 157 | Invoke-WebRequest -Uri "$ninja_binaries_url" -OutFile "$ninja_binaries" 158 | 159 | Write-Host "Extracting Ninja Binaries into $ninja_install_path" 160 | Expand-Archive -LiteralPath "$ninja_binaries" -DestinationPath "$ninja_install_path" 161 | 162 | Write-Host "Adding Ninja to the environment Path" 163 | [Environment]::SetEnvironmentVariable( 164 | "Path", 165 | [Environment]::GetEnvironmentVariable("Path", [EnvironmentVariableTarget]::Machine) + ";$ninja_install_path", 166 | [EnvironmentVariableTarget]::Machine) 167 | 168 | Write-Host "Copying Ninja Binaries archive to the output folder" 169 | Copy-Item $ninja_binaries -Destination "$ninja_zip_output_path" 170 | 171 | #################################### 172 | # Cleanup 173 | #################################### 174 | 175 | Write-Host "Removing downloaded installers/packages" 176 | Remove-Item -Path "$wix_binaries" -Force 177 | Remove-Item -Path "$ninja_binaries" -Force 178 | Remove-Item -Path "$cmake_installer_msi" -Force 179 | Remove-Item -Path "$conan_installer_exe" -Force 180 | Remove-Item -Path "$vs_installer_exe" -Force 181 | 182 | Write-Output "Setup completed. Time taken: $((Get-Date).Subtract($start_time).Minutes) minute(s)" 183 | -------------------------------------------------------------------------------- /vagrant/packages/.PLACEHOLDER: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madduci/docker-msvc-cpp/bd9554419277b3c7c0dd1aa5162d8258b4d92a2b/vagrant/packages/.PLACEHOLDER --------------------------------------------------------------------------------