install.bat 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. @echo off
  2. echo ###################################################################################
  3. echo (Frank: 29/12/22) I made some tweaks to streamline the install process:
  4. echo - The script now explicitly sets the SourceDir and OutputDir of the InnoSetup Scripts
  5. echo - Directories are set relative to the drive and path of the install.bat file
  6. echo - Output from PRSDesktopSetup is piped directly into the PRSServer update folder
  7. echo This removes the need for the intermediate c:\development\syncthing folder,
  8. echo as well as allowing the script to run off other drives (ie E: instead of C:)
  9. echo ###################################################################################
  10. echo.
  11. set /p version_number="Enter Version Number: "
  12. echo Updating Version Number...
  13. set /p _scratch="%version_number%" <nul > "bin/Debug/net8.0-windows/update/version.txt"
  14. set /p _scratch="%version_number%" <nul > "bin/Debug/net8.0-windows/version.txt"
  15. >NUL mkdir "bin/Debug/net8.0-windows/update"
  16. echo Getting Release Notes...
  17. curl.exe -s "https://prsdigital.com.au//updates/prs/Release%%20Notes.txt" > "bin/Debug/net8.0-windows/update/Release Notes.txt"
  18. echo Preparing Installer Scripts...
  19. powershell -Command "(gc ../prs.desktop/prsdesktop.iss) -replace '#define MyAppVersion ""[^\""]*""', '#define MyAppVersion """%version_number%"""' | Out-File -encoding ASCII ../prs.desktop/prsdesktop.iss"
  20. powershell -Command "(gc ../prs.desktop/prsdesktop.iss) -replace 'OutputDir=[^\""]*', 'OutputDir=%~dp0bin\Debug\net8.0-windows\update' | Out-File -encoding ASCII ../prs.desktop/prsdesktop.iss"
  21. powershell -Command "(gc ../prs.desktop/prsdesktop.iss) -replace 'SourceDir=[^\""]*', 'SourceDir=%~dp0..\prs.desktop\' | Out-File -encoding ASCII ../prs.desktop/prsdesktop.iss"
  22. powershell -Command "(gc PRSServer.iss) -replace '#define MyAppVersion ""[^\""]*""', '#define MyAppVersion """%version_number%"""' | Out-File -encoding ASCII PRSServer.iss"
  23. powershell -Command "(gc PRSServer.iss) -replace 'OutputDir=[^\""]*', 'OutputDir=%~dp0' | Out-File -encoding ASCII PRSServer.iss"
  24. powershell -Command "(gc PRSServer.iss) -replace 'SourceDir=[^\""]*', 'SourceDir=%~dp0' | Out-File -encoding ASCII PRSServer.iss"
  25. powershell -Command "(gc ../prs.licensing/prslicensing.iss) -replace '#define MyAppVersion ""[^\""]*""', '#define MyAppVersion """%version_number%"""' | Out-File -encoding ASCII ../prs.licensing/prslicensing.iss"
  26. powershell -Command "(gc ../prs.licensing/prslicensing.iss) -replace 'OutputDir=[^\""]*', 'OutputDir=%~dp0bin\Debug\net8.0-windows\update' | Out-File -encoding ASCII ../prs.licensing/prslicensing.iss"
  27. powershell -Command "(gc ../prs.licensing/prslicensing.iss) -replace 'SourceDir=[^\""]*', 'SourceDir=%~dp0..\prs.licensing\' | Out-File -encoding ASCII ../prs.licensing/prslicensing.iss"
  28. echo Compiling Desktop Installer...
  29. "C:\Program Files (x86)\Inno Setup 6\iscc.exe" /Qp /O"bin\Debug\net8.0-windows\update" ../prs.desktop/prsdesktop.iss
  30. echo Compiling Server Installer...
  31. "C:\Program Files (x86)\Inno Setup 6\iscc.exe" /Qp /O"." /F"PRSSetup" PRSServer.iss
  32. echo Compiling License Installer...
  33. "C:\Program Files (x86)\Inno Setup 6\iscc.exe" /Qp /O"." /F"PRSLicensing" ../prs.licensing/prslicensing.iss
  34. echo Cleaning Up...
  35. del bin\Debug\net8.0-windows\update\version.txt
  36. del bin\Debug\net8.0-windows\version.txt
  37. echo.
  38. echo All Done! PRS v%version_number% Installer can be found at %~dp0PRSSetup.exe