Einzelnen Beitrag anzeigen

Benutzerbild von Assarbad
Assarbad

Registriert seit: 8. Okt 2010
Ort: Frankfurt am Main
1.234 Beiträge
 
#1

ISO für Visual Studio 2015/2017 bauen

  Alt 11. Okt 2017, 14:21
Moin,

ich wollte eigentlich nur ein kleines Skript teilen, welches ich für mich selbst geschrieben hatte um mir eine ISO für die Installation der jeweils aktuellsten VS-Version zu erstellen. Seit VS2017 hat sich Microsoft überlegt, daß sie keine ISOs mehr anbieten. Nachteil für mich/uns ist, daß man somit keine Möglichkeit hat den aktuellen Stand der Toolchain sinnvoll zu archivieren um später seine Buildumgebung in gleicher Form wiederherzustellen.

Aber, Microsoft bietet eine Methode an um sich alles für eine Offline-Installation herunterzuladen. Die entsprechende Dokumentation findet sich hier und im Speziellen hier.

Dazu lädt man sich das Setupprogramm herunter und startet es mit speziellen Parametern. Ergebnis sind die für eine Offline-Installation notwendigen Dateien in dem per --layout angegebenen Verzeichnis.

Zusammen mit dem Tool zur Erstellung von Betriebssystemabbildern oscdimg.exe, welches man sich aus dem Windows ADK (früher AIK) holen kann (ich bevorzuge noch die Version für Windows 7), und dem folgenden Skript läßt sich mit diesem Wissen einfach eine ISO-Datei erstellen, welche die aktuellste VS2017-Installation beinhaltet. Aus Lizenzgründen liegt oscdimg.exe natürlich nicht meinem Skript bei.

Code:
@echo off
:: Create the folder which will be made into an ISO with:
::  vs_Professional.exe --layout %CD%\vs2017pro --lang en-US
if not exist "%~dp0oscdimg.exe" echo Could not find oscdimg.exe next to this script in %~dp0&exit /b 1
set IMGLABEL=%~1
if "%IMGLABEL%" == "" echo You need to give a label for the image to be created&exit /b 1
set VSDIR=%~2
if not exist "%VSDIR%" echo The folder supposed to contain the offline installation components ^(%VSDIR%^) does not exist&exit /b 1
xcopy /y "%~dpnx0" "%VSDIR%\"
if not exist "%VSDIR%\%~nx0" echo Could not copy %~nx0 into %VSDIR%&exit /b 1
xcopy /y "%~dp0oscdimg.exe" "%VSDIR%\"
if not exist "%VSDIR%\oscdimg.exe" echo Could not copy oscdimg.exe into %VSDIR%&exit /b 1
:: -oc This option will encode duplicate files only once. It does
::    a binary compare on the files and is slower.
:: -g This option makes all times encoded in GMT time rather than the
::    local time.
:: -h This option will include all hidden files and directories under the
::    source path for this image.
:: -l This options specifies the volume label. This should be 32
::    characters or less. There is no space after this option.
::    Example: -lMyVolume
:: -u2  This option is used to produce an image that has only the UDF
::     file system on it. Any system not capable of reading UDF will
::     only see a default text file alerting the user that this image is
::     only available on computers that support UDF.
:: -yl This option will use long allocation descriptors instead of short
::     allocation descriptors.
:: Writes UDF revision 2.00  (Supported: Windows XP and later)
@echo on
"%~dp0oscdimg.exe" -oc -g -h -l%IMGLABEL% -u2 -yl -udfver200 "%VSDIR%" "%VSDIR%.iso"
@echo off
Ich habe das Skript buildiso.cmd genannt, aber ihr seit selbstverfreilich frei in der Namenswahl. Es handelt sich um ein einfaches NT-Skript (Nachfolger von DOS-Batch und Vorgänger von PowerShell).

Das Ergebnis ist für die aktuelle Version 15.4 von Visual Studio 2017 Professional eine 28,6 GiB große ISO-Datei die ab Windows Vista mit Bordmitteln lesbar sein sollte.

Diese Methode funktioniert auch mit den Build Tools für Visual Studio und könnte auch mit den Community-Versionen funktionieren, was ich allerdings nicht probiert habe.

[Falls kein Interesse besteht, können die Mods das ja gern löschen oder alternativ verschieben.]
Angehängte Dateien
Dateityp: zip buildiso.zip (975 Bytes, 4x aufgerufen)
Oliver
"... aber vertrauen Sie uns, die Physik stimmt." (Prof. Harald Lesch)
  Mit Zitat antworten Zitat