install.bat 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  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/net6.0-windows/update/version.txt"
  14. set /p _scratch="%version_number%" <nul > "bin/Debug/net6.0-windows/version.txt"
  15. >NUL mkdir "bin/Debug/net6.0-windows/update"
  16. echo Getting Release Notes...
  17. curl.exe -s "https://prs-software.com.au/updates/prs/Release%%20Notes.txt" > "bin/Debug/net6.0-windows/update/Release Notes.txt"
  18. echo Compiling Desktop Installer...
  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\net6.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. "C:\Program Files (x86)\Inno Setup 6\iscc.exe" /Q /O"bin\Debug\net6.0-windows\update" ../prs.desktop/prsdesktop.iss
  23. echo Compiling Server Installer...
  24. powershell -Command "(gc PRSServer.iss) -replace '#define MyAppVersion ""[^\""]*""', '#define MyAppVersion """%version_number%"""' | Out-File -encoding ASCII PRSServer.iss"
  25. powershell -Command "(gc PRSServer.iss) -replace 'OutputDir=[^\""]*', 'OutputDir=%~dp0' | Out-File -encoding ASCII PRSServer.iss"
  26. powershell -Command "(gc PRSServer.iss) -replace 'SourceDir=[^\""]*', 'SourceDir=%~dp0' | Out-File -encoding ASCII PRSServer.iss"
  27. "C:\Program Files (x86)\Inno Setup 6\iscc.exe" /Q /O"." /F"PRSSetup" PRSServer.iss
  28. echo.
  29. echo All Done! PRS v%version_number% Installer can be found at %~dp0PRSSetup.exe