Silent upgrade batch file for CATIA V5-6R2016

Here is my silent upgrade batch file for CATIA V5-6R2016
This blog is going to wrap some lines and sometimes screw up the quotes, so double check all that.

@echo off
echo Install CATIA 2016 silently - (x64 bit Windows)
echo Based on the supported "Distributing the Software in Compressed Form" method.
REM Install CATIA and all Service packs on a clean PC and then zip them up.
REM - Ed Hammond 9.28.2016 Skills Inc.
REM - Copy this file to the local PC and run as Administrator
REM Set the variable for the UNC location on the server where the CATIA installers are stored 
REM ---------------------------
REM -- Install Catia Base
REM start "" /wait "%CATIAINSTALLERS%\CATIA R2016\V5-6R2016.CATIA_P3.win_b64.1-1\CATIA_P3.win_b64\1\WIN64\startb.exe" -newdir -noreboot -all 
REM ---------------------------
REM -- Install VBA
REM msiexec /q /i "%CATIAINSTALLERS%\CATIA R2016\V5-6R2016.CATIA_P3.win_b64.1-1\CATIA_P3.win_b64\1\VBA\Vba71_x64.msi"
REM ---------------------------
REM -- Install Service Pack
REM start "" /wait "%CATIAINSTALLERS%\CATIA R2016\V5-6R2016.SP3.SPK.win_b64.1-1\SPK.win_b64\1\WIN64\startspkb.exe" -bC -killprocess
REM ****************** Now zip them up and put the zip file on your server: %CATIAINSTALLERS%\ ********************
echo ---------------------------
REM Zip up everything under %ProgramFiles%\Dassault Systemes\, Name the ZIP file and store the zip on the server.
echo Backing up CATSettings folder
echo ---------------------------
REM Backup CATSettings folder prior to upgrade. WARNING: Reusing these settings is against best practices. They should be re-created for each version.
start "" /wait robocopy "%APPDATA%\DassultSystemes\CATSettings" "%APPDATA%\DassultSystemes\CATSettings2015" /R:1
Echo Exporting CATSettings to XML file
echo ---------------------------
start "" /wait robocopy "%ProgramFiles%\Dassault Systemes\B25\win_b64\code\bin\CATBatGenXMLSet.exe"" "%APPDATA%\DassultSystemes\CATSettings" CATSettings-Export.xml
REM Optional: Use this Enviroment file line to change where the setting are stored: CATUserSettingPath=CSIDL_APPDATA\DassaultSystemes\CATSettings2015
echo Uninstall the old version
echo ---------------------------
if not exist "%ProgramFiles%\Dassault Systemes\B25\win_b64" to CLEAN
if exist "%temp%\Uninstall.bat" del "%temp%\Uninstall.bat"
start "" /wait robocopy "%ProgramFiles%\Dassault Systemes\B25\win_b64" "%temp%" Uninstall.bat /R:1

echo EXIT >> %temp%\Uninstall.bat
start "" /wait %temp%\Uninstall.bat
echo Create the ENV Folders
echo ---------------------------
if not exist "%ProgramData%\DassaultSystemes\CATEnv" mkdir "%ProgramData%\DassaultSystemes\CATEnv"
if not exist "%APPDATA%\DassultSystemes\CATEnv" mkdir "%APPDATA%\DassultSystemes\CATEnv"
REM Extract Zip file to local PC
echo Use powershell to unzip the files to "%ProgramFiles%\Dassault Systemes\B26"
echo This can take 5 minutes, don't close this window!
echo ---------------------------
powershell.exe -nologo -noprofile -command "& { Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory('%CATIAINSTALLERS%\', '%ProgramFiles%'); }"
echo Now run all the CATIA tools that create the shortcuts and Prerequisites.
start "" /wait msiexec /i "%CATIAINSTALLERS%\V5-6R2016.CATIA_P3.win_b64.1-1\CATIA_P3.win_b64\1\WIN64\InstallDSSoftwarePrerequisites_x86_x64.msi" /q
start "" /wait msiexec /i "%CATIAINSTALLERS%\V5-6R2016.CATIA_P3.win_b64.1-1\CATIA_P3.win_b64\1\WIN64\InstallDSSoftwareVC11Prerequisites_x86_x64.msi" /q 
CD "%ProgramFiles%\Dassault Systemes\B26\win_b64\code\bin"
echo Running setcatenv
echo ---------------------------
REM For setcatenv help try setcatenv -h
REM For V5Regserver help try V5Regserver -h
REM Enviroment (-e) = CATIA_P3.V5-6R2016.B26
REM ProductLine (-cs) = CATIA_P3
setcatenv -p "%ProgramFiles%\Dassault Systemes\B26" -e CATIA_P3.V5-6R2016.B26 -d "%ProgramData%\DassaultSystemes\CATEnv" -a global -icon yes -menu yes -cs CATIA_P3
echo Running V5Regserver
echo ---------------------------
V5Regserver -set CATIA -env CATIA_P3.V5-6R2016.B26 -direnv "%ProgramData%\DassaultSystemes\CATEnv"
echo Running setcatenv for Tools
echo ---------------------------
setcatenv -tools -e CATIA_P3.V5-6R2016.B26 -cs CATIA_P3
echo Running VBA installer
echo ---------------------------
start "" /wait "%CATIAINSTALLERS%\V5-6R2016.CATIA_P3.win_b64.1-1\CATIA_P3.win_b64\1\VBA\DSVBA71Installer.exe" /install /norestart /q /log %temp%\DSVBA71.log
REM Create a license file (DSLicSrv.txt) that can be copied to the license folder and store it on the server
if not exist "%ProgramData%\DassaultSystemes\Licenses" mkdir "%ProgramData%\DassaultSystemes\Licenses"
copy "%CATIAINSTALLERS%\DSLicSrv.txt" %ProgramData%\DassaultSystemes\Licenses\ /y
echo Done! Don't forget to update you DSLS License Server!


Popular posts from this blog

Add your Office 2016 KMS Keys to your Volume Activation Server

Solving WinRM Host connection errors in SCVMM - System Center Virtual Machine Manager 2012 R2

How to setup Google Authenticator 2FA with a Watchguard SSL VPN Client for FREE!