3 !system 'osgversion --so-number > %TEMP%\osg-so-number.txt'
4 !system 'osgversion --version-number > %TEMP%\osg-version.txt'
6 !define /file OSGSoNumber $%TEMP%\osg-so-number.txt
7 !define /file OSGVersion $%TEMP%\osg-version.txt
8 !define /file FGVersion flightgear\version
10 !echo "osg-so is ${OSGSoNumber}"
12 Name "FlightGear Nightly"
13 OutFile fgfs_win32_nightly_${FGVersion}.exe
15 ; use LZMA for best compression
16 SetCompressor /FINAL /SOLID lzma
17 SetCompressorDictSize 64
19 InstallDir $PROGRAMFILES\FlightGear-nightly
21 ; Request admin privileges for Windows Vista
22 RequestExecutionLevel highest
27 !define UninstallKey "Software\Microsoft\Windows\CurrentVersion\Uninstall\FlightGear-nightly"
28 !define FGBinDir "flightgear\projects\VC90\Win32\Release"
29 !define FGRunBinDir "fgrun\msvc\9.0\Win32\Release"
30 !define OSGInstallDir "install\msvc90\OpenSceneGraph"
31 !define OSGPluginsDir "${OSGInstallDir}\bin\osgPlugins-${OSGVersion}"
33 !define ThirdPartyBinDir "3rdParty\bin"
35 !define MUI_ICON "flightgear\projects\VC90\flightgear.ico"
36 !define MUI_UNICON "flightgear\projects\VC90\flightgear.ico"
38 !define MUI_HEADERIMAGE
39 !define MUI_HEADERIMAGE_RIGHT
40 !define MUI_HEADERIMAGE_BITMAP "flightgear\package\Win-NSIS\fg-install-header.bmp" ; optional
44 ;!define MUI_WELCOMEFINISHPAGE_BITMAP "welcome.bmp"
45 ;!define MUI_UNWELCOMEFINISHPAGE_BITMAP "welcome.bmp"
47 !insertmacro MUI_PAGE_WELCOME
48 ; include GPL license page
49 !insertmacro MUI_PAGE_LICENSE "flightgear\Copying"
50 !insertmacro MUI_PAGE_DIRECTORY
51 !insertmacro MUI_PAGE_INSTFILES
53 !define MUI_FINISHPAGE_RUN $INSTDIR\fgrun.exe
54 !define MUI_FINISHPAGE_RUN_TEXT "Run FlightGear now"
55 !insertmacro MUI_PAGE_FINISH
58 !insertmacro MUI_UNPAGE_CONFIRM
59 !insertmacro MUI_UNPAGE_INSTFILES
61 !insertmacro MUI_LANGUAGE "English"
63 ; The stuff to install
64 Section "" ;No components page, name is not important
66 SetShellVarContext all
67 ; Set output path to the installation directory.
70 File ${FGBinDir}\fgfs.exe
71 File ${FGBinDir}\fgjs.exe
72 File ${FGBinDir}\terrasync.exe
73 File ${FGRunBinDir}\fgrun.exe
75 File ${OSGInstallDir}\bin\osg${OSGSoNumber}-osg.dll
76 File ${OSGInstallDir}\bin\osg${OSGSoNumber}-osgDB.dll
77 File ${OSGInstallDir}\bin\osg${OSGSoNumber}-osgGA.dll
78 File ${OSGInstallDir}\bin\osg${OSGSoNumber}-osgParticle.dll
79 File ${OSGInstallDir}\bin\osg${OSGSoNumber}-osgText.dll
80 File ${OSGInstallDir}\bin\osg${OSGSoNumber}-osgUtil.dll
81 File ${OSGInstallDir}\bin\osg${OSGSoNumber}-osgViewer.dll
82 File ${OSGInstallDir}\bin\osg${OSGSoNumber}-osgSim.dll
83 File ${OSGInstallDir}\bin\osg${OSGSoNumber}-osgFX.dll
85 File ${OSGInstallDir}\bin\ot12-OpenThreads.dll
87 File ${ThirdPartyBinDir}\*.dll
89 ; VC runtime redistributables
90 File "$%VCINSTALLDIR%\redist\x86\Microsoft.VC90.CRT\*.dll"
92 File /r ${FGRunBinDir}\locale
94 SetOutPath $INSTDIR\osgPlugins-${OSGVersion}
95 File ${OSGPluginsDir}\osgdb_ac.dll
96 File ${OSGPluginsDir}\osgdb_osg.dll
97 File ${OSGPluginsDir}\osgdb_3ds.dll
98 File ${OSGPluginsDir}\osgdb_mdl.dll
99 File ${OSGPluginsDir}\osgdb_jpeg.dll
100 File ${OSGPluginsDir}\osgdb_rgb.dll
101 File ${OSGPluginsDir}\osgdb_png.dll
102 File ${OSGPluginsDir}\osgdb_dds.dll
103 File ${OSGPluginsDir}\osgdb_txf.dll
106 Exec '"$INSTDIR\fgrun.exe" --silent --fg-exe="$INSTDIR\fgfs.exe" --ts-exe="$INSTDIR\terrasync.exe" '
108 CreateDirectory "$SMPROGRAMS\FlightGear"
109 CreateShortCut "$SMPROGRAMS\FlightGear\FlightGear-nightly.lnk" "$INSTDIR\fgrun.exe"
112 WriteUninstaller "$INSTDIR\FlightGear_Uninstall.exe"
114 WriteRegStr HKLM ${UninstallKey} "DisplayName" "FlightGear Nightly"
115 WriteRegStr HKLM ${UninstallKey} "DisplayVersion" "${FGVersion}"
116 WriteRegStr HKLM ${UninstallKey} "UninstallString" "$INSTDIR\FlightGear_Uninstall.exe"
117 WriteRegStr HKLM ${UninstallKey} "UninstallPath" "$INSTDIR\FlightGear_Uninstall.exe"
118 WriteRegDWORD HKLM ${UninstallKey} "NoModify" 1
119 WriteRegDWORD HKLM ${UninstallKey} "NoRepair" 1
120 WriteRegStr HKLM ${UninstallKey} "URLInfoAbout" "http://www.flightgear.org/"
128 SetShellVarContext all
131 Delete "$SMPROGRAMS\FlightGear\FlightGear-nightly.lnk"
132 ; only delete the FlightGear group if it's empty
133 RMDir "$SMPROGRAMS\FlightGear"
137 DeleteRegKey HKLM ${UninstallKey}