Complete rewrite of the revitserverinstaller

This commit is contained in:
2019-02-08 19:11:02 +01:00
parent 800e2b543b
commit 700383fb7e

View File

@@ -1,77 +1,94 @@
@echo off @echo off
REM Version: 1.1 REM Version: 2.0
REM Revit server installer script for exobim REM Revit server installer script for exobim
REM Usage: run this after download. it's possible that you have to run it as admin. REM Usage: run this after download. It's possible that you have to run it as admin.
REM (Re)start revit after running this script
REM Created by Peter Gyetvai: gyetpet@gmail.com with the help of the internet REM Created by Peter Gyetvai: gyetpet@gmail.com with the help of the internet
SET SERVERPATH=exobim.asuscomm.com REM --------
REM Settings
REM --------
SET FOLDER2017=%programdata%\Autodesk\Revit Server 2017 REM Separate elements in these lists with spaces
SET FOLDER2018=%programdata%\Autodesk\Revit Server 2018
SET FOLDER2019=%programdata%\Autodesk\Revit Server 2019
SET INI2017=%FOLDER2017%\Config\RSN.ini
SET INI2018=%FOLDER2018%\Config\RSN.ini
SET INI2019=%FOLDER2019%\Config\RSN.ini
SET SERVERPATHS=exobim.asuscomm.com
SET REVITVERSIONS=2017 2018 2019
REM Set this if you want to overwrite the existing RSN.ini paths.
REM Note this script doesn't check for duplicates. If you set this to true, it's possible that the same address will be listed in RSN.ini
SET OVERWRITE=true
REM -----------------------
REM Beginning of the script
REM -----------------------
echo ---
echo revitServerInstaller.bat
echo Created by Peter Gyetvai: gyetpet@gmail.com
echo ---
echo This script will add the paths of the servers to your local RSN.ini file.
echo Edit this script with notepad to set up the paths of the Revit servers.
echo You have to restart Revit after running this script, or modifying your RSN.ini file echo You have to restart Revit after running this script, or modifying your RSN.ini file
echo This script will add the following path to your RSN.ini:
echo %SERVERPATH%
echo --- echo ---
echo Current settings:
if exist "%FOLDER2017%" ( echo Revit Server path(s):
echo Revit 2017 installed echo %SERVERPATHS%
if exist "%INI2017%" ( echo Revit version(s):
echo RSN.ini exists, skipping echo %REVITVERSIONS%
echo Modify your RSN.ini here: if "%OVERWRITE%" == "true" (
echo "%INI2017%" echo Overwrite enabled, the script will delete existing settings!
SET OK2017=no
) else (
echo Creating RSN.ini
echo %SERVERPATH% > "%INI2017%"
SET OK2017=ok
)
) else ( ) else (
echo Revit 2017 not installed, skipping echo Overwrite disabled, the script will append any new servers to the file.
) )
echo --- echo ---
pause
echo ---
setlocal ENABLEDELAYEDEXPANSION
if exist "%FOLDER2018%" ( (for %%a in (%REVITVERSIONS%) do (
echo Revit 2018 installed SET VERSION=%%a
if exist "%INI2018%" ( SET FOLDER=%programdata%\Autodesk\Revit Server !VERSION!
echo RSN.ini exists, skipping SET INI=!FOLDER!\Config\RSN.ini
echo Modify your RSN.ini here:
echo "%INI2018%" echo Installing for Revit !VERSION!
SET OK2018=no
if exist "!FOLDER!" (
echo Revit !VERSION! installed, Revit Server folder found
REM check if RSN.ini exists
if exist "!INI!" (
echo Existing RSN.ini found
if "%OVERWRITE%" == "true" (
echo Overwrite enabled, creating new empty RSN.ini
copy /y NUL "!INI!" >NUL
)
) else ( ) else (
echo Creating RSN.ini echo Creating new RSN.ini
echo %SERVERPATH% > "%INI2018%" copy /y NUL "!INI!" >NUL
SET OK2018=ok )
)
) else ( echo Adding new server addresses to RSN.ini
echo Revit 2018 not installed, skipping for %%b in (%SERVERPATHS%) do (
echo %%b >> !INI!
)
echo Installed for Revit !VERSION!
SET SUCCESSVERSION=!SUCCESSVERSION! !VERSION!
) else (
echo Revit !VERSION! not installed, skipping
)
echo ---
))
echo Script finished
for %%c in (%SUCCESSVERSION%) do (
echo Successfully set up Revit %%c
) )
echo --- echo ---
pause
if exist "%FOLDER2019%" ( REM -----------------------
echo Revit 2019 installed REM End of the script
if exist "%INI2019%" ( REM -----------------------
echo RSN.ini exists, skipping
echo Modify your RSN.ini here:
echo "%INI2019%"
SET OK2019=no
) else (
echo Creating RSN.ini
echo %SERVERPATH% > "%INI2019%"
SET OK2019=pl
)
) else (
echo Revit 2019 not installed, skipping
)
echo ---
if %OK2017% EQU ok echo Successfully set up Revit 2017
if %OK2018% EQU ok echo Successfully set up Revit 2018
if %OK2019% EQU ok echo Successfully set up Revit 2019
echo ---
pause