Skip to content

Commit

Permalink
Merge branch 'master' of github.com:stuntrally/stuntrally
Browse files Browse the repository at this point in the history
  • Loading branch information
scrawl committed Apr 7, 2012
2 parents 210920d + 336fd7e commit f7ef0ef
Showing 1 changed file with 133 additions and 0 deletions.
133 changes: 133 additions & 0 deletions dist/installer.nsi
@@ -0,0 +1,133 @@
; Script generated by the HM NIS Edit Script Wizard.

; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "Stunt Rally"
!define PRODUCT_VERSION "1.5"
!define PRODUCT_PUBLISHER "Crystal Hammer"
!define PRODUCT_WEB_SITE "http://code.google.com/p/vdrift-ogre/"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\StuntRally.exe"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"

SetCompressor lzma

; MUI 1.67 compatible ------
!include "MUI.nsh"

; MUI Settings
!define MUI_ABORTWARNING
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install-blue.ico"
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall-blue.ico"

; Language Selection Dialog Settings
!define MUI_LANGDLL_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}"
!define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
!define MUI_LANGDLL_REGISTRY_VALUENAME "NSIS:Language"

; Welcome page
!insertmacro MUI_PAGE_WELCOME
; License page
!insertmacro MUI_PAGE_LICENSE "E:\SR\License.txt"
; Directory page
!insertmacro MUI_PAGE_DIRECTORY
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
!define MUI_FINISHPAGE_RUN "$INSTDIR\StuntRally.exe"
!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\Readme.txt"
!insertmacro MUI_PAGE_FINISH

; Uninstaller pages
!insertmacro MUI_UNPAGE_INSTFILES

; Language files
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "Finnish"
!insertmacro MUI_LANGUAGE "French"
!insertmacro MUI_LANGUAGE "German"
!insertmacro MUI_LANGUAGE "Polish"
!insertmacro MUI_LANGUAGE "Romanian"
!insertmacro MUI_LANGUAGE "Russian"

; Reserve files
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS

; MUI end ------

Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "StuntRally-1.5-installer.exe"
InstallDir "$PROGRAMFILES\Stunt Rally 1.5"
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
ShowInstDetails show
ShowUnInstDetails show

Function .onInit
!insertmacro MUI_LANGDLL_DISPLAY
FunctionEnd

Section "Redist" SEC01
SetOutPath "$INSTDIR\redist"
SetOverwrite try
File "E:\redist\*.*"
DetailPrint "Updating DirectX this may take a few moments..."
ExecWait "$INSTDIR\redist\dxsetup.exe /silent"
DetailPrint "Installing VC redistributable..."
ExecWait "$INSTDIR\redist\vcredist_x86.exe"
SectionEnd

Section "StuntRally" SEC02
SetOutPath "$INSTDIR"
SetOverwrite ifnewer
File /r "E:\SR\"
CreateDirectory "$SMPROGRAMS\Stunt Rally 1.5"
CreateShortCut "$SMPROGRAMS\Stunt Rally 1.5\Stunt Rally.lnk" "$INSTDIR\StuntRally.exe"
CreateShortCut "$SMPROGRAMS\Stunt Rally 1.5\SR Track Editor.lnk" "$INSTDIR\SR-Editor.exe"
;CreateShortCut "$DESKTOP\Stunt Rally.lnk" "$INSTDIR\SR-Editor.exe"
SectionEnd

Section -AdditionalIcons
SetOutPath $INSTDIR
WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
CreateShortCut "$SMPROGRAMS\Stunt Rally 1.5\Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url"
CreateShortCut "$SMPROGRAMS\Stunt Rally 1.5\Uninstall.lnk" "$INSTDIR\uninst.exe"
SectionEnd

Section -Post
WriteUninstaller "$INSTDIR\uninst.exe"
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\StuntRally.exe"
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\StuntRally.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


Function un.onUninstSuccess
HideWindow
MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) has been succesfully removed."
FunctionEnd

Function un.onInit
!insertmacro MUI_UNGETLANGUAGE
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Do you want to remove $(^Name) ?" IDYES +2
Abort
FunctionEnd

Section Uninstall
Delete "$SMPROGRAMS\Stunt Rally 1.5\Uninstall.lnk"
Delete "$SMPROGRAMS\Stunt Rally 1.5\Website.lnk"
Delete "$SMPROGRAMS\Stunt Rally 1.5\Stunt Rally.lnk"
Delete "$SMPROGRAMS\Stunt Rally 1.5\SR Track Editor.lnk"
;Delete "$DESKTOP\Stunt Rally.lnk"

RMDir "$SMPROGRAMS\Stunt Rally 1.5"
;RMDir "$INSTDIR\redist"
RMDir /r "$INSTDIR\*.*"
RMDir "$INSTDIR"

DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
SetAutoClose true
SectionEnd

0 comments on commit f7ef0ef

Please sign in to comment.