/[pcsx2_0.9.7]/branch/r3113_0.9.7_beta/nsis/pcsx2_full_install.nsi
ViewVC logotype

Contents of /branch/r3113_0.9.7_beta/nsis/pcsx2_full_install.nsi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 32 - (show annotations) (download)
Tue Sep 7 03:29:01 2010 UTC (9 years, 11 months ago) by william
File size: 9955 byte(s)
branching from upstream revision (http://pcsx2.googlecode.com/svn/trunk
): r3113 to
https://svn.netsolutions.dnsalias.com/websvn/ps2/pcsx2/pcsx2_0.9.7/branch/r3113_0.9.7_beta
1
2 ; PCSX2 Full/Complete Install Package!
3 ; (a NSIS installer script)
4 ;
5 ; Copyright 2009-2010 PCSX2 Dev Team
6 ;
7
8
9 !ifndef INC_PLUGINS
10 ; Set to 0 to include the core binaries only (no plugins)
11 !define INC_PLUGINS 1
12 !endif
13
14 !ifndef INC_CRT_2008
15 ; Set to 0 to disable inclusion of Visual Studio 2008 SP1 CRT Redists
16 !define INC_CRT_2008 1
17 !endif
18
19 !ifndef INC_CRT_2010
20 ; Set to 0 to disable inclusion of Visual Studio 2010 CRT Redists
21 !define INC_CRT_2010 1
22 !endif
23
24 !ifndef INC_LANGS
25 ; Set to 1 to enable inclusion of Languages folders (which are currently missing in 0.9.7)
26 !define INC_LANGS 0
27 !endif
28
29 !define OUTFILE_POSTFIX "setup"
30 !include "SharedSettings.nsh"
31 !include "MUI2.nsh"
32 !include "AdvUninstLog.nsh"
33
34 ; =======================================================================
35 ; Vista/Win7 UAC Stuff
36 ; =======================================================================
37
38 !include "IsUserAdmin.nsi"
39
40 ; Reserve features for improved performance with solid archiving.
41 ; (uncomment if we add our own install options ini files)
42 ;!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
43 ;!insertmacro MUI_RESERVEFILE_LANGDLL
44
45 ; Allow admin-rights PCSX2 users to be hardcore!
46 AllowRootDirInstall true
47
48 ; FIXME !!
49 ; Request application privileges for Windows Vista/7; I'd love for this to be sensible about which
50 ; execution level it requests, but UAC is breaking my mind. I included some code for User type
51 ; detection in function IsUserAdmin, but not really using it constructively yet. (see also our
52 ; uses of SetShellVarContext in the installer sections)
53 RequestExecutionLevel admin
54
55 ; This defines the Advanced Uninstaller mode of operation...
56 !insertmacro UNATTENDED_UNINSTALL
57
58 !define MUI_HEADERIMAGE
59 !define MUI_HEADERIMAGE_BITMAP "banner.bmp"
60 !define MUI_COMPONENTSPAGE_SMALLDESC
61
62 !insertmacro MUI_PAGE_COMPONENTS
63 !insertmacro MUI_PAGE_DIRECTORY
64 !insertmacro MUI_PAGE_INSTFILES
65
66 !insertmacro MUI_UNPAGE_CONFIRM
67 !insertmacro MUI_UNPAGE_COMPONENTS
68 !insertmacro MUI_UNPAGE_INSTFILES
69
70 !insertmacro MUI_LANGUAGE "English"
71
72 !include "ApplyExeProps.nsh"
73 !include "SharedRedtape.nsh"
74
75 ; =======================================================================
76 ; Installer Sections
77 ; =======================================================================
78
79 ; -----------------------------------------------------------------------
80 ; Basic section (emulation proper)
81 Section "!${APP_NAME} (required)" SEC_CORE
82
83 SectionIn RO
84
85 !include "SectionCoreReqs.nsh"
86
87 ; ------------------------------------------
88 ; -- Plugins Section --
89 ; ------------------------------------------
90
91 !if ${INC_PLUGINS} > 0
92
93 SetOutPath "$INSTDIR\Plugins"
94 !insertmacro UNINSTALL.LOG_OPEN_INSTALL
95
96 File /nonfatal /oname=gsdx-sse2-r${SVNREV_GSDX}.dll ..\bin\Plugins\gsdx-sse2.dll
97 File /nonfatal /oname=gsdx-ssse3-r${SVNREV_GSDX}.dll ..\bin\Plugins\gsdx-ssse3.dll
98 File /nonfatal /oname=gsdx-sse4-r${SVNREV_GSDX}.dll ..\bin\Plugins\gsdx-sse4.dll
99 File /nonfatal /oname=zerogs-r${SVNREV_ZEROGS}.dll ..\bin\Plugins\zerogs.dll
100
101 File /nonfatal /oname=spu2-x-r${SVNREV_SPU2X}.dll ..\bin\Plugins\spu2-x.dll
102 File /nonfatal /oname=zerospu2-r${SVNREV_ZEROSPU2}.dll ..\bin\Plugins\zerospu2.dll
103
104 File /nonfatal /oname=cdvdiso-r${SVNREV_CDVDISO}.dll ..\bin\Plugins\cdvdiso.dll
105 File ..\bin\Plugins\cdvdGigaherz.dll
106
107 File /nonfatal /oname=lilypad-r${SVNREV_LILYPAD}.dll ..\bin\Plugins\lilypad.dll
108 File ..\bin\Plugins\PadSSSPSX.dll
109
110 ;File ..\bin\Plugins\FWlinuz.dll
111
112 !insertmacro UNINSTALL.LOG_CLOSE_INSTALL
113
114 !endif
115
116 SectionEnd
117
118 ; -----------------------------------------------------------------------
119 ; Start Menu - Optional section (can be disabled by the user)
120 Section "Start Menu Shortcuts" SEC_STARTMENU
121
122 ; CreateShortCut gets the working directory from OutPath
123 SetOutPath "$INSTDIR"
124
125 CreateDirectory "$SMPROGRAMS\PCSX2"
126 CreateShortCut "$SMPROGRAMS\PCSX2\Uninstall ${APP_NAME}.lnk" "${UNINST_EXE}" "" "${UNINST_EXE}" 0
127 CreateShortCut "$SMPROGRAMS\PCSX2\${APP_NAME}.lnk" "${APP_EXE}" "" "${APP_EXE}" 0
128
129 ;IfFileExists ..\bin\pcsx2-dev.exe 0 +2
130 ; CreateShortCut "PCSX2\pcsx2-dev-r${SVNREV}.lnk" "$INSTDIR\pcsx2-dev-r${SVNREV}.exe" "" "$INSTDIR\pcsx2-dev-r${SVNREV}.exe" 0 "" "" \
131 ; "PCSX2 Devel (has additional logging support)"
132
133 SectionEnd
134
135 ; -----------------------------------------------------------------------
136 ; Desktop Icon - Optional section (can be disabled by the user)
137 Section "Desktop Shortcut" SEC_DESKTOP
138
139 ; CreateShortCut gets the working directory from OutPath
140 SetOutPath "$INSTDIR"
141
142 CreateShortCut "$DESKTOP\${APP_NAME}.lnk" "${APP_EXE}" "" "${APP_EXE}" 0 "" "" "A Playstation 2 Emulator"
143
144 SectionEnd
145
146 ; -----------------------------------------------------------------------
147 ; MSVC Redistributable - required if the user does not already have it
148 ; Note: if your NSIS generates an error here it means you need to download the latest
149 ; visual studio redist package from microsoft. Any redist 2008/SP1 or newer will do.
150 ;
151 ; IMPORTANT: Online references for how to detect the presence of the VS2008 redists LIE.
152 ; None of the methods are reliable, because the registry keys placed by the MSI installer
153 ; vary depending on operating system *and* MSI installer version (youch).
154 ;
155 !if ${INC_CRT_2008} > 0
156 Section "Microsoft Visual C++ 2008 SP1 Redist (required)" SEC_CRT2008
157
158 SectionIn RO
159
160 ; Downloaded from:
161 ; http://download.microsoft.com/download/d/d/9/dd9a82d0-52ef-40db-8dab-795376989c03/vcredist_x86.exe
162
163 SetOutPath "$TEMP"
164 File "vcredist_2008_sp1_x86.exe"
165 DetailPrint "Running Visual C++ 2008 SP1 Redistributable Setup..."
166 ExecWait '"$TEMP\vcredist_2008_sp1_x86.exe" /qb'
167 DetailPrint "Finished Visual C++ 2008 SP1 Redistributable Setup"
168
169 Delete "$TEMP\vcredist_2008_sp1_x86.exe"
170
171 SectionEnd
172 !endif
173
174 !if ${INC_CRT_2010} > 0
175 Section "Microsoft Visual C++ 2010 Redist (recommended)" SEC_CRT2010
176
177 ;SectionIn RO
178
179 ; Detection made easy: Unlike previous redists, VC2010 now generates a platform
180 ; independent key for checking availability.
181
182 ; Downloaded from:
183 ; http://download.microsoft.com/download/5/B/C/5BC5DBB3-652D-4DCE-B14A-475AB85EEF6E/vcredist_x86.exe
184
185 ReadRegDword $R0 HKLM "SOFTWARE\Microsoft\VisualStudio\10.0\VC\VCRedist\x86" "Installed"
186 IfErrors done
187 StrCmp $R0 "1" done
188
189 SetOutPath "$TEMP"
190 File "vcredist_2010_x86.exe"
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 !endif
200
201 ; -----------------------------------------------------------------------
202 ; This section needs to be last, so that in case it fails, the rest of the program will
203 ; be installed cleanly.
204 ;
205 ; This section could be optional, but why not? It's pretty painless to double-check that
206 ; all the libraries are up-to-date.
207 ;
208 Section "DirectX Web Setup (recommended)" SEC_DIRECTX
209
210 ;SectionIn RO
211
212 SetOutPath "$TEMP"
213 File "dxwebsetup.exe"
214 DetailPrint "Running DirectX Web Setup..."
215 ExecWait '"$TEMP\dxwebsetup.exe" /Q' $DirectXSetupError
216 DetailPrint "Finished DirectX Web Setup"
217
218 Delete "$TEMP\dxwebsetup.exe"
219
220 SectionEnd
221
222 ; =======================================================================
223 ; Un.Installer Sections
224 ; =======================================================================
225
226 ; -----------------------------------------------------------------------
227 Section "Un.Exes and Plugins ${APP_NAME}"
228
229 SetShellVarContext all
230
231 !insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR"
232
233 ; Remove registry keys (but only the ones related to the installer -- user options remain)
234 DeleteRegKey HKLM "${INSTDIR_REG_KEY}"
235
236 Call un.removeShorties
237
238 !insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\Langs"
239 !insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\Plugins"
240
241 SectionEnd
242
243 Section "Un.Complete Registry Cleanup"
244
245 ; Kill the entire PCSX2 registry key!
246 DeleteRegKey ${INSTDIR_REG_ROOT} Software\PCSX2
247
248 ; Kill AppData/PCSX2 entry!
249
250 SetShellVarContext current
251 StrCpy $0 $LOCALAPPDATA\PCSX2
252 Call un.DeleteDirIfEmpty
253 StrCpy $0 $APPDATA\PCSX2
254 Call un.DeleteDirIfEmpty
255
256 SectionEnd
257
258 LangString DESC_CORE ${LANG_ENGLISH} "Core components (binaries, plugins, languages, etc)."
259
260 LangString DESC_STARTMENU ${LANG_ENGLISH} "Adds shortcuts for PCSX2 to the start menu (all users)."
261 LangString DESC_DESKTOP ${LANG_ENGLISH} "Adds a shortcut for PCSX2 to the desktop (all users)."
262
263 LangString DESC_CRT2008 ${LANG_ENGLISH} "Required by the PCSX2 binaries packaged in this installer."
264 LangString DESC_CRT2010 ${LANG_ENGLISH} "This will be used by future PCSX2 plugins and updates, but is not (yet) necessary."
265 LangString DESC_DIRECTX ${LANG_ENGLISH} "Only uncheck this if you are quite certain your Direct3D runtimes are up to date."
266
267 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
268 !insertmacro MUI_DESCRIPTION_TEXT ${SEC_CORE} $(DESC_CORE)
269 !insertmacro MUI_DESCRIPTION_TEXT ${SEC_STARTMENU} $(DESC_STARTMENU)
270 !insertmacro MUI_DESCRIPTION_TEXT ${SEC_DESKTOP} $(DESC_DESKTOP)
271
272 !if ${INC_CRT_2008} > 0
273 !insertmacro MUI_DESCRIPTION_TEXT ${SEC_CRT2008} $(DESC_CRT2008)
274 !endif
275
276 !if ${INC_CRT_2010} > 0
277 !insertmacro MUI_DESCRIPTION_TEXT ${SEC_CRT2010} $(DESC_CRT2010)
278 !endif
279
280 !insertmacro MUI_DESCRIPTION_TEXT ${SEC_DIRECTX} $(DESC_DIRECTX)
281 !insertmacro MUI_FUNCTION_DESCRIPTION_END

  ViewVC Help
Powered by ViewVC 1.1.22