Subversion Repositories Games.Rick Dangerous

Rev

Rev 9 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. @echo off
  2. setlocal enableextensions enabledelayedexpansion
  3. rem // change directory to the script's path, in case we are started as Administrator
  4. cd /d %~dp0
  5.  
  6. set PRODUCT_NAME=Rick Dangerous
  7. set OUTPUT_FILE=Z:\Documents\Mes projets\www.pmbaty.com\rick\Rick Dangerous Installer.exe
  8. rem // NOTE NO DASH v----- HERE IN THE FIRST NAME! THE CERTIFICATE WAS ISSUED BY GLOBALSIGN WITHOUT IT!
  9. set PUBLISHER=Pierre Marie Baty
  10. rem // NOTE NO DASH ^----- HERE IN THE FIRST NAME! THE CERTIFICATE WAS ISSUED BY GLOBALSIGN WITHOUT IT!
  11. set PUBLISHER_WEBSITE=https://www.pmbaty.com/rick/
  12.  
  13. set OSSLSIGNCODE=%~dp0osslsigncode.Win32-x64.exe
  14. set OSSLSIGNCODE_SIGN_FLAGS=-pkcs11module IDPrimePKCS1164.dll -pass 0000 -key "pkcs11:object=%PUBLISHER%;type=private" -certs "%PUBLISHER%+Verokey Secure Code+DigiCert Trusted Root G4.pem" -ts http://timestamp.digicert.com
  15.  
  16. if not exist "%OSSLSIGNCODE%" echo osslsigncode not found - Please fix the path in this installer script!&& goto :error
  17. del *.log > nul 2>&1
  18.  
  19. rem //////////////////////////////////////
  20. rem // create the Rick Dangerous installer
  21.  
  22. rem // sign the main executable if it's not signed already
  23. set BINARY=..\Rick Dangerous.exe
  24. set DESCRIPTION=%PRODUCT_NAME% executable
  25. set URL=%PUBLISHER_WEBSITE%
  26. "%OSSLSIGNCODE%" verify "%BINARY%" > nul && (
  27.         echo Already signed: %BINARY%
  28. ) || (
  29.         echo Signing %BINARY%...
  30.         "%OSSLSIGNCODE%" sign %OSSLSIGNCODE_SIGN_FLAGS% -n "%DESCRIPTION%" -i "%URL%" -in "%BINARY%" >> codesigning.log || goto :error
  31. )
  32.  
  33. rem // sign the SDL library if it's not signed already
  34. set BINARY=..\SDL2.dll
  35. set DESCRIPTION=Simple DirectMedia Layer library for %PRODUCT_NAME%
  36. set URL=%PUBLISHER_WEBSITE%
  37. "%OSSLSIGNCODE%" verify "%BINARY%" > nul && (
  38.         echo Already signed: %BINARY%
  39. ) || (
  40.         echo Signing %BINARY%...
  41.         "%OSSLSIGNCODE%" sign %OSSLSIGNCODE_SIGN_FLAGS% -n "%DESCRIPTION%" -i "%URL%" -in "%BINARY%" >> codesigning.log || goto :error
  42. )
  43.  
  44. rem // create the NSIS install package
  45. echo Creating the installer...
  46. "%ProgramFiles(x86)%\NSIS\makensis.exe" "/XOutFile \"%OUTPUT_FILE%\"" installer.nsi > installer.nsi.log || goto :error
  47.  
  48. rem // some time is needed for antiviruses etc to release the newly created file
  49. ping 127.0.0.1 > nul
  50.  
  51. rem // sign the installer
  52. set BINARY=%OUTPUT_FILE%
  53. set DESCRIPTION=%PRODUCT_NAME% installer
  54. set URL=%PUBLISHER_WEBSITE%
  55. echo Signing the installer...
  56. "%OSSLSIGNCODE%" sign %OSSLSIGNCODE_SIGN_FLAGS% -n "%DESCRIPTION%" -i "%URL%" -in "%BINARY%" >> codesigning.log || goto :error
  57.  
  58. :success
  59. echo Finished.
  60. pause > nul
  61. exit /b 0
  62.  
  63. :error
  64. echo An error occured.
  65. pause > nul
  66. exit /b 1
  67.