]> git.mxchange.org Git - flightgear.git/blob - package/Win-NSIS/flightgear-nightly.nsi
e04e0a8479b7924a55d0002a3cd34fde090f6960
[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_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
104   
105   
106   Exec '"$INSTDIR\fgrun.exe"  --silent --fg-exe="$INSTDIR\fgfs.exe" --ts-exe="$INSTDIR\terrasync.exe" '
107   
108   CreateDirectory "$SMPROGRAMS\FlightGear"
109   CreateShortCut "$SMPROGRAMS\FlightGear\FlightGear-nightly.lnk" "$INSTDIR\fgrun.exe" 
110   
111   
112   WriteUninstaller "$INSTDIR\FlightGear_Uninstall.exe"
113   
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/"
121  
122 SectionEnd
123
124
125
126 Section "Uninstall"
127    
128   SetShellVarContext all
129   
130   
131   Delete "$SMPROGRAMS\FlightGear\FlightGear-nightly.lnk"
132   ; only delete the FlightGear group if it's empty
133   RMDir "$SMPROGRAMS\FlightGear"
134   
135   RMDir /r "$INSTDIR"
136   
137   DeleteRegKey HKLM ${UninstallKey}
138
139 SectionEnd
140