]> git.mxchange.org Git - flightgear.git/blob - package/Win-NSIS/flightgear-nightly-vs2010.nsi
FG-Win32-nightly: introduce common /bin /share structure
[flightgear.git] / package / Win-NSIS / flightgear-nightly-vs2010.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 vs2010"
13 OutFile fgfs_win32_vs2010_nightly_${FGVersion}.exe
14
15 ; use LZMA for best compression
16 SetCompressor /FINAL /SOLID lzma
17 SetCompressorDictSize 64
18
19 InstallDir $PROGRAMFILES\FlightGear-nightly-2010
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-2010"
28 !define FGBinDir "install\msvc100\FlightGear\bin"
29 !define FGShareDir "install\msvc100\FlightGear\share"
30 !define FGRunDir "install\msvc100\fgrun"
31 !define OSGInstallDir "install\msvc100\OpenSceneGraph"
32 !define OSGPluginsDir "${OSGInstallDir}\bin\osgPlugins-${OSGVersion}"
33
34 !define ThirdPartyBinDir "3rdParty\bin"
35
36 !define MUI_ICON "flightgear\package\flightgear.ico"
37 !define MUI_UNICON "flightgear\package\flightgear.ico"
38
39 !define MUI_HEADERIMAGE
40 !define MUI_HEADERIMAGE_RIGHT
41 !define MUI_HEADERIMAGE_BITMAP "flightgear\package\Win-NSIS\fg-install-header.bmp" ; optional
42
43
44
45 ;!define MUI_WELCOMEFINISHPAGE_BITMAP "welcome.bmp"
46 ;!define MUI_UNWELCOMEFINISHPAGE_BITMAP "welcome.bmp"
47
48 !insertmacro MUI_PAGE_WELCOME
49 ; include GPL license page
50 !insertmacro MUI_PAGE_LICENSE "flightgear\Copying"
51 !insertmacro MUI_PAGE_DIRECTORY
52 !insertmacro MUI_PAGE_INSTFILES
53
54 !define MUI_FINISHPAGE_RUN $INSTDIR\bin\fgrun.exe
55 !define MUI_FINISHPAGE_RUN_TEXT "Run FlightGear now"
56 !insertmacro MUI_PAGE_FINISH
57
58
59 !insertmacro MUI_UNPAGE_CONFIRM
60 !insertmacro MUI_UNPAGE_INSTFILES
61
62 !insertmacro MUI_LANGUAGE "English"
63
64 ; The stuff to install
65 Section "" ;No components page, name is not important  
66         
67   SetShellVarContext all
68   ; Set output path to the installation directory.
69   SetOutPath $INSTDIR\share\flightgear
70   File ${FGShareDir}\flightgear\positions.txt
71   File ${FGShareDir}\flightgear\special_frequencies.txt
72   
73   SetOutPath $INSTDIR\bin
74   File ${FGBinDir}\fgfs.exe
75   File ${FGBinDir}\fgjs.exe
76   File ${FGBinDir}\terrasync.exe
77   File ${FGRunDir}\bin\fgrun.exe
78   File ${FGBinDir}\fgcom.exe
79
80   File ${OSGInstallDir}\bin\osg${OSGSoNumber}-osg.dll
81   File ${OSGInstallDir}\bin\osg${OSGSoNumber}-osgDB.dll
82   File ${OSGInstallDir}\bin\osg${OSGSoNumber}-osgGA.dll
83   File ${OSGInstallDir}\bin\osg${OSGSoNumber}-osgParticle.dll
84   File ${OSGInstallDir}\bin\osg${OSGSoNumber}-osgText.dll
85   File ${OSGInstallDir}\bin\osg${OSGSoNumber}-osgUtil.dll
86   File ${OSGInstallDir}\bin\osg${OSGSoNumber}-osgViewer.dll
87   File ${OSGInstallDir}\bin\osg${OSGSoNumber}-osgSim.dll
88   File ${OSGInstallDir}\bin\osg${OSGSoNumber}-osgFX.dll
89   
90   File ${OSGInstallDir}\bin\ot13-OpenThreads.dll
91   
92   File ${ThirdPartyBinDir}\*.dll
93   
94   ; VC runtime redistributables
95   File "$%VCINSTALLDIR%\redist\x86\Microsoft.VC100.CRT\*.dll"
96   
97   File /r ${FGRunDir}\share\locale
98   
99   SetOutPath $INSTDIR\bin\osgPlugins-${OSGVersion}
100   File ${OSGPluginsDir}\osgdb_ac.dll
101   File ${OSGPluginsDir}\osgdb_osg.dll
102   File ${OSGPluginsDir}\osgdb_osga.dll
103   File ${OSGPluginsDir}\osgdb_3ds.dll
104   File ${OSGPluginsDir}\osgdb_mdl.dll
105   File ${OSGPluginsDir}\osgdb_jpeg.dll
106   File ${OSGPluginsDir}\osgdb_rgb.dll  
107   File ${OSGPluginsDir}\osgdb_png.dll
108   File ${OSGPluginsDir}\osgdb_dds.dll
109   File ${OSGPluginsDir}\osgdb_txf.dll
110   File ${OSGPluginsDir}\osgdb_freetype.dll
111   File ${OSGPluginsDir}\osgdb_serializers_osg.dll
112   File ${OSGPluginsDir}\osgdb_serializers_osganimation.dll
113   File ${OSGPluginsDir}\osgdb_serializers_osgfx.dll
114   File ${OSGPluginsDir}\osgdb_serializers_osgmanipulator.dll
115   File ${OSGPluginsDir}\osgdb_serializers_osgparticle.dll
116   File ${OSGPluginsDir}\osgdb_serializers_osgshadow.dll
117   File ${OSGPluginsDir}\osgdb_serializers_osgsim.dll
118   File ${OSGPluginsDir}\osgdb_serializers_osgterrain.dll
119   File ${OSGPluginsDir}\osgdb_serializers_osgtext.dll
120   File ${OSGPluginsDir}\osgdb_serializers_osgvolume.dll
121   File ${OSGPluginsDir}\osgdb_deprecated_osg.dll
122   File ${OSGPluginsDir}\osgdb_deprecated_osgparticle.dll
123   
124   
125   Exec '"$INSTDIR\bin\fgrun.exe"  --silent --fg-exe="$INSTDIR\bin\fgfs.exe" --ts-exe="$INSTDIR\bin\terrasync.exe" '
126   
127   CreateDirectory "$SMPROGRAMS\FlightGear"
128   CreateShortCut "$SMPROGRAMS\FlightGear\FlightGear-nightly-2010.lnk" "$INSTDIR\bin\fgrun.exe"
129   CreateShortCut "$SMPROGRAMS\FlightGear\FGCom-nightly-2010.lnk" "$INSTDIR\bin\fgcom.exe"
130   CreateShortCut "$SMPROGRAMS\FlightGear\FGCom-testing-nightly-2010.lnk" "$INSTDIR\bin\fgcom.exe -f910"
131   
132   
133   WriteUninstaller "$INSTDIR\bin\FlightGear_Uninstall.exe"
134   
135   WriteRegStr HKLM ${UninstallKey} "DisplayName" "FlightGear Nightly (vs2010 build)"
136   WriteRegStr HKLM ${UninstallKey} "DisplayVersion" "${FGVersion}"
137   WriteRegStr HKLM ${UninstallKey} "UninstallString" "$INSTDIR\bin\FlightGear_Uninstall.exe"
138   WriteRegStr HKLM ${UninstallKey} "UninstallPath" "$INSTDIR\bin\FlightGear_Uninstall.exe"
139   WriteRegDWORD HKLM ${UninstallKey} "NoModify" 1
140   WriteRegDWORD HKLM ${UninstallKey} "NoRepair" 1
141   WriteRegStr HKLM ${UninstallKey} "URLInfoAbout" "http://www.flightgear.org/"
142  
143 SectionEnd
144
145
146
147 Section "Uninstall"
148    
149   SetShellVarContext all
150   
151   
152   Delete "$SMPROGRAMS\FlightGear\FlightGear-nightly-2010.lnk"
153   Delete "$SMPROGRAMS\FlightGear\FGCom-nightly-2010.lnk"
154   Delete "$SMPROGRAMS\FlightGear\FGCom-testing-nightly-2010.lnk"
155   ; only delete the FlightGear group if it's empty
156   RMDir "$SMPROGRAMS\FlightGear"
157   
158   RMDir /r "$INSTDIR"
159   
160   DeleteRegKey HKLM ${UninstallKey}
161
162 SectionEnd
163