@echo off echo Geocortex Identity Server Installation echo. REM POSTINSTALL_DIR refers to the physical path where the Indentity Server installer is located set POSTINSTALL_DIR=C:\Program Files (x86)\Latitude Geographics\Geocortex Essentials\Post Install REM INSTALL_DIR refers to the physical path where Identity Server will be installed set INSTALL_DIR=C:\Program Files (x86)\Latitude Geographics\Geocortex Identity Server 2 REM ISSUER_URI refers to a unique identifier for this Identity Server instance (the convention is to use the URL of the web application) set ISSUER_URI=http://server.domain.com/Geocortex/IdentityServer2 REM APPPOOL_NAME refers to the name of the IIS application pool that will host the application set APPPOOL_NAME=IdentityServer2AppPool REM SIGNING_CERTIFICATE_NAME refers to the subject name of the certificate that Identity Server will use to sign messages set SIGNING_CERTIFICATE_NAME=CN=Geocortex, CN=Signing, CN=%COMPUTERNAME% REM DISABLE_SSL refers to whether Identity Server should allow communication over http set DISABLE_SSL=true REM LOG_OUTPUT_FILE refers to the file where the output of this script will be written set LOG_OUTPUT_FILE=InstallLog.txt REM Require administrator privilege net session >nul 2>&1 if %errorLevel%==0 ( REM administrator ) else ( echo This command must be run as an administrative user. pause exit ) if exist "%LOG_OUTPUT_FILE%" ( echo Remove previous log del %LOG_OUTPUT_FILE% /q ) if exist "%cd%\Temp\" ( echo Remove previous temporary files rmdir /s /q "%cd%\Temp\" ) echo Extract MSI contents to temp directory msiexec /a "%POSTINSTALL_DIR%\Geocortex.IdentityServer.msi" /qb TARGETDIR="%cd%\Temp" echo Copy extracted content to destination directory robocopy "%cd%\Temp\Program Files\Latitude Geographics\Geocortex Identity Server" "%INSTALL_DIR%" /E /NFL /NDL /NJH /NJS /NS /NC echo Remove temporary files rmdir /s /q "%cd%\Temp\" echo Copy setup content into Web directory, do not overwrite robocopy "%INSTALL_DIR%\Setup" "%INSTALL_DIR%\Web" /E /XC /XN /XO /NFL /NDL /NJH /NJS /NS /NC echo Grant the application pool identity write permissions on the App_Data directory CACLS "%INSTALL_DIR%\Web\App_Data" /E /T /C /G "IIS APPPOOL\%APPPOOL_NAME%":F >nul 2>&1 echo Invoke the Identity Server setup utility and redirect the output to the log file "%INSTALL_DIR%\Web\bin\Geocortex.IdentityServer.Setup.exe" outputMode=NoPrompt DisableSSL=%DISABLE_SSL% IssuerUri="%ISSUER_URI%" SigningCertificateName="%SIGNING_CERTIFICATE_NAME%" >%LOG_OUTPUT_FILE% echo Open the output log file in notepad start notepad %LOG_OUTPUT_FILE%