Subversion Repositories Games.Rick Dangerous

Rev

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

Rev Author Line No. Line
2 pmbaty 1
@echo off
13 pmbaty 2
setlocal enableextensions enabledelayedexpansion
3
rem // change directory to the script's path, in case we are started as Administrator
4
cd /d %~dp0
2 pmbaty 5
 
13 pmbaty 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!
7 pmbaty 11
set PUBLISHER_WEBSITE=https://www.pmbaty.com/rick/
12
 
13 pmbaty 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
 
7 pmbaty 19
rem //////////////////////////////////////
20
rem // create the Rick Dangerous installer
21
 
13 pmbaty 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
)
2 pmbaty 32
 
13 pmbaty 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
2 pmbaty 45
echo Creating the installer...
13 pmbaty 46
"%ProgramFiles(x86)%\NSIS\makensis.exe" "/XOutFile \"%OUTPUT_FILE%\"" installer.nsi > installer.nsi.log || goto :error
2 pmbaty 47
 
48
rem // some time is needed for antiviruses etc to release the newly created file
49
ping 127.0.0.1 > nul
50
 
13 pmbaty 51
rem // sign the installer
52
set BINARY=%OUTPUT_FILE%
53
set DESCRIPTION=%PRODUCT_NAME% installer
54
set URL=%PUBLISHER_WEBSITE%
2 pmbaty 55
echo Signing the installer...
13 pmbaty 56
"%OSSLSIGNCODE%" sign %OSSLSIGNCODE_SIGN_FLAGS% -n "%DESCRIPTION%" -i "%URL%" -in "%BINARY%" >> codesigning.log || goto :error
2 pmbaty 57
 
13 pmbaty 58
:success
2 pmbaty 59
echo Finished.
60
pause > nul
13 pmbaty 61
exit /b 0
62
 
63
:error
64
echo An error occured.
65
pause > nul
66
exit /b 1