]> git.mxchange.org Git - flightgear.git/blob - package/Win-NSIS/flightgear-nightly.nsi
Bundle more OSG plugins in nightly builds[D
[flightgear.git] / package / Win-NSIS / flightgear-nightly.nsi
1 !include "MUI.nsh"
2
3 !system 'osgversion --so-number > %TEMP%\osg-so-number.txt'
4 !system 'osgversion --version-number > %TEMP%\osg-version.txt'
5
6 !define /file OSGSoNumber $%TEMP%\osg-so-number.txt
7 !define /file OSGVersion $%TEMP%\osg-version.txt
8 !define /file FGVersion flightgear\version
9
10 !echo "osg-so is ${OSGSoNumber}"
11
12 Name "FlightGear Nightly"
13 OutFile fgfs_win32_nightly_${FGVersion}.exe
14
15 ; use LZMA for best compression
16 SetCompressor /FINAL /SOLID lzma
17 SetCompressorDictSize 64
18
19 InstallDir $PROGRAMFILES\FlightGear-nightly
20
21 ; Request admin privileges for Windows Vista
22 RequestExecutionLevel highest
23
24 ; don't hang around
25 AutoCloseWindow true
26                 
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}"
32
33 !define ThirdPartyBinDir "3rdParty\bin"
34
35 !define MUI_ICON "flightgear\projects\VC90\flightgear.ico"
36 !define MUI_UNICON "flightgear\projects\VC90\flightgear.ico"
37
38 !define MUI_HEADERIMAGE
39 !define MUI_HEADERIMAGE_RIGHT
40 !define MUI_HEADERIMAGE_BITMAP "flightgear\package\Win-NSIS\fg-install-header.bmp" ; optional
41
42
43
44 ;!define MUI_WELCOMEFINISHPAGE_BITMAP "welcome.bmp"
45 ;!define MUI_UNWELCOMEFINISHPAGE_BITMAP "welcome.bmp"
46
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
52
53 !define MUI_FINISHPAGE_RUN $INSTDIR\fgrun.exe
54 !define MUI_FINISHPAGE_RUN_TEXT "Run FlightGear now"
55 !insertmacro MUI_PAGE_FINISH
56
57
58 !insertmacro MUI_UNPAGE_CONFIRM
59 !insertmacro MUI_UNPAGE_INSTFILES
60
61 !insertmacro MUI_LANGUAGE "English"
62
63 ; The stuff to install
64 Section "" ;No components page, name is not important  
65         
66   SetShellVarContext all
67   ; Set output path to the installation directory.
68   SetOutPath $INSTDIR
69   
70   File ${FGBinDir}\fgfs.exe
71   File ${FGBinDir}\fgjs.exe
72   File ${FGBinDir}\terrasync.exe
73   File ${FGRunBinDir}\fgrun.exe
74   
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
84   
85   File ${OSGInstallDir}\bin\ot12-OpenThreads.dll
86   
87   File ${ThirdPartyBinDir}\*.dll
88   
89   ; VC runtime redistributables
90   File "$%VCINSTALLDIR%\redist\x86\Microsoft.VC90.CRT\*.dll"
91   
92   File /r ${FGRunBinDir}\locale
93   
94   SetOutPath $INSTDIR\osgPlugins-${OSGVersion}
95   File ${OSGPluginsDir}\osgdb_ac.dll
96   File ${OSGPluginsDir}\osgdb_osg.dll
97   File ${OSGPluginsDir}\osgdb_osga.dll
98   File ${OSGPluginsDir}\osgdb_3ds.dll
99   File ${OSGPluginsDir}\osgdb_mdl.dll
100   File ${OSGPluginsDir}\osgdb_jpeg.dll
101   File ${OSGPluginsDir}\osgdb_rgb.dll  
102   File ${OSGPluginsDir}\osgdb_png.dll
103   File ${OSGPluginsDir}\osgdb_dds.dll
104   File ${OSGPluginsDir}\osgdb_txf.dll
105   File ${OSGPluginsDir}\osgdb_deprecated_osg.dll
106   File ${OSGPluginsDir}\osgdb_deprecated_osgparticle.dll
107   
108   
109   Exec '"$INSTDIR\fgrun.exe"  --silent --fg-exe="$INSTDIR\fgfs.exe" --ts-exe="$INSTDIR\terrasync.exe" '
110   
111   CreateDirectory "$SMPROGRAMS\FlightGear"
112   CreateShortCut "$SMPROGRAMS\FlightGear\FlightGear-nightly.lnk" "$INSTDIR\fgrun.exe" 
113   
114   
115   WriteUninstaller "$INSTDIR\FlightGear_Uninstall.exe"
116   
117   WriteRegStr HKLM ${UninstallKey} "DisplayName" "FlightGear Nightly"
118   WriteRegStr HKLM ${UninstallKey} "DisplayVersion" "${FGVersion}"
119   WriteRegStr HKLM ${UninstallKey} "UninstallString" "$INSTDIR\FlightGear_Uninstall.exe"
120   WriteRegStr HKLM ${UninstallKey} "UninstallPath" "$INSTDIR\FlightGear_Uninstall.exe"
121   WriteRegDWORD HKLM ${UninstallKey} "NoModify" 1
122   WriteRegDWORD HKLM ${UninstallKey} "NoRepair" 1
123   WriteRegStr HKLM ${UninstallKey} "URLInfoAbout" "http://www.flightgear.org/"
124  
125 SectionEnd
126
127
128
129 Section "Uninstall"
130    
131   SetShellVarContext all
132   
133   
134   Delete "$SMPROGRAMS\FlightGear\FlightGear-nightly.lnk"
135   ; only delete the FlightGear group if it's empty
136   RMDir "$SMPROGRAMS\FlightGear"
137   
138   RMDir /r "$INSTDIR"
139   
140   DeleteRegKey HKLM ${UninstallKey}
141
142 SectionEnd
143