1
0
Fork 0
flightgear/package/Win-NSIS/flightgear-nightly.nsi

144 lines
4.4 KiB
Text
Raw Normal View History

2010-11-08 10:38:59 +00:00
!include "MUI.nsh"
!system 'osgversion --so-number > %TEMP%\osg-so-number.txt'
!system 'osgversion --version-number > %TEMP%\osg-version.txt'
!define /file OSGSoNumber $%TEMP%\osg-so-number.txt
!define /file OSGVersion $%TEMP%\osg-version.txt
2010-11-14 18:16:01 +00:00
!define /file FGVersion flightgear\version
2010-11-08 10:38:59 +00:00
!echo "osg-so is ${OSGSoNumber}"
Name "FlightGear Nightly"
2010-11-14 18:16:01 +00:00
OutFile fgfs_win32_nightly_${FGVersion}.exe
2010-11-08 10:38:59 +00:00
; use LZMA for best compression
SetCompressor /FINAL /SOLID lzma
SetCompressorDictSize 64
2010-11-08 10:38:59 +00:00
InstallDir $PROGRAMFILES\FlightGear-nightly
; Request admin privileges for Windows Vista
RequestExecutionLevel highest
; don't hang around
AutoCloseWindow true
!define UninstallKey "Software\Microsoft\Windows\CurrentVersion\Uninstall\FlightGear-nightly"
!define FGBinDir "flightgear\projects\VC90\Win32\Release"
!define FGRunBinDir "fgrun\msvc\9.0\Win32\Release"
!define OSGInstallDir "install\msvc90\OpenSceneGraph"
!define OSGPluginsDir "${OSGInstallDir}\bin\osgPlugins-${OSGVersion}"
!define ThirdPartyBinDir "3rdParty\bin"
2010-11-08 22:57:56 +00:00
!define MUI_ICON "flightgear\projects\VC90\flightgear.ico"
!define MUI_UNICON "flightgear\projects\VC90\flightgear.ico"
2010-11-08 10:38:59 +00:00
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_RIGHT
2010-11-08 22:57:56 +00:00
!define MUI_HEADERIMAGE_BITMAP "flightgear\package\Win-NSIS\fg-install-header.bmp" ; optional
2010-11-08 10:38:59 +00:00
;!define MUI_WELCOMEFINISHPAGE_BITMAP "welcome.bmp"
;!define MUI_UNWELCOMEFINISHPAGE_BITMAP "welcome.bmp"
!insertmacro MUI_PAGE_WELCOME
2010-11-08 22:57:56 +00:00
; include GPL license page
!insertmacro MUI_PAGE_LICENSE "flightgear\Copying"
2010-11-08 10:38:59 +00:00
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
2010-11-08 22:57:56 +00:00
!define MUI_FINISHPAGE_RUN $INSTDIR\fgrun.exe
!define MUI_FINISHPAGE_RUN_TEXT "Run FlightGear now"
!insertmacro MUI_PAGE_FINISH
2010-11-08 10:38:59 +00:00
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
; The stuff to install
Section "" ;No components page, name is not important
SetShellVarContext all
; Set output path to the installation directory.
SetOutPath $INSTDIR
File ${FGBinDir}\fgfs.exe
File ${FGBinDir}\fgjs.exe
File ${FGBinDir}\terrasync.exe
File ${FGRunBinDir}\fgrun.exe
File ${OSGInstallDir}\bin\osg${OSGSoNumber}-osg.dll
File ${OSGInstallDir}\bin\osg${OSGSoNumber}-osgDB.dll
File ${OSGInstallDir}\bin\osg${OSGSoNumber}-osgGA.dll
File ${OSGInstallDir}\bin\osg${OSGSoNumber}-osgParticle.dll
File ${OSGInstallDir}\bin\osg${OSGSoNumber}-osgText.dll
File ${OSGInstallDir}\bin\osg${OSGSoNumber}-osgUtil.dll
File ${OSGInstallDir}\bin\osg${OSGSoNumber}-osgViewer.dll
File ${OSGInstallDir}\bin\osg${OSGSoNumber}-osgSim.dll
File ${OSGInstallDir}\bin\osg${OSGSoNumber}-osgFX.dll
File ${OSGInstallDir}\bin\ot12-OpenThreads.dll
File ${ThirdPartyBinDir}\*.dll
; VC runtime redistributables
File "$%VCINSTALLDIR%\redist\x86\Microsoft.VC90.CRT\*.dll"
File /r ${FGRunBinDir}\locale
SetOutPath $INSTDIR\osgPlugins-${OSGVersion}
File ${OSGPluginsDir}\osgdb_ac.dll
File ${OSGPluginsDir}\osgdb_osg.dll
File ${OSGPluginsDir}\osgdb_osga.dll
File ${OSGPluginsDir}\osgdb_3ds.dll
File ${OSGPluginsDir}\osgdb_mdl.dll
2010-11-08 10:38:59 +00:00
File ${OSGPluginsDir}\osgdb_jpeg.dll
File ${OSGPluginsDir}\osgdb_rgb.dll
File ${OSGPluginsDir}\osgdb_png.dll
2011-06-18 19:23:54 +00:00
File ${OSGPluginsDir}\osgdb_dds.dll
2010-11-08 10:38:59 +00:00
File ${OSGPluginsDir}\osgdb_txf.dll
File ${OSGPluginsDir}\osgdb_deprecated_osg.dll
File ${OSGPluginsDir}\osgdb_deprecated_osgparticle.dll
2010-11-08 10:38:59 +00:00
2010-11-08 22:57:56 +00:00
Exec '"$INSTDIR\fgrun.exe" --silent --fg-exe="$INSTDIR\fgfs.exe" --ts-exe="$INSTDIR\terrasync.exe" '
2010-11-08 10:38:59 +00:00
CreateDirectory "$SMPROGRAMS\FlightGear"
CreateShortCut "$SMPROGRAMS\FlightGear\FlightGear-nightly.lnk" "$INSTDIR\fgrun.exe"
2010-11-14 18:16:01 +00:00
2010-11-08 10:38:59 +00:00
WriteUninstaller "$INSTDIR\FlightGear_Uninstall.exe"
WriteRegStr HKLM ${UninstallKey} "DisplayName" "FlightGear Nightly"
2010-11-14 18:16:01 +00:00
WriteRegStr HKLM ${UninstallKey} "DisplayVersion" "${FGVersion}"
2010-11-08 10:38:59 +00:00
WriteRegStr HKLM ${UninstallKey} "UninstallString" "$INSTDIR\FlightGear_Uninstall.exe"
WriteRegStr HKLM ${UninstallKey} "UninstallPath" "$INSTDIR\FlightGear_Uninstall.exe"
WriteRegDWORD HKLM ${UninstallKey} "NoModify" 1
WriteRegDWORD HKLM ${UninstallKey} "NoRepair" 1
WriteRegStr HKLM ${UninstallKey} "URLInfoAbout" "http://www.flightgear.org/"
SectionEnd
Section "Uninstall"
SetShellVarContext all
Delete "$SMPROGRAMS\FlightGear\FlightGear-nightly.lnk"
; only delete the FlightGear group if it's empty
RMDir "$SMPROGRAMS\FlightGear"
2010-11-08 10:38:59 +00:00
RMDir /r "$INSTDIR"
DeleteRegKey HKLM ${UninstallKey}
SectionEnd
2011-06-18 19:23:54 +00:00