~ubuntu-branches/debian/experimental/smplayer/experimental

« back to all changes in this revision

Viewing changes to setup/smplayer-installer.nsi

  • Committer: Bazaar Package Importer
  • Author(s): Maia Kozheva
  • Date: 2009-03-31 23:05:43 UTC
  • mfrom: (1.1.9 upstream) (3.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090331230543-1ned1omblgt4qiak
* New upstream release. (Closes: #523791)
  - Reworked subtitle font preferences. (Closes: #503295)
  - No longer installs qt_fr.qm. (Closes: #486314)
* debian/control:
  - Bumped Standards-Version to 3.8.1.
  - Changed maintainer name (still the same person and GPG key).
  - Changed section to video.
  - Build-depend on zlib1g-dev for findsubtitles.
  - Require Qt >= 4.3 per readme.
  - Added ${misc:Depends}.
  - Make smplayer-translations depend on smplayer and smplayer recommend
    smplayer-translations, not the other way round. (Closes: #489375)
* debian/copyright:
  - Significantly expanded per-file with new upstream authors.
* debian/rules:
  - Make make use correct uic in install.
  - Clean svn_revision.
  - Removed get-orig-source - not needed with uscan --repack.
* debian/patches/01_gl_translation.patch:
  - Added patch to fix lrelease error on smplayer_gl.ts.
* Added debian/README.source for simple-patchsys.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
; NSIS script created by redxii for RVM's SMPlayer
 
2
;--------------------------------
 
3
;Compressor
 
4
 
 
5
  SetCompressor /SOLID lzma
 
6
  SetCompressorDictSize 32
 
7
 
 
8
;--------------------------------
 
9
;Additional plugin folders
 
10
 
 
11
  !addplugindir plugins
 
12
 
 
13
;--------------------------------
 
14
;Defines & includes
 
15
 
 
16
!define PRODUCT_NAME "SMPlayer"
 
17
!define PRODUCT_VERSION "0.6.7"
 
18
!define PRODUCT_PUBLISHER "RVM"
 
19
!define PRODUCT_WEB_SITE "http://smplayer.sf.net"
 
20
!define PRODUCT_FORUM "http://smplayer.sourceforge.net/forums"
 
21
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
 
22
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
 
23
!define PRODUCT_STARTMENU_GROUP "SMPlayer"
 
24
 
 
25
; Memento settings (required for Memento)
 
26
!define MEMENTO_REGISTRY_ROOT HKLM
 
27
!define MEMENTO_REGISTRY_KEY Software\SMPlayer
 
28
 
 
29
!include MUI2.nsh
 
30
!include Memento.nsh
 
31
!include WinVer.nsh
 
32
 
 
33
;--------------------------------
 
34
;Configuration
 
35
 
 
36
  ;General
 
37
  Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
 
38
!ifdef WITH_MPLAYER
 
39
  OutFile "smplayer_${PRODUCT_VERSION}_setup.exe"
 
40
!else
 
41
  OutFile "smplayer_${PRODUCT_VERSION}_websetup.exe"
 
42
!endif
 
43
 
 
44
  ;Version tab properties
 
45
  VIProductVersion "${PRODUCT_VERSION}.0"
 
46
  VIAddVersionKey "ProductName" "SMPlayer"
 
47
  VIAddVersionKey "Comments" "This installation was built with NSIS."
 
48
  VIAddVersionKey "LegalTrademarks" "RVM"
 
49
  VIAddVersionKey "LegalCopyright" "RVM"
 
50
  VIAddVersionKey "CompanyName" "RVM"
 
51
!ifdef WITH_MPLAYER
 
52
  VIAddVersionKey "FileDescription" "SMPlayer Installer (w/ MPlayer)"
 
53
!else
 
54
  VIAddVersionKey "FileDescription" "SMPlayer Installer (w/o MPlayer)"
 
55
!endif
 
56
  VIAddVersionKey "FileVersion" "${PRODUCT_VERSION}"
 
57
 
 
58
  /* Sets default install dir to $PROGRAMFILES\SMPlayer.
 
59
  If InstallDirRegKey exists (from a previous installation,
 
60
  it will default to that directory instead. */
 
61
  InstallDir "$PROGRAMFILES\SMPlayer"
 
62
  InstallDirRegKey HKLM "Software\SMPlayer" "Path"
 
63
 
 
64
  ;Put on a show
 
65
  ShowInstDetails show
 
66
  ShowUnInstDetails show
 
67
 
 
68
  ;Vista+ XML manifest, does not affect older OSes
 
69
  RequestExecutionLevel admin
 
70
 
 
71
;--------------------------------
 
72
;Variables
 
73
 
 
74
  # Ignore Var MPLAYER_VERSION when including mplayer
 
75
!ifndef WITH_MPLAYER
 
76
  Var MPLAYER_VERSION
 
77
!endif
 
78
  Var CODEC_VERSION
 
79
 
 
80
;--------------------------------
 
81
;Interface Settings
 
82
 
 
83
  !define MUI_ABORTWARNING
 
84
  !define MUI_COMPONENTSPAGE_SMALLDESC
 
85
  !define MUI_LICENSEPAGE_CHECKBOX
 
86
  !define MUI_FINISHPAGE_RUN $INSTDIR\smplayer.exe
 
87
  !define MUI_FINISHPAGE_RUN_NOTCHECKED
 
88
  !define MUI_FINISHPAGE_RUN_PARAMETERS http://88.191.30.130:8050
 
89
  !define MUI_FINISHPAGE_SHOWREADME $INSTDIR\Release_notes.txt
 
90
  !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
 
91
  !define MUI_FINISHPAGE_SHOWREADME_TEXT "View Release Notes"
 
92
  !define MUI_WELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\orange.bmp"
 
93
 
 
94
  # Installer/Uninstaller icons
 
95
  !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico"
 
96
  !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall.ico"
 
97
 
 
98
  # Language Selection Dialog Settings
 
99
  !define MUI_LANGDLL_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}"
 
100
  !define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
 
101
  !define MUI_LANGDLL_REGISTRY_VALUENAME "NSIS:Language"
 
102
 
 
103
;--------------------------------
 
104
;Pages
 
105
;MUI_PAGE_WELCOME should always be first and MUI_PAGE_FINISH should be last
 
106
 
 
107
  # Install Pages
 
108
  !insertmacro MUI_PAGE_WELCOME
 
109
  !insertmacro MUI_PAGE_LICENSE "smplayer-build\Copying.txt"
 
110
  !insertmacro MUI_PAGE_COMPONENTS
 
111
  !insertmacro MUI_PAGE_DIRECTORY
 
112
  !insertmacro MUI_PAGE_INSTFILES
 
113
  !insertmacro MUI_PAGE_FINISH
 
114
 
 
115
  # UnInstall Pages
 
116
  !insertmacro MUI_UNPAGE_INSTFILES
 
117
 
 
118
;--------------------------------
 
119
; Languages
 
120
 
 
121
  !insertmacro MUI_LANGUAGE "Basque"
 
122
  !insertmacro MUI_LANGUAGE "Catalan"
 
123
  !insertmacro MUI_LANGUAGE "Czech"
 
124
  !insertmacro MUI_LANGUAGE "Danish"
 
125
  !insertmacro MUI_LANGUAGE "Dutch"
 
126
  !insertmacro MUI_LANGUAGE "English"
 
127
  !insertmacro MUI_LANGUAGE "Finnish"
 
128
  !insertmacro MUI_LANGUAGE "French"
 
129
  !insertmacro MUI_LANGUAGE "German"
 
130
  !insertmacro MUI_LANGUAGE "Hebrew"
 
131
  !insertmacro MUI_LANGUAGE "Hungarian"
 
132
  !insertmacro MUI_LANGUAGE "Italian"
 
133
  !insertmacro MUI_LANGUAGE "Norwegian"
 
134
  !insertmacro MUI_LANGUAGE "NorwegianNynorsk"
 
135
  !insertmacro MUI_LANGUAGE "Polish"
 
136
  !insertmacro MUI_LANGUAGE "Portuguese"
 
137
  !insertmacro MUI_LANGUAGE "PortugueseBR"
 
138
  !insertmacro MUI_LANGUAGE "Russian"
 
139
  !insertmacro MUI_LANGUAGE "Slovak"
 
140
  !insertmacro MUI_LANGUAGE "Slovenian"
 
141
  !insertmacro MUI_LANGUAGE "Spanish"
 
142
  !insertmacro MUI_LANGUAGE "SpanishInternational"
 
143
 
 
144
;--------------------------------
 
145
;Reserve Files
 
146
 
 
147
  ;These files should be inserted before other files in the data block
 
148
  ;Keep these lines before any File command
 
149
  ;Only for solid compression (by default, solid compression is enabled for BZIP2 and LZMA)
 
150
 
 
151
  !insertmacro MUI_RESERVEFILE_LANGDLL
 
152
 
 
153
;--------------------------------
 
154
;Installer Types
 
155
;First in list is #1, second in list in #2, etc
 
156
 
 
157
  InstType "Standard installation"
 
158
  InstType "Full installation"
 
159
 
 
160
;------------------------------------------------------------------------------------------------
 
161
;Installer Sections
 
162
 
 
163
;--------------------------------
 
164
; Main SMPlayer files
 
165
Section SMPlayer SMPlayer
 
166
 
 
167
  SectionIn 1 2 RO
 
168
  SetOutPath "$INSTDIR"
 
169
  File "smplayer-build\*"
 
170
 
 
171
  # Docs folder
 
172
  SetOutPath "$INSTDIR"
 
173
  File /r "smplayer-build\docs"
 
174
 
 
175
  # Imageformats folder
 
176
  SetOutPath "$INSTDIR"
 
177
  File /r "smplayer-build\imageformats"
 
178
 
 
179
  # Shortcuts folder
 
180
  SetOutPath "$INSTDIR"
 
181
  File /r "smplayer-build\shortcuts"
 
182
 
 
183
  # UnInstall file
 
184
  WriteUninstaller "$INSTDIR\uninst.exe"
 
185
 
 
186
  # Store installed path
 
187
  WriteRegStr HKLM "Software\SMPlayer" "Path" "$INSTDIR"
 
188
 
 
189
  # HKEY_CLASSES_ROOT ProgId registration
 
190
  WriteRegStr HKCR "MPlayerFileVideo\DefaultIcon" "" '"$INSTDIR\smplayer.exe",1'
 
191
  WriteRegStr HKCR "MPlayerFileVideo\shell\enqueue" "" "Enqueue in SMPlayer"
 
192
  WriteRegStr HKCR "MPlayerFileVideo\shell\enqueue\command" "" '"$INSTDIR\smplayer.exe" -add-to-playlist "%1"'
 
193
  WriteRegStr HKCR "MPlayerFileVideo\shell\open" "FriendlyAppName" "SMPlayer Media Player"
 
194
  WriteRegStr HKCR "MPlayerFileVideo\shell\open\command" "" '"$INSTDIR\smplayer.exe" "%1"'
 
195
 
 
196
  # Windows Vista+ Default Programs registration
 
197
  ${If} ${AtLeastWinVista}
 
198
    WriteRegStr HKLM "Software\Clients\Media\SMPlayer\Capabilities" "ApplicationDescription" "SMPlayer is a complete front-end for MPlayer, from basic features like playing videos, DVDs, VCDs to more advanced features like support for MPlayer filters, edl lists, and more."
 
199
    WriteRegStr HKLM "Software\Clients\Media\SMPlayer\Capabilities" "ApplicationName" "SMPlayer"
 
200
    WriteRegStr HKLM "Software\Clients\Media\SMPlayer\Capabilities\FileAssociations" ".3gp" "MPlayerFileVideo"
 
201
    WriteRegStr HKLM "Software\Clients\Media\SMPlayer\Capabilities\FileAssociations" ".ac3" "MPlayerFileVideo"
 
202
    WriteRegStr HKLM "Software\Clients\Media\SMPlayer\Capabilities\FileAssociations" ".ape" "MPlayerFileVideo"
 
203
    WriteRegStr HKLM "Software\Clients\Media\SMPlayer\Capabilities\FileAssociations" ".asf" "MPlayerFileVideo"
 
204
    WriteRegStr HKLM "Software\Clients\Media\SMPlayer\Capabilities\FileAssociations" ".avi" "MPlayerFileVideo"
 
205
    WriteRegStr HKLM "Software\Clients\Media\SMPlayer\Capabilities\FileAssociations" ".bin" "MPlayerFileVideo"
 
206
    WriteRegStr HKLM "Software\Clients\Media\SMPlayer\Capabilities\FileAssociations" ".dat" "MPlayerFileVideo"
 
207
    WriteRegStr HKLM "Software\Clients\Media\SMPlayer\Capabilities\FileAssociations" ".divx" "MPlayerFileVideo"
 
208
    WriteRegStr HKLM "Software\Clients\Media\SMPlayer\Capabilities\FileAssociations" ".dv" "MPlayerFileVideo"
 
209
    WriteRegStr HKLM "Software\Clients\Media\SMPlayer\Capabilities\FileAssociations" ".dvr-ms" "MPlayerFileVideo"
 
210
    WriteRegStr HKLM "Software\Clients\Media\SMPlayer\Capabilities\FileAssociations" ".flv" "MPlayerFileVideo"
 
211
    WriteRegStr HKLM "Software\Clients\Media\SMPlayer\Capabilities\FileAssociations" ".iso" "MPlayerFileVideo"
 
212
    WriteRegStr HKLM "Software\Clients\Media\SMPlayer\Capabilities\FileAssociations" ".m1v" "MPlayerFileVideo"
 
213
    WriteRegStr HKLM "Software\Clients\Media\SMPlayer\Capabilities\FileAssociations" ".m2v" "MPlayerFileVideo"
 
214
    WriteRegStr HKLM "Software\Clients\Media\SMPlayer\Capabilities\FileAssociations" ".m4v" "MPlayerFileVideo"
 
215
    WriteRegStr HKLM "Software\Clients\Media\SMPlayer\Capabilities\FileAssociations" ".mkv" "MPlayerFileVideo"
 
216
    WriteRegStr HKLM "Software\Clients\Media\SMPlayer\Capabilities\FileAssociations" ".mov" "MPlayerFileVideo"
 
217
    WriteRegStr HKLM "Software\Clients\Media\SMPlayer\Capabilities\FileAssociations" ".mp3" "MPlayerFileVideo"
 
218
    WriteRegStr HKLM "Software\Clients\Media\SMPlayer\Capabilities\FileAssociations" ".mp4" "MPlayerFileVideo"
 
219
    WriteRegStr HKLM "Software\Clients\Media\SMPlayer\Capabilities\FileAssociations" ".mpeg" "MPlayerFileVideo"
 
220
    WriteRegStr HKLM "Software\Clients\Media\SMPlayer\Capabilities\FileAssociations" ".mpg" "MPlayerFileVideo"
 
221
    WriteRegStr HKLM "Software\Clients\Media\SMPlayer\Capabilities\FileAssociations" ".mpv" "MPlayerFileVideo"
 
222
    WriteRegStr HKLM "Software\Clients\Media\SMPlayer\Capabilities\FileAssociations" ".mqv" "MPlayerFileVideo"
 
223
    WriteRegStr HKLM "Software\Clients\Media\SMPlayer\Capabilities\FileAssociations" ".nsv" "MPlayerFileVideo"
 
224
    WriteRegStr HKLM "Software\Clients\Media\SMPlayer\Capabilities\FileAssociations" ".ogg" "MPlayerFileVideo"
 
225
    WriteRegStr HKLM "Software\Clients\Media\SMPlayer\Capabilities\FileAssociations" ".ogm" "MPlayerFileVideo"
 
226
    WriteRegStr HKLM "Software\Clients\Media\SMPlayer\Capabilities\FileAssociations" ".ra" "MPlayerFileVideo"
 
227
    WriteRegStr HKLM "Software\Clients\Media\SMPlayer\Capabilities\FileAssociations" ".ram" "MPlayerFileVideo"
 
228
    WriteRegStr HKLM "Software\Clients\Media\SMPlayer\Capabilities\FileAssociations" ".rmvb" "MPlayerFileVideo"
 
229
    WriteRegStr HKLM "Software\Clients\Media\SMPlayer\Capabilities\FileAssociations" ".ts" "MPlayerFileVideo"
 
230
    WriteRegStr HKLM "Software\Clients\Media\SMPlayer\Capabilities\FileAssociations" ".vcd" "MPlayerFileVideo"
 
231
    WriteRegStr HKLM "Software\Clients\Media\SMPlayer\Capabilities\FileAssociations" ".vfw" "MPlayerFileVideo"
 
232
    WriteRegStr HKLM "Software\Clients\Media\SMPlayer\Capabilities\FileAssociations" ".vob" "MPlayerFileVideo"
 
233
    WriteRegStr HKLM "Software\Clients\Media\SMPlayer\Capabilities\FileAssociations" ".wav" "MPlayerFileVideo"
 
234
    WriteRegStr HKLM "Software\Clients\Media\SMPlayer\Capabilities\FileAssociations" ".wma" "MPlayerFileVideo"
 
235
    WriteRegStr HKLM "Software\Clients\Media\SMPlayer\Capabilities\FileAssociations" ".wmv" "MPlayerFileVideo"
 
236
    WriteRegStr HKLM "Software\RegisteredApplications" "SMPlayer" "Software\Clients\Media\SMPlayer\Capabilities"
 
237
  ${EndIf}
 
238
 
 
239
  # Registry Uninstall information
 
240
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
 
241
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
 
242
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\smplayer.exe"
 
243
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
 
244
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "HelpLink" "${PRODUCT_FORUM}"
 
245
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
 
246
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLUpdateInfo" "${PRODUCT_WEB_SITE}"
 
247
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
 
248
 
 
249
  # Copy 7zip to installer's temp directory
 
250
  SetOutPath "$PLUGINSDIR"
 
251
  File 7za.exe
 
252
 
 
253
SectionEnd
 
254
 
 
255
;--------------------------------
 
256
; Desktop shortcut
 
257
${MementoSection} "Create Desktop shortcut" DesktopIcon
 
258
  SectionIn 1 2
 
259
 
 
260
  SetOutPath "$INSTDIR"
 
261
  # all = global; current = current user
 
262
  SetShellVarContext all
 
263
  CreateShortCut "$DESKTOP\SMPlayer.lnk" "$INSTDIR\smplayer.exe"
 
264
 
 
265
${MementoSectionEnd}
 
266
 
 
267
;--------------------------------
 
268
; Start menu shortcuts
 
269
${MementoSection} "Create Start Menu shortcuts" StartMenuIcon
 
270
  SectionIn 1 2
 
271
 
 
272
  SetOutPath "$INSTDIR"
 
273
  # Start menu shortcut creation
 
274
  SetShellVarContext all
 
275
  CreateDirectory "$SMPROGRAMS\${PRODUCT_STARTMENU_GROUP}"
 
276
  CreateShortCut "$SMPROGRAMS\${PRODUCT_STARTMENU_GROUP}\${PRODUCT_NAME}.lnk" "$INSTDIR\smplayer.exe"
 
277
  WriteINIStr    "$SMPROGRAMS\${PRODUCT_STARTMENU_GROUP}\SMPlayer on the Web.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
 
278
  CreateShortCut "$SMPROGRAMS\${PRODUCT_STARTMENU_GROUP}\Uninstall ${PRODUCT_NAME}.lnk" "$INSTDIR\uninst.exe"
 
279
 
 
280
${MementoSectionEnd}
 
281
 
 
282
;--------------------------------
 
283
; MPlayer Components
 
284
SectionGroup /e "MPlayer Components"
 
285
 
 
286
;--------------------------------
 
287
; MPlayer
 
288
!ifdef WITH_MPLAYER
 
289
  Section MPlayer MPlayer
 
290
    SectionIn 1 2 RO
 
291
 
 
292
    SetOutPath "$INSTDIR"
 
293
    File /r "smplayer-build\mplayer"
 
294
 
 
295
    WriteRegDWORD HKLM Software\SMPlayer Installed_MPlayer 0x1
 
296
 
 
297
  SectionEnd
 
298
!else
 
299
  Section MPlayer MPlayer
 
300
    SectionIn 1 2 RO
 
301
    AddSize 15300
 
302
 
 
303
    ReadRegDWORD $0 HKLM Software\SMPlayer Installed_MPlayer
 
304
 
 
305
    IntCmp $0 1 mplayerInstalled mplayerNotInstalled
 
306
      mplayerInstalled:
 
307
        MessageBox MB_YESNO "MPlayer is already installed. Re-Download?" IDYES mplayerNotInstalled IDNO done
 
308
      mplayerNotInstalled:
 
309
        ${IfNot} ${FileExists} "$PLUGINSDIR\version-info"
 
310
          Call getVerInfo
 
311
        ${EndIf}
 
312
 
 
313
        ${If} ${FileExists} "$PLUGINSDIR\version-info"
 
314
          ReadINIStr $MPLAYER_VERSION "$PLUGINSDIR\version-info" smplayer mplayer
 
315
        ${Else}
 
316
          StrCpy $MPLAYER_VERSION "mplayer-svn-28311"
 
317
        ${EndIf}
 
318
 
 
319
        DetailPrint "Downloading MPlayer..."
 
320
        inetc::get /timeout 30000 /resume "" /caption "Downloading MPlayer..." /banner "Downloading $MPLAYER_VERSION.7z" \
 
321
        "http://downloads.sourceforge.net/smplayer/$MPLAYER_VERSION.7z?big_mirror=0" \
 
322
        "$PLUGINSDIR\$MPLAYER_VERSION.7z"
 
323
        /* inetc::get /caption "Downloading MPlayer..." /banner "Downloading $MPLAYER_VERSION.7z" \
 
324
        "ftp://ftp.berlios.de/pub/smplayer/test/$MPLAYER_VERSION.7z" \
 
325
        "$PLUGINSDIR\$MPLAYER_VERSION.7z" */
 
326
        Pop $R0
 
327
        StrCmp $R0 OK mplayerdl1
 
328
          MessageBox MB_OK "Failed to download mplayer package: $R0.$\nMPlayer is required for playback!"
 
329
          Abort
 
330
          mplayerdl1:
 
331
            # Extract
 
332
            nsExec::Exec '"$PLUGINSDIR\7za.exe" x "$PLUGINSDIR\$MPLAYER_VERSION.7z" -o"$PLUGINSDIR"'
 
333
 
 
334
            # Copy
 
335
            CreateDirectory "$INSTDIR\mplayer"
 
336
            CopyFiles /SILENT "$PLUGINSDIR\$MPLAYER_VERSION\*" "$INSTDIR\mplayer"
 
337
 
 
338
            IfFileExists "$INSTDIR\mplayer\mplayer.exe" mplayerInstSuccess mplayerInstFailed
 
339
              mplayerInstFailed:
 
340
                MessageBox MB_OK "Failed to install MPlayer. MPlayer is required for playback!"
 
341
                Abort
 
342
              mplayerInstSuccess:
 
343
                WriteRegDWORD HKLM Software\SMPlayer Installed_MPlayer 0x1
 
344
 
 
345
    done:
 
346
 
 
347
  SectionEnd
 
348
!endif
 
349
 
 
350
;--------------------------------
 
351
; Binary codecs
 
352
  Section /o "Optional Codecs" Codecs
 
353
    SectionIn 2
 
354
    AddSize 22300
 
355
 
 
356
    ReadRegDWORD $1 HKLM Software\SMPlayer Installed_Codecs
 
357
 
 
358
    IntCmp $1 1 mplayerCodecsInstalled mplayerCodecsNotInstalled
 
359
      mplayerCodecsInstalled:
 
360
        MessageBox MB_YESNO "MPlayer codecs are already installed. Re-Download?" IDYES mplayerCodecsNotInstalled IDNO done
 
361
      mplayerCodecsNotInstalled:
 
362
        ${IfNot} ${FileExists} "$PLUGINSDIR\version-info"
 
363
          Call getVerInfo
 
364
        ${EndIf}
 
365
 
 
366
        ${If} ${FileExists} "$PLUGINSDIR\version-info"
 
367
          ReadINIStr $CODEC_VERSION "$PLUGINSDIR\version-info" smplayer mplayercodecs
 
368
        ${Else}
 
369
          StrCpy $CODEC_VERSION "windows-essential-20071007"
 
370
        ${EndIf}
 
371
 
 
372
        DetailPrint "Downloading MPlayer Codecs..."
 
373
        inetc::get /timeout 30000 /resume "" /caption "Downloading MPlayer Codecs..." /banner "Downloading $CODEC_VERSION.zip" \
 
374
        "http://www.mplayerhq.hu/MPlayer/releases/codecs/$CODEC_VERSION.zip" \
 
375
        "$PLUGINSDIR\$CODEC_VERSION.zip"
 
376
        /* inetc::get /caption "Downloading MPlayer Codecs..." /banner "Downloading ${CODEC_VERSION}.zip" \
 
377
        "ftp://ftp.berlios.de/pub/smplayer/test/${CODEC_VERSION}.zip" \
 
378
        "$PLUGINSDIR\${CODEC_VERSION}.zip" */
 
379
        Pop $R0
 
380
        StrCmp $R0 OK codecdlSuccess
 
381
          MessageBox MB_OK "Failed to download codec package: $R0.$\nCodec installation will be skipped."
 
382
          Goto done
 
383
          codecdlSuccess:
 
384
            # Extract
 
385
            nsExec::Exec '"$PLUGINSDIR\7za.exe" x "$PLUGINSDIR\$CODEC_VERSION.zip" -o"$PLUGINSDIR"'
 
386
 
 
387
            # Copy
 
388
            CreateDirectory "$INSTDIR\mplayer\codecs"
 
389
            CopyFiles /SILENT "$PLUGINSDIR\$CODEC_VERSION\*" "$INSTDIR\mplayer\codecs"
 
390
 
 
391
            IfFileExists "$INSTDIR\mplayer\codecs\Readme.txt" codecsInstSuccess codecsInstFailed
 
392
              codecsInstFailed:
 
393
                MessageBox MB_OK "Failed to install MPlayer codecs. Re-run setup and try again."
 
394
                Goto done
 
395
              codecsInstSuccess:
 
396
                WriteRegDWORD HKLM Software\SMPlayer Installed_Codecs 0x1
 
397
 
 
398
    done:
 
399
 
 
400
        SectionEnd
 
401
 
 
402
SectionGroupEnd
 
403
 
 
404
;--------------------------------
 
405
; Icon Themes
 
406
${MementoSection} "Icon Themes" Themes
 
407
 
 
408
  SectionIn 1 2
 
409
  SetOutPath "$INSTDIR"
 
410
  File /r "smplayer-build\themes"
 
411
 
 
412
${MementoSectionEnd}
 
413
 
 
414
;--------------------------------
 
415
; Translations
 
416
${MementoSection} Translations Translations
 
417
 
 
418
  SectionIn 1 2
 
419
  SetOutPath "$INSTDIR"
 
420
  File /r "smplayer-build\translations"
 
421
 
 
422
${MementoSectionEnd}
 
423
 
 
424
${MementoSectionDone}
 
425
 
 
426
;--------------------------------
 
427
; Section descriptions
 
428
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
 
429
  !insertmacro MUI_DESCRIPTION_TEXT ${SMPlayer} "SMPlayer, shared libraries, and documentation."
 
430
  !insertmacro MUI_DESCRIPTION_TEXT ${DesktopIcon} "Creates a shortcut on the desktop."
 
431
  !insertmacro MUI_DESCRIPTION_TEXT ${StartMenuIcon} "Creates start menu shortcuts."
 
432
!ifdef WITH_MPLAYER
 
433
  !insertmacro MUI_DESCRIPTION_TEXT ${MPlayer} "The engine behind SMPlayer, required for playback."
 
434
!else
 
435
  !insertmacro MUI_DESCRIPTION_TEXT ${MPlayer} "Downloads/installs mplayer; requires an active internet connection. Required for playback."
 
436
!endif
 
437
  !insertmacro MUI_DESCRIPTION_TEXT ${Codecs} "Downloads optional codecs that aren't yet implemented in mplayer; e.g. RealVideo and uncommon formats."
 
438
  !insertmacro MUI_DESCRIPTION_TEXT ${Themes} "Stylish icon themes for SMPlayer."
 
439
  !insertmacro MUI_DESCRIPTION_TEXT ${Translations} "Translations for SMPlayer."
 
440
!insertmacro MUI_FUNCTION_DESCRIPTION_END
 
441
 
 
442
;--------------------------------
 
443
;Installer Functions
 
444
 
 
445
Function .onInit
 
446
 
 
447
  System::Call 'kernel32::CreateMutexA(i 0, i 0, t "$(^Name)") i .r1 ?e'
 
448
  Pop $R0
 
449
 
 
450
  StrCmp $R0 0 +3
 
451
    MessageBox MB_OK|MB_ICONEXCLAMATION "The installer is already running."
 
452
    Abort
 
453
 
 
454
  !insertmacro MUI_LANGDLL_DISPLAY
 
455
 
 
456
  ${MementoSectionRestore}
 
457
 
 
458
FunctionEnd
 
459
 
 
460
Function .onInstSuccess
 
461
 
 
462
  ${MementoSectionSave}
 
463
 
 
464
FunctionEnd
 
465
 
 
466
Function .onInstFailed
 
467
 
 
468
  # Delete desktop and start menu shortcuts
 
469
  SetShellVarContext all
 
470
  Delete "$DESKTOP\SMPlayer.lnk"
 
471
  RMDir /r "$SMPROGRAMS\${PRODUCT_STARTMENU_GROUP}"
 
472
 
 
473
  # Delete directories recursively except for main directory
 
474
  # Nullsoft says it is unsafe to recursively delete $INSTDIR 
 
475
  RMDir /r "$INSTDIR\docs"
 
476
  RMDir /r "$INSTDIR\imageformats"
 
477
  RMDir /r "$INSTDIR\mplayer"
 
478
  RMDir /r "$INSTDIR\shortcuts"
 
479
  RMDir /r "$INSTDIR\themes"
 
480
  RMDir /r "$INSTDIR\translations"
 
481
  Delete "$INSTDIR\*.txt"
 
482
  Delete "$INSTDIR\mingwm10.dll"
 
483
  Delete "$INSTDIR\Q*.dll"
 
484
  Delete "$INSTDIR\smplayer.exe"
 
485
  Delete "$INSTDIR\uninst.exe"
 
486
  Delete "$INSTDIR\dxlist.exe"
 
487
  RMDir "$INSTDIR"
 
488
 
 
489
  # Delete keys pertaining to SMPlayer
 
490
  DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
 
491
  DeleteRegKey HKCR "MPlayerFileVideo"
 
492
  DeleteRegKey HKLM "Software\Clients\Media\SMPlayer"
 
493
  DeleteRegValue HKLM "Software\RegisteredApplications" "SMPlayer"
 
494
  DeleteRegKey HKLM "Software\SMPlayer"
 
495
 
 
496
FunctionEnd
 
497
 
 
498
Function getVerInfo
 
499
 
 
500
  DetailPrint "Gathering version information..."
 
501
  inetc::get /timeout 30000 /resume "" /silent "http://smplayer.sourceforge.net/mplayer-version-info" \
 
502
  "$PLUGINSDIR\version-info"
 
503
  Pop $R0
 
504
  StrCmp $R0 OK +2
 
505
    DetailPrint "Error retrieving version info: $R0. Setup will use a default version."
 
506
 
 
507
FunctionEnd
 
508
 
 
509
;End Installer Sections
 
510
;------------------------------------------------------------------------------------------------
 
511
 
 
512
;------------------------------------------------------------------------------------------------
 
513
;UnInstaller Sections
 
514
 
 
515
Section Uninstall
 
516
 
 
517
  # Restore all file associations...
 
518
  ExecWait '"$INSTDIR\smplayer.exe" -uninstall'
 
519
 
 
520
  # Delete desktop and start menu shortcuts
 
521
  SetShellVarContext all
 
522
  Delete "$DESKTOP\SMPlayer.lnk"
 
523
  RMDir /r "$SMPROGRAMS\${PRODUCT_STARTMENU_GROUP}"
 
524
 
 
525
  # Delete directories recursively except for main directory
 
526
  # Nullsoft says it is unsafe to recursively delete $INSTDIR 
 
527
  RMDir /r "$INSTDIR\docs"
 
528
  RMDir /r "$INSTDIR\imageformats"
 
529
  RMDir /r "$INSTDIR\mplayer"
 
530
  RMDir /r "$INSTDIR\shortcuts"
 
531
  RMDir /r "$INSTDIR\themes"
 
532
  RMDir /r "$INSTDIR\translations"
 
533
  Delete "$INSTDIR\*.txt"
 
534
  Delete "$INSTDIR\mingwm10.dll"
 
535
  Delete "$INSTDIR\Q*.dll"
 
536
  Delete "$INSTDIR\smplayer.exe"
 
537
  Delete "$INSTDIR\dxlist.exe"
 
538
  Delete "$INSTDIR\uninst.exe"
 
539
  RMDir "$INSTDIR"
 
540
 
 
541
  # Delete keys pertaining to SMPlayer
 
542
  DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
 
543
  DeleteRegKey HKCR "MPlayerFileVideo"
 
544
  DeleteRegKey HKLM "Software\Clients\Media\SMPlayer"
 
545
  DeleteRegValue HKLM "Software\RegisteredApplications" "SMPlayer"
 
546
  DeleteRegKey HKLM "Software\SMPlayer"
 
547
 
 
548
  SetAutoClose true
 
549
 
 
550
SectionEnd
 
551
 
 
552
;--------------------------------
 
553
;UnInstaller Functions
 
554
Function un.onInit
 
555
 
 
556
  # Get the stored language preference
 
557
  !insertmacro MUI_UNGETLANGUAGE
 
558
 
 
559
  MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2
 
560
  Abort
 
561
 
 
562
FunctionEnd
 
563
 
 
564
Function un.onUninstSuccess
 
565
 
 
566
  HideWindow
 
567
  MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."
 
568
 
 
569
FunctionEnd
 
 
b'\\ No newline at end of file'