| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- @echo off
- echo ###################################################################################
- echo (Frank: 4/12/25) More Improvements to the install process
- echo - You can now select Debug or Release for the build configuration
- echo - PRSLogikal is built using MSBuild, rather than dotnet.exe
- echo - Nuget Packages are saved to a common folder for publishing
- echo ###################################################################################
- echo.
- set /p version_number="Enter Version Number: "
- set release_type=Release
- set package_folder="c:\development\packages"
- echo Build Configuration is %release_type%.
- echo Building PRSDesktop...
- dotnet build ../prs.desktop/prsdesktop.csproj -c %release_type% -p:Version=%version_number% -p:PackageOutputPath=%package_folder% > build.log 2>&1 || goto :build_fail
- echo Building PRSServer...
- dotnet build ../prs.server/prsserver.csproj -c %release_type% -p:Version=%version_number% -p:PackageOutputPath=%package_folder% > build.log 2>&1 || goto :build_fail
- echo Building PRSLicensing...
- dotnet build ../prs.licensing/prslicensing.csproj -c %release_type% -p:Version=%version_number% -p:PackageOutputPath=%package_folder% > build.log 2>&1 || goto :build_fail
- echo Building PRSRecovery...
- dotnet build ../prs.recovery/prsrecovery.csproj -c %release_type% -p:Version=%version_number% -p:PackageOutputPath=%package_folder% > build.log 2>&1 || goto :build_fail
- echo Building PRS.Avalonia.Desktop...
- dotnet build ../prs.avalonia/prs.avalonia.desktop/prs.avalonia.desktop.csproj -c %release_type% -p:Version=%version_number% -p:PackageOutputPath=%package_folder% > build.log 2>&1 || goto :build_fail
- echo Building PRS.DigitalKey.Desktop...
- dotnet build ../prs.digitalkey/prs.digitalkey.desktop/prs.digitalkey.desktop.csproj -c %release_type% -p:Version=%version_number% -p:PackageOutputPath=%package_folder% > build.log 2>&1 || goto :build_fail
- echo Building PRSLogikal...
- setlocal EnableDelayedExpansion
- set "buildlocations[0]=C:\Users\frank.vandenbos\AppData\Local\JetBrains\BuildTools\MSBuild\Current\Bin\MSBuild.exe"
- set "buildlocations[1]=C:\Program Files\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\MSBuild.exe"
- set "buildlocations[2]=C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe"
- set "buildlocations[3]=C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe"
- set "buildlocations[4]=C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe"
- set "buildlocations[5]=C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe"
- set "buildlocations[6]=C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe"
- set "msbuild="
- set "foundlocation="
- for /l %%i in (0,1,6) do (
- call set "location=%%buildlocations[%%i]%%"
- if exist "!location!" (
- set "foundlocation=!location!"
- goto :found
- )
- )
- echo MSBuild.exe not found in known locations.
- endlocal
- exit /b 1
- :found
- endlocal & set "msbuild=%foundlocation%
- echo Found MSBuild at: %msbuild%
- %msbuild% ../prs.logikal/prslogikal.csproj -p:Configuration=%release_type% > build.log 2>&1 || goto :build_fail
- goto :build_success
- :build_fail
- findstr /i ": error" build.log
- echo Build failed. Aborting script.
- exit /b %ERRORLEVEL%
- )
- :build_success
- echo Updating Version Number...
- set /p _scratch="%version_number%" <nul > "bin/%release_type%/net8.0-windows/update/version.txt"
- set /p _scratch="%version_number%" <nul > "bin/%release_type%/net8.0-windows/version.txt"
- >NUL mkdir "bin/%release_type%/net8.0-windows/update"
- echo Getting Release Notes...
- curl.exe -s "https://prsdigital.com.au//updates/prs/Release%%20Notes.txt" > "bin/%release_type%/net8.0-windows/update/Release Notes.txt"
- echo Preparing Desktop Installer Script...
- powershell -Command "(gc ../prs.desktop/prsdesktop.iss) -replace '#define MyAppVersion ""[^\""]*""', '#define MyAppVersion """%version_number%"""' | Out-File -encoding ASCII ../prs.desktop/prsdesktop.iss"
- powershell -Command "(gc ../prs.desktop/prsdesktop.iss) -replace '#define ReleaseType ""[^\""]*""', '#define ReleaseType """%release_type%"""' | Out-File -encoding ASCII ../prs.desktop/prsdesktop.iss"
- powershell -Command "(gc ../prs.desktop/prsdesktop.iss) -replace 'OutputDir=[^\""]*', 'OutputDir=%~dp0bin\%release_type%\net8.0-windows\update' | Out-File -encoding ASCII ../prs.desktop/prsdesktop.iss"
- powershell -Command "(gc ../prs.desktop/prsdesktop.iss) -replace 'SourceDir=[^\""]*', 'SourceDir=%~dp0..\prs.desktop\' | Out-File -encoding ASCII ../prs.desktop/prsdesktop.iss"
- echo Preparing Server Installer Script...
- powershell -Command "(gc PRSServer.iss) -replace '#define MyAppVersion ""[^\""]*""', '#define MyAppVersion """%version_number%"""' | Out-File -encoding ASCII PRSServer.iss"
- powershell -Command "(gc PRSServer.iss) -replace '#define ReleaseType ""[^\""]*""', '#define ReleaseType """%release_type%"""' | Out-File -encoding ASCII PRSServer.iss"
- powershell -Command "(gc PRSServer.iss) -replace 'OutputDir=[^\""]*', 'OutputDir=%~dp0' | Out-File -encoding ASCII PRSServer.iss"
- powershell -Command "(gc PRSServer.iss) -replace 'SourceDir=[^\""]*', 'SourceDir=%~dp0' | Out-File -encoding ASCII PRSServer.iss"
- echo Preparing Licensing Installer Script...
- powershell -Command "(gc ../prs.licensing/prslicensing.iss) -replace '#define MyAppVersion ""[^\""]*""', '#define MyAppVersion """%version_number%"""' | Out-File -encoding ASCII ../prs.licensing/prslicensing.iss"
- powershell -Command "(gc ../prs.licensing/prslicensing.iss) -replace '#define ReleaseType ""[^\""]*""', '#define ReleaseType """%release_type%"""' | Out-File -encoding ASCII ../prs.licensing/prslicensing.iss"
- powershell -Command "(gc ../prs.licensing/prslicensing.iss) -replace 'OutputDir=[^\""]*', 'OutputDir=%~dp0bin\%release_type%\net8.0-windows\update' | Out-File -encoding ASCII ../prs.licensing/prslicensing.iss"
- powershell -Command "(gc ../prs.licensing/prslicensing.iss) -replace 'SourceDir=[^\""]*', 'SourceDir=%~dp0..\prs.licensing\' | Out-File -encoding ASCII ../prs.licensing/prslicensing.iss"
- echo Compiling Desktop Installer...
- "C:\Program Files (x86)\Inno Setup 6\iscc.exe" /Qp /O"bin\%release_type%\net8.0-windows\update" ../prs.desktop/prsdesktop.iss
- echo Compiling Server Installer...
- "C:\Program Files (x86)\Inno Setup 6\iscc.exe" /Qp /O"." /F"PRSSetup" PRSServer.iss
- echo Compiling License Installer...
- "C:\Program Files (x86)\Inno Setup 6\iscc.exe" /Qp /O"." /F"PRSLicensing" ../prs.licensing/prslicensing.iss
- echo Cleaning Up...
- del bin\%release_type%\net8.0-windows\update\version.txt
- del bin\%release_type%\net8.0-windows\version.txt
- echo.
- echo All Done! PRS v%version_number% Installer can be found at %~dp0PRSSetup.exe
|