/[pcsx2_0.9.7]/trunk/nsis/pcsx2_web_install.nsi
ViewVC logotype

Annotation of /trunk/nsis/pcsx2_web_install.nsi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 62 - (hide annotations) (download)
Tue Sep 7 11:08:22 2010 UTC (9 years, 4 months ago) by william
File size: 10816 byte(s)
Auto Commited Import of: pcsx2-0.9.7-r3738-debug in ./trunk
1 william 62
2     ; PCSX2 Web-based Install Package!
3     ; (a NSIS installer script)
4     ;
5     ; Copyright 2009-2010 PCSX2 Dev Team
6     ;
7     ; The installer generated by this script will download all relevant components for
8     ; PCSX2 from a variety of mirror hosts. Packages are only downloaded on an as-needed
9     ; basis; this most importantly applies to the very bulky VS 2008 and VS2010 packages.
10    
11     !ifndef INC_ZZOGL
12     ; Includes ZZOGL and CG Toolkit (via web install). Currently not supported (work in progress)
13     !define INC_ZZOGL 0
14     !endif
15    
16     !define OUTFILE_POSTFIX "websetup"
17     !include "SharedBase.nsh"
18    
19     !insertmacro MUI_PAGE_COMPONENTS
20     !insertmacro MUI_PAGE_DIRECTORY
21     !insertmacro MUI_PAGE_INSTFILES
22    
23     !insertmacro MUI_UNPAGE_CONFIRM
24     !insertmacro MUI_UNPAGE_COMPONENTS
25     !insertmacro MUI_UNPAGE_INSTFILES
26    
27     !insertmacro MUI_LANGUAGE "English"
28    
29     !include "ApplyExeProps.nsh"
30     !include "SharedRedtape.nsh"
31    
32     ; =======================================================================
33     ; Installer Sections
34     ; =======================================================================
35    
36     ; -----------------------------------------------------------------------
37     ; Basic section (emulation proper)
38     Section "!${APP_NAME} (required)" SEC_CORE
39    
40     SectionIn RO
41    
42     !include "SectionCoreReqs.nsh"
43    
44     ; ------------------------------------------
45     ; -- Plugins Section --
46     ; ------------------------------------------
47    
48     !if ${INC_PLUGINS} > 0
49    
50     ; [TODO] : Eventually the 'latest' plugin packages should be downloaded from one
51     ; of our mirrors. For now plugins are included in the web installer.
52    
53     SetOutPath "$INSTDIR\Plugins"
54     !insertmacro UNINSTALL.LOG_OPEN_INSTALL
55    
56     File /nonfatal /oname=gsdx-sse2-r${SVNREV_GSDX}.dll ..\bin\Plugins\gsdx-sse2.dll
57     File /nonfatal /oname=gsdx-ssse3-r${SVNREV_GSDX}.dll ..\bin\Plugins\gsdx-ssse3.dll
58     File /nonfatal /oname=gsdx-sse4-r${SVNREV_GSDX}.dll ..\bin\Plugins\gsdx-sse4.dll
59     File /nonfatal /oname=zerogs-r${SVNREV_ZEROGS}.dll ..\bin\Plugins\zerogs.dll
60    
61     File /nonfatal /oname=spu2-x-r${SVNREV_SPU2X}.dll ..\bin\Plugins\spu2-x.dll
62     File /nonfatal /oname=zerospu2-r${SVNREV_ZEROSPU2}.dll ..\bin\Plugins\zerospu2.dll
63    
64     File /nonfatal /oname=cdvdiso-r${SVNREV_CDVDISO}.dll ..\bin\Plugins\cdvdiso.dll
65     File ..\bin\Plugins\cdvdGigaherz.dll
66    
67     File /nonfatal /oname=lilypad-r${SVNREV_LILYPAD}.dll ..\bin\Plugins\lilypad.dll
68     File ..\bin\Plugins\PadSSSPSX.dll
69    
70     ;File ..\bin\Plugins\FWlinuz.dll
71    
72     !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
73    
74     !endif
75    
76     SectionEnd
77    
78     !include "SectionShortcuts.nsh"
79    
80     !if ${INC_ZZOGL} > 0
81     Section "ZZogl Plugin (requires OpenGL)"
82    
83     SetOutPath "$INSTDIR\Plugins"
84     !insertmacro UNINSTALL.LOG_OPEN_INSTALL
85     File /oname=zzogl-pg-r${SVNREV_ZZOGL}.dll ..\bin\Plugins\zzogl-pg.dll
86     !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
87    
88     SectionEnd
89    
90     Section "Nvidia's CG Toolkit"
91    
92     ; This section is required by anything using OpenGL, typically.
93     ; It should be automatically checked when ZZogl is enabled.
94    
95     ; CG Toolkit would be downloaded from here:
96     ; http://developer.download.nvidia.com/cg/Cg_2.2/Cg-2.2_February2010_Setup.exe
97    
98     SectionEnd
99     !endif
100    
101     ; -----------------------------------------------------------------------
102     ; MSVC Redistributable - required if the user does not already have it
103     ; Note: if your NSIS generates an error here it means you need to download the latest
104     ; visual studio redist package from microsoft. Any redist 2008/SP1 or newer will do.
105     ;
106     ; IMPORTANT: Online references for how to detect the presence of the VS2008 redists LIE.
107     ; None of the methods are reliable, because the registry keys placed by the MSI installer
108     ; vary depending on operating system *and* MSI installer version (youch).
109     ;
110     Section "Microsoft Visual C++ 2008 SP1 Redist (required)" SEC_CRT2008
111    
112     ;SectionIn RO
113    
114     ; Downloaded from:
115     ; http://download.microsoft.com/download/d/d/9/dd9a82d0-52ef-40db-8dab-795376989c03/vcredist_x86.exe
116    
117     SetOutPath "$TEMP"
118    
119     DetailPrint "Downloading Visual C++ 2008 SP1 Redistributable Setup..."
120     DetailPrint "Contacting Microsoft.com..."
121     NSISdl::download /TIMEOUT=15000 "http://download.microsoft.com/download/d/d/9/dd9a82d0-52ef-40db-8dab-795376989c03/vcredist_x86.exe" "vcredist_2008_sp1_x86.exe"
122    
123     Pop $R0 ;Get the return value
124     StrCmp $R0 "success" OnSuccess
125     DetailPrint "Cound not contact Microsoft.com, or the file has been (re)moved!"
126     DetailPrint "Contacting Googlecode.com..."
127     NSISdl::download /TIMEOUT=20000 "http://pcsx2.googlecode.com/files/vcredist_2008_sp1_x86.exe" "vcredist_2008_sp1_x86.exe"
128    
129     ; [TODO] Provide a mirror for this file hosted from pcsx2.net .. ? or emudev.net .. ?
130     ;Pop $R0 ;Get the return value
131     ;StrCmp $R0 "success" +2
132     ;NSISdl::download /TIMEOUT=15000 "http://www.pcsx2.net/vcredist_x86.exe" "vcredist_2008_sp1_x86.exe"
133    
134     Pop $R0 ;Get the return value
135     StrCmp $R0 "success" +2
136     MessageBox MB_OK "Could not download Visual Studio 2008 Redist; none of the mirrors appear to be functional."
137     Goto done
138    
139     OnSuccess:
140     DetailPrint "Running Visual C++ 2008 SP1 Redistributable Setup..."
141     ExecWait '"$TEMP\vcredist_2008_sp1_x86.exe" /qb'
142     DetailPrint "Finished Visual C++ 2008 SP1 Redistributable Setup"
143     Delete "$TEMP\vcredist_2008_sp1_x86.exe"
144    
145     done:
146     SectionEnd
147    
148     Section "Microsoft Visual C++ 2010 Redist (required)" SEC_CRT2010
149    
150     ; Make this required on the web installer, since it has a fully reliable check to
151     ; see if it needs to be downloaded and installed or not.
152     SectionIn RO
153    
154     ; Detection made easy: Unlike previous redists, VC2010 now generates a platform
155     ; independent key for checking availability.
156    
157     ; Downloaded from:
158     ; http://download.microsoft.com/download/5/B/C/5BC5DBB3-652D-4DCE-B14A-475AB85EEF6E/vcredist_x86.exe
159    
160     ClearErrors
161     ReadRegDword $R0 HKLM "SOFTWARE\Microsoft\VisualStudio\10.0\VC\VCRedist\x86" "Installed"
162     IfErrors 0 +2
163     DetailPrint "Visual C++ 2010 Redistributable registry key was not found; assumed to be uninstalled."
164     StrCmp $R0 "1" 0 +3
165     DetailPrint "Visual C++ 2010 Redistributable is already installed; skipping!"
166     Goto done
167    
168     SetOutPath "$TEMP"
169    
170     DetailPrint "Downloading Visual C++ 2010 Redistributable Setup..."
171     DetailPrint "Contacting Microsoft.com..."
172     NSISdl::download /TIMEOUT=15000 "http://download.microsoft.com/download/5/B/C/5BC5DBB3-652D-4DCE-B14A-475AB85EEF6E/vcredist_x86.exe" "vcredist_2010_x86.exe"
173    
174     Pop $R0 ;Get the return value
175     StrCmp $R0 "success" OnSuccess
176     DetailPrint "Cound not contact Microsoft.com, or the file has been (re)moved!"
177     DetailPrint "Contacting Googlecode.com..."
178     NSISdl::download /TIMEOUT=20000 "http://pcsx2.googlecode.com/files/vcredist_2010_x86.exe" "vcredist_2010_x86.exe"
179    
180     ; [TODO] Provide a mirror for this file hosted from pcsx2.net .. ? or emudev.net .. ?
181     ;Pop $R0 ;Get the return value
182     ;StrCmp $R0 "success" +2
183     ;NSISdl::download /TIMEOUT=30000 "http://www.pcsx2.net/vcredist_x86.exe" "vcredist_2010_x86.exe"
184    
185     Pop $R0 ;Get the return value
186     StrCmp $R0 "success" +2
187     MessageBox MB_OK "Could not download Visual Studio 2010 Redist; none of the mirrors appear to be functional."
188     Goto done
189    
190     OnSuccess:
191     DetailPrint "Running Visual C++ 2010 SP1 Redistributable Setup..."
192     ExecWait '"$TEMP\vcredist_2010_x86.exe" /qb'
193     DetailPrint "Finished Visual C++ 2010 SP1 Redistributable Setup"
194    
195     Delete "$TEMP\vcredist_2010_x86.exe"
196    
197     done:
198     SectionEnd
199    
200     ; -----------------------------------------------------------------------
201     ; This section needs to be last, so that in case it fails, the rest of the program will
202     ; be installed cleanly.
203     ;
204     ; This section could be optional, but why not? It's pretty painless to double-check that
205     ; all the libraries are up-to-date.
206     ;
207     Section "DirectX Web Setup (recommended)" SEC_DIRECTX
208    
209     ;SectionIn RO
210    
211     SetOutPath "$TEMP"
212    
213     DetailPrint "Downloading DirectX Web Setup..."
214     DetailPrint "Contacting Microsoft.com..."
215     NSISdl::download /TIMEOUT=15000 "http://download.microsoft.com/download/1/7/1/1718CCC4-6315-4D8E-9543-8E28A4E18C4C/dxwebsetup.exe" dxwebsetup.exe
216    
217     ; No mirrors provided for the dx web setup. Either we get it from Microsoft, or we don't bother.
218     ; (this is done because there's a good chance the dxwebsetup we provide won't work anyway, if Microsoft
219     ; has in fact re-arranged their website (again)).
220    
221     ;Pop $R0 ;Get the return value
222     ;StrCmp $R0 "success" OnSuccess
223     ;DetailPrint "Cound not contact Microsoft.com, or the file has been (re)moved!"
224     ;DetailPrint "Contacting Googlecode.com..."
225     ;NSISdl::download /TIMEOUT=20000 "http://code.google.com/dxwebsetup01.exe" "dxwebsetup.exe"
226    
227     Pop $R0 ;Get the return value
228     StrCmp $R0 "success" OnSuccess
229     DetailPrint "Cound not contact Microsoft.com, or the file has been (re)moved!"
230     MessageBox MB_OK "Could not download the DirectX Web Setup. Microsoft probably rearranged their website. Please do an internet search for 'DirectX Setup' and download and install it yourself after this installer has finished."
231     Goto done
232    
233     ;Pop $R0 ;Get the return value
234     ;StrCmp $R0 "success" +2
235     ;NSISdl::download /TIMEOUT=30000 "http://www.pcsx2.net/dxwebsetup.exe" "dxwebsetup.exe"
236    
237     OnSuccess:
238     DetailPrint "Running DirectX Web Setup..."
239     ExecWait '"$TEMP\dxwebsetup.exe" /Q' $DirectXSetupError
240     DetailPrint "Finished DirectX Web Setup"
241     Delete "$TEMP\dxwebsetup.exe"
242    
243     done:
244    
245     SectionEnd
246    
247     !include "SectionUninstaller.nsh"
248    
249     LangString DESC_CORE ${LANG_ENGLISH} "Core components (binaries, plugins, languages, etc)."
250    
251     LangString DESC_STARTMENU ${LANG_ENGLISH} "Adds shortcuts for PCSX2 to the start menu (all users)."
252     LangString DESC_DESKTOP ${LANG_ENGLISH} "Adds a shortcut for PCSX2 to the desktop (all users)."
253    
254     LangString DESC_CRT2008 ${LANG_ENGLISH} "Required! Only uncheck if you are certain this component is already installed."
255     LangString DESC_CRT2010 ${LANG_ENGLISH} "Will only be downloaded if you don't already have it installed."
256     LangString DESC_DIRECTX ${LANG_ENGLISH} "Only uncheck this if you are quite certain your Direct3D runtimes are up to date."
257    
258     !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
259     !insertmacro MUI_DESCRIPTION_TEXT ${SEC_CORE} $(DESC_CORE)
260     !insertmacro MUI_DESCRIPTION_TEXT ${SEC_STARTMENU} $(DESC_STARTMENU)
261     !insertmacro MUI_DESCRIPTION_TEXT ${SEC_DESKTOP} $(DESC_DESKTOP)
262    
263     !insertmacro MUI_DESCRIPTION_TEXT ${SEC_CRT2008} $(DESC_CRT2008)
264     !insertmacro MUI_DESCRIPTION_TEXT ${SEC_CRT2010} $(DESC_CRT2010)
265     !insertmacro MUI_DESCRIPTION_TEXT ${SEC_DIRECTX} $(DESC_DIRECTX)
266     !insertmacro MUI_FUNCTION_DESCRIPTION_END

  ViewVC Help
Powered by ViewVC 1.1.22