WiX 4 benötigt .NET SDK 6 oder höher. Das .NET SDK per Shell Provisioner zu installieren ist aber nicht ganz offensichtlich, was primär an zweierlei liegt:
MS möchte .NET gerne per winget installieren, was eine AppStore-App ist (heißt das so?), die per Provisioner selbst nach der abenteuerlichen Installation der Dependencies nicht verfügbar ist:
Program ‘winget.exe’ failed to run: The file cannot be accessed by the systemAt C:\tmp\vagrant-shell.ps1:1 char:1
– vermutlich liegt der Grund irgendwo hier, hier oder hier. Keine Ahnung, Windows halt 🤷🏼♂️
Wenn man .NET dann anders installiert, werden die Umgebungsvariablen nicht mit gesetzt m( Na ja, long story short:
1 2 3 4 5 6 7 |
# install .NET: config.vm.provision "shell", path: "dotnet-install.ps1", name: "install .NET" config.vm.provision "shell", inline: "[Environment]::SetEnvironmentVariable(\"DOTNET_ROOT\",\"$HOME\\AppData\\Local\\Microsoft\\dotnet\\\", \"Machine\")", name: "Set DOTNET_ROOT" config.vm.provision "shell", inline: "[Environment]::SetEnvironmentVariable(\"Path\", $env:Path + \";$HOME\\AppData\\Local\\Microsoft\\dotnet\\\", \"Machine\")", name: "Set Path" # install wix: config.vm.provision "shell", inline: "dotnet tool install --global wix", name: "install WiX", reboot: true |
Mit dotnet-install.ps1 von hier; zum Einsatz kommt StefanScherer/windows_10. Der Reboot am Ende sollte imho nicht notwendig sein, aber ohne findet er weder wix.exe
, noch dotnet.exe
. Windows halt 🤷🏼♂️