Re #313 : Work-in-progress "base" Windows binary installer (Game core + only Supercars and Espie) - Doesn't work yet.

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@3254 30fe4595-0a0c-4342-8851-515496e4dcbd
This commit is contained in:
pouillot 2011-01-09 22:17:22 +00:00
parent 6169407d2e
commit b6f8f44468
5 changed files with 422 additions and 1 deletions

View File

@ -103,7 +103,12 @@ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/version.h.cmake
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/doxygen_config.cmake
${CMAKE_CURRENT_BINARY_DIR}/doxygen_config @ONLY)
SD_INSTALL_FILES(DATA "/" FILES credits.xml)
SD_INSTALL_FILES(DATA "/"
FILES credits.xml
CHANGES.txt COPYING.txt INSTALL.txt README.txt TODO.txt)
SD_INSTALL_FILES(BIN
FILES sd-robotgen.sh)
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(data)

View File

@ -1,6 +1,8 @@
Table of contents
-----------------
WARNING: Only intended for developers who'll build Speed Dreams from sources.
I - Pre-requisites
II - Linux Installation from Sources

View File

@ -0,0 +1,393 @@
;
; Windows NSIS configuration file for the base=main=minimal=core installer
;
; copyright : (C) 2005 Bernhard Wymann, 2009-2010 Xavier Bertaux, Jean-Philippe Meuret
; $Id: speed-dreams.nsi 1855 2009-11-21 17:01:00Z pouillot $
;
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 2 of the License, or
; (at your option) any later version.
; HM NIS Edit Wizard helper defines
!define VER_MAJOR 2
!define VER_MINOR 0
!define VER_PATCH 0
!define VER_EXTRA "-a3"
!define VER_REVISION "r3300"
!define VER_RELDATE 20110125
!define PRODUCT_NAME "Speed Dreams"
!define PRODUCT_SUBTITLE "an Open Motorsport Sim"
!define PRODUCT_VERSION_FULL "${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}${VER_EXTRA}-${VER_REVISION}"
!define PRODUCT_VERSION "${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}${VER_EXTRA}"
!define PRODUCT_PUBLISHER "The Speed Dreams Team"
!define PRODUCT_WEB_SITE "http://www.speed-dreams.org"
!define PRODUCT_OSID "Speed Dreams 2"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\${PRODUCT_OSID}"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_OSID}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
; Folder where the build system installed everything
!define BUILD_INST_DIR "C:\Program Files\speed-dreams-dev"
SetCompressor lzma
; MUI 1.67 compatible ------
!include "MUI.nsh"
; MUI Settings
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "header.bmp"
!define MUI_ABORTWARNING
!define MUI_ICON "..\..\data\data\icons\icon.ico"
!define MUI_UNICON "..\..\data\data\icons\icon.ico"
; Welcome page
!define MUI_WELCOMEPAGE_TITLE "${PRODUCT_OSID}\n ${PRODUCT_SUBTITLE}"
!define MUI_WELCOMEPAGE_TITLE_3LINES
!insertmacro MUI_PAGE_WELCOME
; License page
!define MUI_LICENSEPAGE_CHECKBOX
!insertmacro MUI_PAGE_LICENSE "${BUILD_INST_DIR}\data\COPYING.txt"
; Old version installed page
Page custom PageReinstall PageLeaveReinstall
; Components page
!insertmacro MUI_PAGE_COMPONENTS
; Directory page
!insertmacro MUI_PAGE_DIRECTORY
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
!define MUI_FINISHPAGE_RUN "$INSTDIR\bin\speed-dreams.exe"
!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\readme.txt"
!define MUI_FINISHPAGE_TITLE_3LINES
!insertmacro MUI_PAGE_FINISH
; Uninstaller pages
!insertmacro MUI_UNPAGE_INSTFILES
; Language files
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
;Reserve Files
;These files should be inserted before other files in the data block
ReserveFile "speed-dreams.ini"
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
; MUI end ------
Name "${PRODUCT_NAME} ${PRODUCT_VERSION_FULL}"
OutFile "speed-dreams-base-${PRODUCT_VERSION_FULL}-win32-setup.exe"
InstallDir "$PROGRAMFILES\speed-dreams-2"
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
ShowInstDetails show
ShowUnInstDetails show
Section "Base System" SEC01
SectionIn RO
SetOverwrite try
; Game license and readme files
SetOutPath "$INSTDIR"
File /oname=licence.txt "${BUILD_INST_DIR}\data\COPYING.txt"
File /oname=readme.txt readme_for_user.txt
; Game executable and DLLs ... but no mod tool (see later)
SetOutPath "$INSTDIR\bin"
File /x sd-*.* "${BUILD_INST_DIR}\bin\*.*"
; Game core loadable modules (physics and graphics engines, track loader, ...)
SetOutPath "$INSTDIR\lib\modules"
File /r "${BUILD_INST_DIR}\lib\modules\*.*"
; Game core data files (sound, textures, menus, car categories, ...)
SetOutPath "$INSTDIR\data"
File "${BUILD_INST_DIR}\data\*.*"
SetOutPath "$INSTDIR\data\categories"
File /r "${BUILD_INST_DIR}\data\categories\*.*"
SetOutPath "$INSTDIR\data\config"
File /r "${BUILD_INST_DIR}\data\config\*.*"
SetOutPath "$INSTDIR\data\data"
File /r "${BUILD_INST_DIR}\data\data\*.*"
; Documentation
SetOutPath "$INSTDIR\doc"
File "..\..\doc\faq\faq.html"
;SetOutPath "$INSTDIR\doc"
File /r /x .svn "..\..\doc\userman\*.*"
; Base robots binaries
SetOutPath "$INSTDIR\lib\drivers\human"
File /r "${BUILD_INST_DIR}\lib\drivers\human\*.*"
SetOutPath "$INSTDIR\lib\drivers\networkhuman"
File /r "${BUILD_INST_DIR}\lib\drivers\networkhuman\*.*"
SetOutPath "$INSTDIR\lib\drivers\simplix_sc"
File /r "${BUILD_INST_DIR}\lib\drivers\simplix_sc\*.*"
SetOutPath "$INSTDIR\lib\drivers\usr_sc"
File /r "${BUILD_INST_DIR}\lib\drivers\usr_sc\*.*"
; Base robots data files (car and track setups)
SetOutPath "$INSTDIR\data\drivers\human"
File /r "${BUILD_INST_DIR}\data\drivers\human\*.*"
SetOutPath "$INSTDIR\data\drivers\networkhuman"
File /r "${BUILD_INST_DIR}\data\drivers\networkhuman\*.*"
SetOutPath "$INSTDIR\data\drivers\simplix_sc"
File /r "${BUILD_INST_DIR}\data\drivers\simplix_sc\*.*"
SetOutPath "$INSTDIR\data\drivers\usr_sc"
File /r "${BUILD_INST_DIR}\data\drivers\usr_sc\*.*"
; Base car models (only Supercars)
SetOutPath "$INSTDIR\data\cars\sc-boxer-96"
File /r "${BUILD_INST_DIR}\data\cars\sc-boxer-96\*.*"
SetOutPath "$INSTDIR\data\cars\sc-cavallo-360"
File /r "${BUILD_INST_DIR}\data\cars\sc-cavallo-360\*.*"
SetOutPath "$INSTDIR\data\cars\sc-fmc-gt4"
File /r "${BUILD_INST_DIR}\data\cars\sc-fmc-gt4\*.*"
SetOutPath "$INSTDIR\data\cars\sc-lynx-220"
File /r "${BUILD_INST_DIR}\data\cars\sc-lynx-220\*.*"
SetOutPath "$INSTDIR\data\cars\sc-murasama-nsx"
File /r "${BUILD_INST_DIR}\data\cars\sc-murasama-nsx\*.*"
SetOutPath "$INSTDIR\data\cars\sc-spirit-300"
File /r "${BUILD_INST_DIR}\data\cars\sc-spirit-300\*.*"
; Base tracks (only Espie)
SetOutPath "$INSTDIR\data\tracks\circuit\espie"
File /r "${BUILD_INST_DIR}\data\tracks\circuit\espie\*.*"
; Start menu entries
CreateDirectory "$SMPROGRAMS\Speed Dreams ${PRODUCT_VERSION}"
SetOutPath "$INSTDIR"
CreateShortCut "$SMPROGRAMS\Speed Dreams ${PRODUCT_VERSION}\Speed Dreams.lnk" "$INSTDIR\bin\speed-dreams.exe"
;CreateShortCut "$SMPROGRAMS\Speed Dreams ${PRODUCT_VERSION}\User Manual.lnk" "$INSTDIR\doc\how_to_drive.html"
;CreateShortCut "$SMPROGRAMS\Speed Dreams ${PRODUCT_VERSION}\Frequently Asked Questions.lnk" "$INSTDIR\doc\faq.html"
CreateShortCut "$SMPROGRAMS\Speed Dreams ${PRODUCT_VERSION}\Read me.lnk" "$INSTDIR\readme.txt"
CreateShortCut "$SMPROGRAMS\Speed Dreams ${PRODUCT_VERSION}\Licence.lnk" "$INSTDIR\licence.txt"
; Desktop shortcut
CreateShortCut "$DESKTOP\Speed Dreams ${PRODUCT_VERSION}.lnk" "$INSTDIR\bin\speed-dreams.exe"
SectionEnd
Section "Mod Tools" SEC02
SetOverwrite ifnewer
; Tools executables
SetOutPath "$INSTDIR\bin"
File "${BUILD_INST_DIR}\bin\sd-*.*"
; Cmake macros for robot developers
SetOutPath "$INSTDIR\data\cmake"
File /r "${BUILD_INST_DIR}\data\cmake\*.*"
; Includes for robot developers
SetOutPath "$INSTDIR\include"
File /r "${BUILD_INST_DIR}\include\*.*"
SectionEnd
; Tip : download a file ($0 = target local file)
;NSISdl::download http://download.nullsoft.com/winamp/client/winamp291_lite.exe $0
;NSISdl::download_quiet http://download.nullsoft.com/winamp/client/winamp291_lite.exe $0
Section -AdditionalIcons
SetOutPath $INSTDIR
WriteIniStr "$INSTDIR\${PRODUCT_OSID}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
CreateShortCut "$SMPROGRAMS\Speed Dreams ${PRODUCT_VERSION}\Web site.lnk" "$INSTDIR\${PRODUCT_OSID}.url"
WriteIniStr "$INSTDIR\trb.url" "InternetShortcut" "URL" "http://www.berniw.org/trb"
CreateShortCut "$SMPROGRAMS\Speed Dreams ${PRODUCT_VERSION}\TORCS Racing Board.lnk" "$INSTDIR\trb.url"
CreateShortCut "$SMPROGRAMS\Speed Dreams ${PRODUCT_VERSION}\Uninstall.lnk" "$INSTDIR\uninst.exe"
SectionEnd
Section -Post
WriteUninstaller "$INSTDIR\uninst.exe"
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\bin\speed-dreams.exe"
WriteRegDword HKLM "${PRODUCT_DIR_REGKEY}" "VersionMajor" "${VER_MAJOR}"
WriteRegDword HKLM "${PRODUCT_DIR_REGKEY}" "VersionMinor" "${VER_MINOR}"
WriteRegDword HKLM "${PRODUCT_DIR_REGKEY}" "VersionRevision" "${VER_PATCH}"
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "VersionExtra" "${VER_EXTRA}"
WriteRegDword HKLM "${PRODUCT_DIR_REGKEY}" "VersionDate" "${VER_RELDATE}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\bin\speed-dreams.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
SectionEnd
; Section descriptions
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SEC01} "Speed Dreams base package : the application, Supercars set and associated AI drivers, and the Espie track."
!insertmacro MUI_DESCRIPTION_TEXT ${SEC02} "Tools for building cars, tracks, robots, menus : trackgen, accc, nfsperf, nfs2ac, menu-view, robotgen."
!insertmacro MUI_FUNCTION_DESCRIPTION_END
Function un.onUninstSuccess
HideWindow
MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully uninstalled."
FunctionEnd
Function un.onInit
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Do you really want to unistall $(^Name) and all its components ?" IDYES +2
Abort
FunctionEnd
Section Uninstall
; Start menu entries.
RMDir /r "$SMPROGRAMS\Speed Dreams ${PRODUCT_VERSION}"
; Desktop shortcut.
Delete "$DESKTOP\Speed Dreams ${PRODUCT_VERSION}.lnk"
; Game binaries and data.
RMDir /r "$INSTDIR"
; Regsitry keys.
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
SetAutoClose true
SectionEnd
;--------------------------------
;Installer Functions, derived from makensis.nsi
Function .onInit
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "speed-dreams.ini"
FunctionEnd
Function PageReinstall
ReadRegStr $R0 HKLM "${PRODUCT_DIR_REGKEY}" ""
StrCmp $R0 "" 0 other_version_present
Abort
other_version_present:
;Detect version
ReadRegDWORD $R0 HKLM "${PRODUCT_DIR_REGKEY}" "VersionMajor"
IntCmp $R0 ${VER_MAJOR} minor_check new_version older_version
minor_check:
ReadRegDWORD $R0 HKLM "${PRODUCT_DIR_REGKEY}" "VersionMinor"
IntCmp $R0 ${VER_MINOR} revision_check new_version older_version
revision_check:
ReadRegDWORD $R0 HKLM "${PRODUCT_DIR_REGKEY}" "VersionRevision"
IntCmp $R0 ${VER_PATCH} build_check new_version older_version
build_check:
ReadRegDWORD $R0 HKLM "${PRODUCT_DIR_REGKEY}" "VersionDate"
IntCmp $R0 ${VER_RELDATE} same_version new_version older_version
new_version:
!insertmacro MUI_INSTALLOPTIONS_WRITE "speed-dreams.ini" "Field 1" "Text" "An older version of Speed Dreams 2 is installed on your system. It is recommended that you uninstall the current version before installing. Select the operation you want to perform and click Next to continue."
!insertmacro MUI_INSTALLOPTIONS_WRITE "speed-dreams.ini" "Field 2" "Text" "Uninstall before installing"
!insertmacro MUI_INSTALLOPTIONS_WRITE "speed-dreams.ini" "Field 3" "Text" "Do not uninstall"
!insertmacro MUI_HEADER_TEXT "Already Installed" "Choose how you want to install Speed Dreams 2."
StrCpy $R0 "1"
Goto reinst_start
older_version:
!insertmacro MUI_INSTALLOPTIONS_WRITE "speed-dreams.ini" "Field 1" "Text" "A newer version of Speed Dreams 2 is already installed! It is not recommended that you install an older version. If you really want to install this older version, it's better to uninstall the current version first. Select the operation you want to perform and click Next to continue."
!insertmacro MUI_INSTALLOPTIONS_WRITE "speed-dreams.ini" "Field 2" "Text" "Uninstall before installing"
!insertmacro MUI_INSTALLOPTIONS_WRITE "speed-dreams.ini" "Field 3" "Text" "Do not uninstall"
!insertmacro MUI_HEADER_TEXT "Already Installed" "Choose how you want to install Speed Dreams 2."
StrCpy $R0 "1"
Goto reinst_start
same_version:
!insertmacro MUI_INSTALLOPTIONS_WRITE "speed-dreams.ini" "Field 1" "Text" "Speed Dreams ${PRODUCT_VERSION} is already installed. Select the operation you want to perform and click Next to continue."
!insertmacro MUI_INSTALLOPTIONS_WRITE "speed-dreams.ini" "Field 2" "Text" "Add / Reinstall components"
!insertmacro MUI_INSTALLOPTIONS_WRITE "speed-dreams.ini" "Field 3" "Text" "Uninstall Speed Dreams 2"
!insertmacro MUI_HEADER_TEXT "Already Installed" "Choose the maintenance option to perform."
StrCpy $R0 "2"
reinst_start:
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "speed-dreams.ini"
FunctionEnd
Function PageLeaveReinstall
!insertmacro MUI_INSTALLOPTIONS_READ $R1 "speed-dreams.ini" "Field 2" "State"
StrCmp $R0 "1" 0 +2
StrCmp $R1 "1" reinst_uninstall reinst_done
StrCmp $R0 "2" 0 +3
StrCmp $R1 "1" reinst_done reinst_uninstall
reinst_uninstall:
ReadRegStr $R1 ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString"
;Run uninstaller
HideWindow
ClearErrors
ExecWait '$R1 _?=$INSTDIR'
IfErrors no_remove_uninstaller
IfFileExists "$INSTDIR\bin\speed-dreams.exe" no_remove_uninstaller
Delete $R1
RMDir $INSTDIR
no_remove_uninstaller:
StrCmp $R0 "2" 0 +2
Quit
BringToFront
reinst_done:
FunctionEnd

View File

@ -0,0 +1,21 @@
[Settings]
NumFields=3
[Field 1]
Type=Label
Left=0
Right=-1
Top=0
Bottom=24
[Field 2]
Type=RadioButton
Left=30
Right=-1
Top=50
Bottom=58
State=1
[Field 3]
Type=RadioButton
Left=30
Right=-1
Top=70
Bottom=78