1 ; ///////////////////////////////////////////////////////////////////////////////
2 ; // MPlayer for Windows - Install Script
3 ; // Copyright (C) 2004-2013 LoRd_MuldeR <MuldeR2@GMX.de>
5 ; // This program is free software; you can redistribute it and/or modify
6 ; // it under the terms of the GNU General Public License as published by
7 ; // the Free Software Foundation; either version 2 of the License, or
8 ; // (at your option) any later version.
10 ; // This program is distributed in the hope that it will be useful,
11 ; // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ; // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ; // GNU General Public License for more details.
15 ; // You should have received a copy of the GNU General Public License along
16 ; // with this program; if not, write to the Free Software Foundation, Inc.,
17 ; // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 ; // http://www.gnu.org/licenses/gpl-2.0.txt
20 ; ///////////////////////////////////////////////////////////////////////////////
23 ;--------------------------------------------------------------------------------
25 ;--------------------------------------------------------------------------------
28 !error "NSIS_UNICODE is undefined, please compile with Unicode NSIS !!!"
31 !ifndef MPLAYER_BUILDNO
32 !error "MPLAYER_BUILDNO is not defined !!!"
35 !ifndef MPLAYER_REVISION
36 !error "MPLAYER_REVISION is not defined !!!"
40 !error "MPLAYER_DATE is not defined !!!"
43 !ifndef SMPLAYER_VERSION
44 !error "SMPLAYER_VERSION is not defined !!!"
48 !error "MPUI_VERSION is not defined !!!"
52 !error "CODECS_DATE is not defined !!!"
55 !ifndef MPLAYER_OUTFILE
56 !error "MPLAYER_OUTFILE is not defined !!!"
60 !error "UPX_PATH is not defined !!!"
64 !define MPlayerRegPath
"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{97D341C8-B0D1-4E4A-A49A-C30B52F168E9}"
67 !define MPlayerWebSite
"http://mplayerhq.hu/"
70 ;--------------------------------------------------------------------------------
71 ; INSTALLER ATTRIBUTES
72 ;--------------------------------------------------------------------------------
74 RequestExecutionLevel admin
76 ShowUninstDetails show
78 Name "$(MPLAYER_LANG_MPLAYER_WIN32) ${MPLAYER_DATE} (Build #${MPLAYER_BUILDNO})"
79 Caption "$(MPLAYER_LANG_MPLAYER_WIN32) ${MPLAYER_DATE} (Build #${MPLAYER_BUILDNO})"
80 BrandingText "MPlayer-Win32 (Build #${MPLAYER_BUILDNO})"
81 InstallDir "$PROGRAMFILES\MPlayer for Windows"
82 InstallDirRegKey HKLM "${MPlayerRegPath}" "InstallLocation"
83 OutFile "${MPLAYER_OUTFILE}"
86 ;--------------------------------------------------------------------------------
88 ;--------------------------------------------------------------------------------
90 SetCompressor
/SOLID
/FINAL LZMA
91 SetCompressorDictSize
112
93 !packhdr "$%TEMP%\exehead.tmp" '"${UPX_PATH}\upx.exe" --brute "$%TEMP%\exehead.tmp"'
96 ;--------------------------------------------------------------------------------
98 ;--------------------------------------------------------------------------------
100 ReserveFile
"${NSISDIR}\Plugins\Aero.dll"
101 ReserveFile
"${NSISDIR}\Plugins\Banner.dll"
102 ReserveFile
"${NSISDIR}\Plugins\CPUFeatures.dll"
103 ReserveFile
"${NSISDIR}\Plugins\InstallOptions.dll"
104 ReserveFile
"${NSISDIR}\Plugins\LangDLL.dll"
105 ReserveFile
"${NSISDIR}\Plugins\LockedList.dll"
106 ReserveFile
"${NSISDIR}\Plugins\nsDialogs.dll"
107 ReserveFile
"${NSISDIR}\Plugins\nsExec.dll"
108 ReserveFile
"${NSISDIR}\Plugins\StartMenu.dll"
109 ReserveFile
"${NSISDIR}\Plugins\StdUtils.dll"
110 ReserveFile
"${NSISDIR}\Plugins\System.dll"
111 ReserveFile
"${NSISDIR}\Plugins\UserInfo.dll"
112 ReserveFile
"Dialogs\Page_CPU.ini"
113 ReserveFile
"Resources\Splash.gif"
116 ;--------------------------------------------------------------------------------
118 ;--------------------------------------------------------------------------------
121 !include `InstallOptions.nsh`
122 !include `WinVer.nsh`
124 !include `StrFunc.nsh`
125 !include `StdUtils.nsh`
126 !include `CPUFeatures.nsh`
127 !include `MPUI_Common.nsh`
133 ;--------------------------------------------------------------------------------
135 ;--------------------------------------------------------------------------------
144 ;--------------------------------------------------------------------------------
146 ;--------------------------------------------------------------------------------
148 !searchreplace PRODUCT_VERSION_DATE
"${MPLAYER_DATE}" "-" "."
149 VIProductVersion
"${PRODUCT_VERSION_DATE}.${MPLAYER_BUILDNO}"
151 VIAddVersionKey
"Author" "LoRd_MuldeR <mulder2@gmx.de>"
152 VIAddVersionKey
"Comments" "This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version."
153 VIAddVersionKey
"CompanyName" "Free Software Foundation"
154 VIAddVersionKey
"FileDescription" "MPlayer for Windows (Build #${MPLAYER_BUILDNO})"
155 VIAddVersionKey
"FileVersion" "${PRODUCT_VERSION_DATE}.${MPLAYER_BUILDNO}"
156 VIAddVersionKey
"LegalCopyright" "Copyright 2000-2013 The MPlayer Project"
157 VIAddVersionKey
"LegalTrademarks" "GNU"
158 VIAddVersionKey
"OriginalFilename" "MPUI-Setup.exe"
159 VIAddVersionKey
"ProductName" "MPlayer for Windows"
160 VIAddVersionKey
"ProductVersion" "Build #${MPLAYER_BUILDNO} (${MPLAYER_DATE})"
161 VIAddVersionKey
"Website" "${MPlayerWebSite}"
164 ;--------------------------------------------------------------------------------
165 ; MUI2 INTERFACE SETTINGS
166 ;--------------------------------------------------------------------------------
168 !define MUI_ABORTWARNING
169 !define MUI_STARTMENUPAGE_REGISTRY_ROOT
HKLM
170 !define MUI_STARTMENUPAGE_REGISTRY_KEY
"${MPlayerRegPath}"
171 !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME
"StartmenuFolder"
172 !define MUI_LANGDLL_REGISTRY_ROOT
HKLM
173 !define MUI_LANGDLL_REGISTRY_KEY
"${MPlayerRegPath}"
174 !define MUI_LANGDLL_REGISTRY_VALUENAME
"SetupLanguage"
175 !define MUI_STARTMENUPAGE_DEFAULTFOLDER
"MPlayer for Windows"
176 !define MUI_FINISHPAGE_NOAUTOCLOSE
177 !define MUI_UNFINISHPAGE_NOAUTOCLOSE
178 !define MUI_FINISHPAGE_RUN
179 !define MUI_FINISHPAGE_RUN_FUNCTION RunAppFunction
180 !define MUI_FINISHPAGE_SHOWREADME
181 !define MUI_FINISHPAGE_SHOWREADME_FUNCTION ShowReadmeFunction
182 !define MUI_FINISHPAGE_LINK
${MPlayerWebSite}
183 !define MUI_FINISHPAGE_LINK_LOCATION
${MPlayerWebSite}
184 !define MUI_ICON
"${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico"
185 !define MUI_UNICON
"${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall.ico"
186 !define MUI_WELCOMEFINISHPAGE_BITMAP
"Artwork\wizard.bmp"
187 !define MUI_UNWELCOMEFINISHPAGE_BITMAP
"Artwork\wizard-un.bmp"
188 !define MUI_HEADERIMAGE
189 !define MUI_HEADERIMAGE_BITMAP
"Artwork\header.bmp"
190 !define MUI_HEADERIMAGE_UNBITMAP
"Artwork\header-un.bmp"
191 !define MUI_LANGDLL_ALLLANGUAGES
192 !define MUI_CUSTOMFUNCTION_GUIINIT MyGuiInit
193 !define MUI_CUSTOMFUNCTION_UNGUIINIT un
.MyGuiInit
194 !define MUI_LANGDLL_ALWAYSSHOW
195 !define MUI_COMPONENTSPAGE_SMALLDESC
198 ;--------------------------------------------------------------------------------
200 ;--------------------------------------------------------------------------------
203 !define MUI_WELCOMEPAGE_TITLE_3LINES
204 !define MUI_FINISHPAGE_TITLE_3LINES
205 !insertmacro MUI_PAGE_WELCOME
206 !insertmacro MUI_PAGE_LICENSE
"Docs\License.txt"
207 !define MUI_PAGE_CUSTOMFUNCTION_SHOW CheckForUpdate
208 !insertmacro MUI_PAGE_DIRECTORY
209 !insertmacro MUI_PAGE_COMPONENTS
210 !insertmacro MUI_PAGE_STARTMENU Application
$StartMenuFolder
211 Page Custom SelectCPUPage_Show SelectCPUPage_Validate
212 Page Custom SetTweaksPage_Show
213 Page Custom LockedListPage_Show
214 !insertmacro MUI_PAGE_INSTFILES
215 !insertmacro MUI_PAGE_FINISH
218 !define MUI_WELCOMEPAGE_TITLE_3LINES
219 !define MUI_FINISHPAGE_TITLE_3LINES
220 !insertmacro MUI_UNPAGE_WELCOME
221 !insertmacro MUI_UNPAGE_CONFIRM
222 UninstPage Custom un
.LockedListPage_Show
223 !insertmacro MUI_UNPAGE_INSTFILES
224 !insertmacro MUI_UNPAGE_FINISH
227 ;--------------------------------------------------------------------------------
229 ;--------------------------------------------------------------------------------
231 !insertmacro MUI_LANGUAGE
"English"
232 !insertmacro MUI_LANGUAGE
"German"
235 !include "Language\MPUI_EN.nsh"
236 !include "Language\MPUI_DE.nsh"
239 ;--------------------------------------------------------------------------------
241 ;--------------------------------------------------------------------------------
243 InstType "$(MPLAYER_LANG_INSTTYPE_COMPLETE)"
244 InstType "$(MPLAYER_LANG_INSTTYPE_MINIMAL)"
247 ;--------------------------------------------------------------------------------
249 ;--------------------------------------------------------------------------------
252 StrCpy $SelectedCPUType 0
253 StrCpy $DetectedCPUType 0
254 StrCpy $DetectedCPUCores 0
255 StrCpy $SelectedTweaks 0
261 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "{B800490C-C100-4B12-9F09-1A54DF063049}") i .r1 ?e'
264 MessageBox MB_ICONSTOP|
MB_TOPMOST "Oups, the installer is already running!"
270 # Running on Windows NT family?
272 MessageBox MB_TOPMOST|
MB_ICONSTOP "Sorry, this application does *not* support Windows 9x or Windows ME!"
273 ExecShell "open" "http://windows.microsoft.com/"
277 # Running on Windows XP or later?
278 ${If} ${AtMostWin2000}
279 MessageBox MB_TOPMOST|
MB_ICONSTOP "Sorry, but your operating system is *not* supported anymore.$\nInstallation will be aborted!$\n$\nThe minimum required platform is Windows XP."
280 ExecShell "open" "http://windows.microsoft.com/"
286 UserInfo::GetAccountType
289 MessageBox MB_ICONSTOP|
MB_TOPMOST "Your system requires administrative permissions in order to install this software."
290 SetErrorLevel
740 ;ERROR_ELEVATION_REQUIRED
296 !insertmacro MUI_LANGDLL_DISPLAY
298 !insertmacro INSTALLOPTIONS_EXTRACT_AS
"Dialogs\Page_CPU.ini" "Page_CPU.ini"
299 !insertmacro INSTALLOPTIONS_EXTRACT_AS
"Dialogs\Page_Tweaks.ini" "Page_Tweaks.ini"
302 ${IfCmd} MessageBox MB_TOPMOST|
MB_ICONEXCLAMATION|
MB_OKCANCEL|MB_DEFBUTTON2
"Note: This is an early pre-release version for test only!" IDCANCEL ${||
} Quit ${|
}
308 File "/oname=$PLUGINSDIR\Splash.gif" "Resources\Splash.gif"
309 newadvsplash::show
3000 1000 500 -1 /NOCANCEL
"$PLUGINSDIR\Splash.gif"
310 Delete /REBOOTOK
"$PLUGINSDIR\Splash.gif"
317 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "{B800490C-C100-4B12-9F09-1A54DF063049}") i .r1 ?e'
320 MessageBox MB_ICONSTOP|
MB_TOPMOST "Sorry, the un-installer is already running!"
326 UserInfo::GetAccountType
329 MessageBox MB_ICONSTOP|
MB_TOPMOST "Your system requires administrative permissions in order to un-install this software."
330 SetErrorLevel
740 ;ERROR_ELEVATION_REQUIRED
336 !insertmacro MUI_LANGDLL_DISPLAY
340 ;--------------------------------------------------------------------------------
342 ;--------------------------------------------------------------------------------
345 StrCpy $0 $HWNDPARENT
346 System::Call "user32::SetWindowPos(i r0, i -1, i 0, i 0, i 0, i 0, i 3)"
350 Function un
.MyGuiInit
351 StrCpy $0 $HWNDPARENT
352 System::Call "user32::SetWindowPos(i r0, i -1, i 0, i 0, i 0, i 0, i 3)"
357 ;--------------------------------------------------------------------------------
359 ;--------------------------------------------------------------------------------
362 ${PrintProgress} "$(MPLAYER_LANG_STATUS_INST_CLEAN)"
364 SetShellVarContext all
365 SetOutPath "$INSTDIR"
367 ; Uninstall old version (aka "Setup v1")
369 ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{DB9E4EAB-2717-499F-8D56-4CC8A644AB60}" "InstallLocation"
371 MessageBox MB_ICONINFORMATION|
MB_OK "$(MPLAYER_LANG_UNINSTALL_OLDVER)"
372 File "/oname=$PLUGINSDIR\Uninstall-V1.exe" "Resources\Uninstall-V1.exe"
374 ExecWait '"$PLUGINSDIR\Uninstall-V1.exe" _?=$0'
375 Delete "$PLUGINSDIR\Uninstall-V1.exe"
380 DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{DB9E4EAB-2717-499F-8D56-4CC8A644AB60}"
381 DeleteRegKey HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{DB9E4EAB-2717-499F-8D56-4CC8A644AB60}"
382 DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" "MPlayerForWindows_UpdateReminder"
383 DeleteRegValue HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" "MPlayerForWindows_UpdateReminder"
385 ; Make sure MPlayer isn't running
388 Delete "$INSTDIR\MPlayer.exe"
389 Delete "$INSTDIR\SMPlayer.exe"
390 Delete "$INSTDIR\MPUI.exe"
392 ${IfCmd} MessageBox MB_TOPMOST|
MB_ICONEXCLAMATION|
MB_OKCANCEL "$(MPLAYER_LANG_STILL_RUNNING)" IDCANCEL ${||
} Abort ${|
}
398 ; Clean the install folder
399 Delete "$INSTDIR\*.exe"
400 Delete "$INSTDIR\*.dll"
401 Delete "$INSTDIR\*.ini"
402 Delete "$INSTDIR\*.txt"
403 Delete "$INSTDIR\*.html"
404 Delete "$INSTDIR\*.htm"
405 Delete "$INSTDIR\*.ass"
406 Delete "$INSTDIR\*.m3u8"
407 Delete "$INSTDIR\*.tag"
408 Delete "$INSTDIR\mplayer\config"
409 Delete "$INSTDIR\mplayer\*.conf"
411 ; Now deal with Virtual Store
412 ${GetVirtualStorePath} $0 "$INSTDIR"
416 Delete "$0\mplayer\config"
417 Delete "$0\mplayer\*.conf"
420 Section "!MPlayer r${MPLAYER_REVISION}" SECID_MPLAYER
422 ${PrintProgress} "$(MPLAYER_LANG_STATUS_INST_MPLAYER)"
423 SetOutPath "$INSTDIR"
428 StrCpy $SelectedCPUType $DetectedCPUType
432 ${Select} $SelectedCPUType
434 DetailPrint "$(MPLAYER_LANG_SELECTED_TYPE): core2"
435 File "Builds\MPlayer-core2\MPlayer.exe"
437 DetailPrint "$(MPLAYER_LANG_SELECTED_TYPE): corei7"
438 File "Builds\MPlayer-corei7\MPlayer.exe"
440 DetailPrint "$(MPLAYER_LANG_SELECTED_TYPE): k8-sse3"
441 File "Builds\MPlayer-k8-sse3\MPlayer.exe"
443 DetailPrint "$(MPLAYER_LANG_SELECTED_TYPE): bdver1"
444 File "Builds\MPlayer-bdver1\MPlayer.exe"
446 DetailPrint "$(MPLAYER_LANG_SELECTED_TYPE): generic"
447 File "Builds\MPlayer-generic\MPlayer.exe"
449 MessageBox MB_TOPMOST|
MB_ICONEXCLAMATION|
MB_OK "Internal error: Invalid CPU type selection detected!"
453 ; Other MPlayer-related files
454 File ".Compile\Updater.exe"
455 File "Builds\MPlayer-generic\dsnative.dll"
456 SetOutPath "$INSTDIR\mplayer"
457 File "Builds\MPlayer-generic\mplayer\config"
458 SetOutPath "$INSTDIR\fonts"
459 File "Builds\MPlayer-generic\fonts\fonts.conf"
460 SetOutPath "$INSTDIR\fonts\conf.d"
461 File "Builds\MPlayer-generic\fonts\conf.d\*.conf"
464 SetOutPath "$INSTDIR"
466 File "/oname=Manual.html" "Builds\MPlayer-generic\MPlayer.man.html"
467 File "Docs\Readme.html"
468 SetOutPath "$INSTDIR\legal_stuff"
469 File "Docs\legal_stuff\*.txt"
474 Delete "$INSTDIR\version.tag"
476 ${IfCmd} MessageBox MB_TOPMOST|
MB_ICONEXCLAMATION|
MB_OKCANCEL "$(MPLAYER_LANG_TAG_WRITE)" IDCANCEL ${||
} Abort ${|
}
481 WriteINIStr "$INSTDIR\version.tag" "mplayer_version" "build_no" "${MPLAYER_BUILDNO}"
482 WriteINIStr "$INSTDIR\version.tag" "mplayer_version" "pkg_date" "${MPLAYER_DATE}"
483 SetFileAttributes "$INSTDIR\version.tag" FILE_ATTRIBUTE_READONLY
485 ; Set file access rights
486 ${MakeFilePublic} "$INSTDIR\mplayer\config"
487 ${MakeFilePublic} "$INSTDIR\fonts\fonts.conf"
490 Section "!MPUI $(MPLAYER_LANG_FRONT_END) v${MPUI_VERSION}" SECID_MPUI
492 ${PrintProgress} "$(MPLAYER_LANG_STATUS_INST_MPUI)"
495 SetOutPath "$INSTDIR"
499 SetOutPath "$INSTDIR\locale"
500 File "MPUI\locale\*.txt"
502 ; Set file access rights
503 ${MakeFilePublic} "$INSTDIR\MPUI.ini"
505 ; Setup initial config
507 WriteINIStr "$INSTDIR\MPUI.ini" "MPUI" "Params" "-vo direct3d -lavdopts threads=$DetectedCPUCores"
508 WriteINIStr "$INSTDIR\MPUI.ini" "MPUI" "Locale" "$(MPLAYER_LANG_MPUI_DEFAULT_LANGUAGE)"
510 ${IfCmd} MessageBox MB_TOPMOST|
MB_ICONSTOP|MB_DEFBUTTON2|
MB_OKCANCEL "$(MPLAYER_LANG_CONFIG_MPUI)" IDCANCEL ${||
} Abort ${|
}
514 Section "!SMPlayer $(MPLAYER_LANG_FRONT_END) v${SMPLAYER_VERSION}" SECID_SMPLAYER
516 ${PrintProgress} "$(MPLAYER_LANG_STATUS_INST_CODECS)"
519 SetOutPath "$INSTDIR"
520 File "SMPlayer\SMPlayer.exe"
521 File "SMPlayer\libgcc_s_dw2-1.dll"
522 File "SMPlayer\mingwm10.dll"
523 File "SMPlayer\QtCore4.dll"
524 File "SMPlayer\QtGui4.dll"
525 File "SMPlayer\QtNetwork4.dll"
526 File "SMPlayer\QtXml4.dll"
527 File "SMPlayer\zlib1.dll"
529 ; Additional SMPlayer files
530 SetOutPath "$INSTDIR\translations"
531 File "SMPlayer\translations\*.qm"
532 SetOutPath "$INSTDIR\imageformats"
533 File "SMPlayer\imageformats\*.dll"
534 SetOutPath "$INSTDIR\shortcuts"
535 File "SMPlayer\shortcuts\*.keys"
536 SetOutPath "$INSTDIR\themes"
537 File /r
"SMPlayer\themes\*.css"
538 File /r
"SMPlayer\themes\*.png"
540 ; Set file access rights
541 ${MakeFilePublic} "$INSTDIR\SMPlayer.ini"
542 ${MakeFilePublic} "$INSTDIR\favorites.m3u8"
543 ${MakeFilePublic} "$INSTDIR\radio.m3u8"
544 ${MakeFilePublic} "$INSTDIR\tv.m3u8"
545 ${MakeFilePublic} "$INSTDIR\styles.ass"
546 ${MakeFilePublic} "$INSTDIR\shortcuts\default.keys"
548 ; Setup initial config
549 ${StrRep} $0 "$INSTDIR\MPlayer.exe" "\" "/"
551 WriteINIStr "$INSTDIR\SMPlayer.ini" "%General" "mplayer_bin" "$0"
552 WriteINIStr "$INSTDIR\SMPlayer.ini" "%General" "driver\vo" "direct3d"
553 WriteINIStr "$INSTDIR\SMPlayer.ini" "gui" "gui" "DefaultGUI"
554 WriteINIStr "$INSTDIR\SMPlayer.ini" "gui" "iconset" "Oxygen-Refit"
555 WriteINIStr "$INSTDIR\SMPlayer.ini" "gui" "style" "Plastique"
556 WriteINIStr "$INSTDIR\SMPlayer.ini" "performance" "threads" "$DetectedCPUCores"
558 ${IfCmd} MessageBox MB_TOPMOST|
MB_ICONSTOP|MB_DEFBUTTON2|
MB_OKCANCEL "$(MPLAYER_LANG_CONFIG_SMPLAYER)" IDCANCEL ${||
} Abort ${|
}
562 Section "!$(MPLAYER_LANG_BIN_CODECS) (${CODECS_DATE})"
564 ${PrintProgress} "$(MPLAYER_LANG_STATUS_INST_CODECS)"
566 SetOutPath "$INSTDIR\codecs"
578 Section "-Write Uninstaller"
579 ${PrintProgress} "$(MPLAYER_LANG_STATUS_MAKEUNINST)"
580 WriteUninstaller "$INSTDIR\Uninstall.exe"
583 Section "-Create Shortcuts"
584 !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
585 ${PrintProgress} "$(MPLAYER_LANG_STATUS_SHORTCUTS)"
586 CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
588 SetShellVarContext current
589 Delete "$SMPROGRAMS\$StartMenuFolder\*.lnk"
590 Delete "$SMPROGRAMS\$StartMenuFolder\*.pif"
591 Delete "$SMPROGRAMS\$StartMenuFolder\*.url"
593 SetShellVarContext all
594 Delete "$SMPROGRAMS\$StartMenuFolder\*.lnk"
595 Delete "$SMPROGRAMS\$StartMenuFolder\*.pif"
596 Delete "$SMPROGRAMS\$StartMenuFolder\*.url"
598 ${If} ${FileExists} "$INSTDIR\MPUI.exe"
599 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\MPUI.lnk" "$INSTDIR\MPUI.exe"
600 CreateShortCut "$DESKTOP\MPUI.lnk" "$INSTDIR\MPUI.exe"
602 ${If} ${FileExists} "$INSTDIR\SMPlayer.exe"
603 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\SMPlayer.lnk" "$INSTDIR\SMPlayer.exe"
604 CreateShortCut "$DESKTOP\SMPlayer.lnk" "$INSTDIR\SMPlayer.exe"
607 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(MPLAYER_LANG_SHORTCUT_UPDATE).lnk" "$INSTDIR\Updater.exe" "/L=$LANGUAGE"
608 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(MPLAYER_LANG_SHORTCUT_README).lnk" "$INSTDIR\Readme.html"
609 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(MPLAYER_LANG_SHORTCUT_MANUAL).lnk" "$INSTDIR\Manual.html"
611 ${CreateWebLink} "$SMPROGRAMS\$StartMenuFolder\$(MPLAYER_LANG_SHORTCUT_SITE_MULDERS).url" "http://www.mulder.at.gg/"
612 ${CreateWebLink} "$SMPROGRAMS\$StartMenuFolder\$(MPLAYER_LANG_SHORTCUT_SITE_MPWIN32).url" "http://oss.netfarm.it/mplayer-win32.php"
613 ${CreateWebLink} "$SMPROGRAMS\$StartMenuFolder\$(MPLAYER_LANG_SHORTCUT_SITE_MPLAYER).url" "http://www.mplayerhq.hu/"
615 ${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\SMPlayer.lnk"
616 ${StdUtils
.InvokeShellVerb
} $R1 "$SMPROGRAMS\$StartMenuFolder" "SMPlayer.lnk" ${StdUtils
.Const
.ISV_PinToTaskbar
}
617 DetailPrint 'Pin: "$SMPROGRAMS\$StartMenuFolder\SMPlayer.lnk" -> $R1'
619 !insertmacro MUI_STARTMENU_WRITE_END
622 Section "-ApplyTweaks"
623 ${PrintProgress} "$(MPLAYER_LANG_STATUS_TWEAKS)"
624 DetailPrint "$(MPLAYER_LANG_APPLYING_TWEAKS)"
626 IntOp $0 $SelectedTweaks & 1
628 ${If} ${FileExists} "$INSTDIR\SMPlayer.ini"
629 WriteINIStr "$INSTDIR\SMPlayer.ini" "gui" "gui" "SkinGUI"
630 WriteINIStr "$INSTDIR\SMPlayer.ini" "gui" "iconset" "Gonzo"
634 IntOp $0 $SelectedTweaks & 2
636 ${If} ${FileExists} "$INSTDIR\MPUI.ini"
637 WriteINIStr "$INSTDIR\MPUI.ini" "MPUI" "Params" "-vo gl:yuv=3 -lavdopts threads=$DetectedCPUCores"
639 ${If} ${FileExists} "$INSTDIR\SMPlayer.ini"
640 WriteINIStr "$INSTDIR\SMPlayer.ini" "%General" "driver\vo" "gl:yuv=3"
644 IntOp $0 $SelectedTweaks & 4
646 ${If} ${FileExists} "$INSTDIR\MPUI.ini"
647 ReadINIStr $1 "$INSTDIR\MPUI.ini" "MPUI" "Params"
648 WriteINIStr "$INSTDIR\MPUI.ini" "MPUI" "Params" "$1 -af volnorm=2"
650 ${If} ${FileExists} "$INSTDIR\SMPlayer.ini"
651 WriteINIStr "$INSTDIR\SMPlayer.ini" "defaults" "initial_volnorm" "true"
656 Section "$(MPLAYER_LANG_COMPRESS_FILES)"
658 ${PrintProgress} "$(MPLAYER_LANG_STATUS_INST_COMPRESS)"
660 File "/oname=$PLUGINSDIR\UPX.exe" "Utils\UPX.exe"
662 ${PackAll} "$INSTDIR" "*.exe"
663 ${PackAll} "$INSTDIR" "*.dll"
664 ${PackAll} "$INSTDIR\codecs" "*.acm"
665 ${PackAll} "$INSTDIR\codecs" "*.ax"
666 ${PackAll} "$INSTDIR\codecs" "*.dll"
667 ${PackAll} "$INSTDIR\codecs" "*.qtx"
669 Delete "$PLUGINSDIR\UPX.exe"
672 Section "-Update Font Cache"
673 ${PrintProgress} "$(MPLAYER_LANG_STATUS_INST_FONTCACHE)"
675 SetShellVarContext current
676 Delete "$APPDATA\fontconfig\cache\*.*"
677 Delete "$LOCALAPPDATA\fontconfig\cache\*.*"
679 SetShellVarContext all
680 Delete "$APPDATA\fontconfig\cache\*.*"
681 Delete "$LOCALAPPDATA\fontconfig\cache\*.*"
683 File "/oname=$PLUGINSDIR\Sample.avi" "Resources\Sample.avi"
684 DetailPrint "$(MPLAYER_LANG_UPDATING_FONTCACHE)"
685 NsExec::Exec '"$INSTDIR\MPlayer.exe" -fontconfig -ass -vo null -ao null "$PLUGINSDIR\Sample.avi"'
686 Delete "Resources\Sample.avi"
689 Section "-Update Registry"
690 ${PrintProgress} "$(MPLAYER_LANG_STATUS_REGISTRY)"
692 DetailPrint "$(MPLAYER_LANG_WRITING_REGISTRY)"
693 WriteRegStr HKLM "${MPlayerRegPath}" "InstallLocation" "$INSTDIR"
694 WriteRegStr HKLM "${MPlayerRegPath}" "UninstallString" '"$INSTDIR\Uninstall.exe"'
695 WriteRegStr HKLM "${MPlayerRegPath}" "DisplayName" "MPlayer for Windows"
696 WriteRegStr HKLM "${MPlayerRegPath}" "URLInfoAbout" "http://mulder.at.gg/"
697 WriteRegStr HKLM "${MPlayerRegPath}" "URLUpdateInfo" "http://mulder.at.gg/"
698 WriteRegDWORD HKLM "${MPlayerRegPath}" "NoModify" 1
699 WriteRegDWORD HKLM "${MPlayerRegPath}" "NoRepair" 1
701 ; Reset auto update interval
702 DeleteRegValue HKLM "${MPlayerRegPath}" "LastUpdateCheck"
703 DeleteRegValue HKCU "${MPlayerRegPath}" "LastUpdateCheck"
706 Section "$(MPLAYER_LANG_INST_AUTOUPDATE)" SECID_AUTOUPDATE
708 DetailPrint "$(MPLAYER_LANG_WRITING_REGISTRY)"
709 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" "MPlayerForWindows_AutoUpdateV2" '"$INSTDIR\Updater.exe" /L=$LANGUAGE /AutoCheck'
712 Section "-Protect Files"
713 SetFileAttributes "$INSTDIR\MPlayer.exe" FILE_ATTRIBUTE_READONLY
714 SetFileAttributes "$INSTDIR\dsnative.dll" FILE_ATTRIBUTE_READONLY
715 SetFileAttributes "$INSTDIR\MPUI.exe" FILE_ATTRIBUTE_READONLY
716 SetFileAttributes "$INSTDIR\SMPlayer.exe" FILE_ATTRIBUTE_READONLY
717 SetFileAttributes "$INSTDIR\Updater.exe" FILE_ATTRIBUTE_READONLY
718 SetFileAttributes "$INSTDIR\QtCore4.dll" FILE_ATTRIBUTE_READONLY
719 SetFileAttributes "$INSTDIR\QtGui4.dll" FILE_ATTRIBUTE_READONLY
720 SetFileAttributes "$INSTDIR\QtNetwork4.dll" FILE_ATTRIBUTE_READONLY
721 SetFileAttributes "$INSTDIR\QtXml4.dll" FILE_ATTRIBUTE_READONLY
722 SetFileAttributes "$INSTDIR\dsnative.dll" FILE_ATTRIBUTE_READONLY
723 SetFileAttributes "$INSTDIR\libgcc_s_dw2-1.dll" FILE_ATTRIBUTE_READONLY
724 SetFileAttributes "$INSTDIR\mingwm10.dll" FILE_ATTRIBUTE_READONLY
725 SetFileAttributes "$INSTDIR\zlib1.dll" FILE_ATTRIBUTE_READONLY
729 ${PrintStatus} "$(MUI_TEXT_FINISH_TITLE)"
733 ;--------------------------------------------------------------------------------
734 ; UN-INSTALL SECTIONS
735 ;--------------------------------------------------------------------------------
738 SetOutPath "$INSTDIR"
739 ${PrintProgress} "$(MPLAYER_LANG_STATUS_UNINSTALL)"
742 !insertmacro MUI_STARTMENU_GETFOLDER Application
$StartMenuFolder
743 ${IfNot} "$StartMenuFolder" ==
""
744 SetShellVarContext current
745 ${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\SMPlayer.lnk"
746 ${StdUtils
.InvokeShellVerb
} $R1 "$SMPROGRAMS\$StartMenuFolder" "SMPlayer.lnk" ${StdUtils
.Const
.ISV_UnpinFromTaskbar
}
747 DetailPrint 'Unpin: "$SMPROGRAMS\$StartMenuFolder\SMPlayer.lnk" -> $R1'
749 ${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\*.*"
750 Delete /REBOOTOK
"$SMPROGRAMS\$StartMenuFolder\*.lnk"
751 Delete /REBOOTOK
"$SMPROGRAMS\$StartMenuFolder\*.url"
752 Delete /REBOOTOK
"$SMPROGRAMS\$StartMenuFolder\*.pif"
753 RMDir "$SMPROGRAMS\$StartMenuFolder"
755 SetShellVarContext all
756 ${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\SMPlayer.lnk"
757 ${StdUtils
.InvokeShellVerb
} $R1 "$SMPROGRAMS\$StartMenuFolder" "SMPlayer.lnk" ${StdUtils
.Const
.ISV_UnpinFromTaskbar
}
758 DetailPrint 'Unpin: "$SMPROGRAMS\$StartMenuFolder\SMPlayer.lnk" -> $R1'
760 ${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\*.*"
761 Delete /REBOOTOK
"$SMPROGRAMS\$StartMenuFolder\*.lnk"
762 Delete /REBOOTOK
"$SMPROGRAMS\$StartMenuFolder\*.url"
763 Delete /REBOOTOK
"$SMPROGRAMS\$StartMenuFolder\*.pif"
764 RMDir "$SMPROGRAMS\$StartMenuFolder"
769 Delete /REBOOTOK
"$DESKTOP\MPUI.lnk"
770 Delete /REBOOTOK
"$DESKTOP\SMPlayer.lnk"
773 Delete /REBOOTOK
"$INSTDIR\*.exe"
774 Delete /REBOOTOK
"$INSTDIR\*.dll"
775 Delete /REBOOTOK
"$INSTDIR\*.ini"
776 Delete /REBOOTOK
"$INSTDIR\*.txt"
777 Delete /REBOOTOK
"$INSTDIR\*.html"
778 Delete /REBOOTOK
"$INSTDIR\*.htm"
779 Delete /REBOOTOK
"$INSTDIR\*.ass"
780 Delete /REBOOTOK
"$INSTDIR\*.m3u8"
781 Delete /REBOOTOK
"$INSTDIR\*.tag"
782 RMDir /r
"$INSTDIR\codecs"
783 RMDir /r
"$INSTDIR\fonts"
784 RMDir /r
"$INSTDIR\imageformats"
785 RMDir /r
"$INSTDIR\legal_stuff"
786 RMDir /r
"$INSTDIR\locale"
787 RMDir /r
"$INSTDIR\mplayer"
788 RMDir /r
"$INSTDIR\shortcuts"
789 RMDir /r
"$INSTDIR\themes"
790 RMDir /r
"$INSTDIR\translations"
794 ${GetVirtualStorePath} $0 "$INSTDIR"
795 ${If} ${FileExists} "$0\*.*"
800 DeleteRegKey HKLM "${MPlayerRegPath}"
801 DeleteRegKey HKCU "${MPlayerRegPath}"
803 ${PrintStatus} "$(MUI_UNTEXT_FINISH_TITLE)"
807 ;--------------------------------------------------------------------------------
808 ; SECTION SELECTION CHANGED
809 ;--------------------------------------------------------------------------------
811 Function .onSelChange
812 ${IfNot} ${SectionIsSelected} ${SECID_MPUI}
813 ${AndIfNot} ${SectionIsSelected} ${SECID_SMPLAYER}
814 MessageBox MB_TOPMOST|
MB_ICONEXCLAMATION "$(MPLAYER_LANG_SELCHANGE)"
815 SectionGetFlags
${SECID_MPUI} $0
816 IntOp $0 $0 |
${SF_SELECTED}
817 SectionSetFlags
${SECID_MPUI} $0
820 ${IfNot} ${SectionIsSelected} ${SECID_AUTOUPDATE}
822 ${IfCmd} MessageBox MB_TOPMOST|
MB_ICONEXCLAMATION|
MB_YESNO|MB_DEFBUTTON2
"$(MPLAYER_LANG_SEL_AUTOUPDATE)" IDNO ${||
} StrCpy $0 "ok" ${|
}
824 SectionGetFlags
${SECID_AUTOUPDATE} $0
825 IntOp $0 $0 |
${SF_SELECTED}
826 SectionSetFlags
${SECID_AUTOUPDATE} $0
832 ;--------------------------------------------------------------------------------
834 ;--------------------------------------------------------------------------------
836 !macro LockedListPage_Function
837 !insertmacro MUI_HEADER_TEXT
"$(MPLAYER_LANG_LOCKEDLIST_HEADER)" "$(MPLAYER_LANG_LOCKEDLIST_TEXT)"
838 LockedList::AddModule
"\MPlayer.exe"
839 LockedList::AddModule
"\SMPlayer.exe"
840 LockedList::AddModule
"\MPUI.exe"
841 LockedList::Dialog
/autonext
/ignore
"$(MPLAYER_LANG_IGNORE)" /heading
"$(MPLAYER_LANG_LOCKEDLIST_HEADING)" /noprograms
"$(MPLAYER_LANG_LOCKEDLIST_NOPROG)" /searching
"$(MPLAYER_LANG_LOCKEDLIST_SEARCH)" /colheadings
"$(MPLAYER_LANG_LOCKEDLIST_COLHDR1)" "$(MPLAYER_LANG_LOCKEDLIST_COLHDR2)"
845 Function LockedListPage_Show
846 !insertmacro LockedListPage_Function
849 Function un
.LockedListPage_Show
850 !insertmacro LockedListPage_Function
854 ;--------------------------------------------------------------------------------
855 ; CUSTOME PAGE: CPU SELECTOR
856 ;--------------------------------------------------------------------------------
858 Function SelectCPUPage_Show
859 ; Detect CPU type, if not detected yet
860 ${If} $DetectedCPUType < 2
861 ${OrIf} $DetectedCPUType > 6
863 !insertmacro INSTALLOPTIONS_READ
$0 "Page_CPU.ini" "Field $DetectedCPUType" "Text"
864 !insertmacro INSTALLOPTIONS_WRITE
"Page_CPU.ini" "Field $DetectedCPUType" "Text" "$0 <---"
867 ; Make sure the current selection is valid
868 ${IfThen} $SelectedCPUType < 2 ${|
} StrCpy $SelectedCPUType $DetectedCPUType ${|
}
869 ${IfThen} $SelectedCPUType > 6 ${|
} StrCpy $SelectedCPUType $DetectedCPUType ${|
}
872 !insertmacro INSTALLOPTIONS_WRITE
"Page_CPU.ini" "Field 1" "Text" "$(MPLAYER_LANG_SELECT_CPU_TYPE)"
873 !insertmacro INSTALLOPTIONS_WRITE
"Page_CPU.ini" "Field 7" "Text" "$(MPLAYER_LANG_SELECT_CPU_HINT)"
875 ; Apply current selection to dialog
877 ${If} $0 ==
$SelectedCPUType
878 !insertmacro INSTALLOPTIONS_WRITE
"Page_CPU.ini" "Field $0" "State" "1"
880 !insertmacro INSTALLOPTIONS_WRITE
"Page_CPU.ini" "Field $0" "State" "0"
885 !insertmacro MUI_HEADER_TEXT
"$(MPLAYER_LANG_SELECT_CPU_HEAD)" "$(MPLAYER_LANG_SELECT_CPU_TEXT)"
886 !insertmacro INSTALLOPTIONS_DISPLAY
"Page_CPU.ini"
888 ; Read new selection from dialog
889 StrCpy $SelectedCPUType 0
891 !insertmacro INSTALLOPTIONS_READ
$1 "Page_CPU.ini" "Field $0" "State"
892 ${IfThen} $1 ==
1 ${|
} StrCpy $SelectedCPUType $0 ${|
}
896 Function SelectCPUPage_Validate
897 ; Read new selection from dialog
900 !insertmacro INSTALLOPTIONS_READ
$1 "Page_CPU.ini" "Field $0" "State"
901 ${IfThen} $1 ==
1 ${|
} StrCpy $2 $0 ${|
}
907 MessageBox MB_ICONSTOP "Oups, invalid selection detected!"
912 Function DetectCPUType
913 StrCpy $DetectedCPUType 6 ;generic
914 StrCpy $DetectedCPUCores 2
916 Banner::show
/NOUNLOAD
"$(MPLAYER_LANG_DETECTING)"
918 ${CPUFeatures
.GetCount
} $0
919 ${IfNot} $0 ==
"error"
920 StrCpy $DetectedCPUCores $0
923 ; Check supported features
924 ${CPUFeatures
.GetVendor
} $0
925 ${CPUFeatures
.CheckFeature
} "MMX1" $1
926 ${CPUFeatures
.CheckFeature
} "3DNOW" $2
927 ${CPUFeatures
.CheckFeature
} "SSE3" $3
928 ${CPUFeatures
.CheckFeature
} "SSSE3" $4
929 ${CPUFeatures
.CheckFeature
} "SSE4.2" $5
930 ${CPUFeatures
.CheckFeature
} "AVX1" $6
931 ${CPUFeatures
.CheckFeature
} "FMA4" $7
935 !ifdef CPU_DETECT_DEBUG
936 StrCpy $9 `Vendor = $0`
937 StrCpy $9 `$9$\n"MMX1" = $1`
938 StrCpy $9 `$9$\n"3DNOW" = $2`
939 StrCpy $9 `$9$\n"SSE3" = $3`
940 StrCpy $9 `$9$\n"SSSE3" = $4`
941 StrCpy $9 `$9$\n"SSE4.2" = $5`
942 StrCpy $9 `$9$\n"AVX1" = $6`
943 StrCpy $9 `$9$\n"FMA4" = $7`
944 MessageBox MB_TOPMOST `$9`
947 ; Make sure we have at least MMX
948 ${IfThen} $1 !=
"yes" ${|
} Return ${|
}
950 ; Select the "best" model for Intel's
952 ; Core2 (SSE3 + SSSE3)
955 StrCpy $DetectedCPUType 2 ;
957 ; Nehalem (SSE3 + SSSE3 + SSE4.2)
961 StrCpy $DetectedCPUType 3
965 ; Select the "best" model for AMD's
967 ; K8+SSE3 (3DNow! + SSE3)
970 StrCpy $DetectedCPUType 4
972 ; Bulldozer (SSE3 + SSSE3 + SSE4.2 + AVX + FMA4)
978 StrCpy $DetectedCPUType 5
984 ;--------------------------------------------------------------------------------
985 ; CUSTOME PAGE: TWEAKS
986 ;--------------------------------------------------------------------------------
988 Function SetTweaksPage_Show
989 ; Apply current selection to dialog
992 IntOp $2 $0 & $SelectedTweaks
994 !insertmacro INSTALLOPTIONS_WRITE
"Page_Tweaks.ini" "Field $1" "State" "1"
996 !insertmacro INSTALLOPTIONS_WRITE
"Page_Tweaks.ini" "Field $1" "State" "0"
1002 !insertmacro INSTALLOPTIONS_WRITE
"Page_Tweaks.ini" "Field 1" "Text" "$(MPLAYER_LANG_TWEAKS_HINT)"
1003 !insertmacro INSTALLOPTIONS_WRITE
"Page_Tweaks.ini" "Field 2" "Text" "$(MPLAYER_LANG_TWEAKS_SKINNEDUI)"
1004 !insertmacro INSTALLOPTIONS_WRITE
"Page_Tweaks.ini" "Field 3" "Text" "$(MPLAYER_LANG_TWEAKS_OPENGL)"
1005 !insertmacro INSTALLOPTIONS_WRITE
"Page_Tweaks.ini" "Field 4" "Text" "$(MPLAYER_LANG_TWEAKS_VOLNORM)"
1008 !insertmacro MUI_HEADER_TEXT
"$(MPLAYER_LANG_TWEAKS_HEAD)" "$(MPLAYER_LANG_TWEAKS_TEXT)"
1009 !insertmacro INSTALLOPTIONS_DISPLAY
"Page_Tweaks.ini"
1011 ; Read new selection from dialog
1014 !insertmacro INSTALLOPTIONS_READ
$2 "Page_Tweaks.ini" "Field $1" "State"
1015 ${IfThen} $2 ==
1 ${|
} IntOp $SelectedTweaks $SelectedTweaks |
$0 ${|
}
1021 ;--------------------------------------------------------------------------------
1022 ; CHECK FOR UPDATE MODE
1023 ;--------------------------------------------------------------------------------
1025 Function CheckForUpdate
1026 ${StdUtils
.GetParameter
} $0 "Update" "?"
1027 ${IfNot} "$0" ==
"?"
1028 FindWindow $1 "#32770" "" $HWNDPARENT
1029 GetDlgItem
$2 $1 1019
1031 GetDlgItem
$2 $1 1001
1037 ;--------------------------------------------------------------------------------
1039 ;--------------------------------------------------------------------------------
1041 Function RunAppFunction
1042 !insertmacro DisableNextButton
$R0
1043 ${If} ${FileExists} "$INSTDIR\SMPlayer.exe"
1044 ${StdUtils
.ExecShellAsUser
} $R0 "$INSTDIR\SMPlayer.exe" "open" "http://lounge-office.rautemusik.fm/"
1046 ${StdUtils
.ExecShellAsUser
} $R0 "$INSTDIR\MPUI.exe" "open" "http://lounge-office.rautemusik.fm/"
1050 Function ShowReadmeFunction
1051 !insertmacro DisableNextButton
$R0
1052 ${StdUtils
.ExecShellAsUser
} $R0 "$INSTDIR\Readme.html" "open" ""
1055 Function .onInstSuccess
1056 ${StdUtils
.ExecShellAsUser
} $R0 "$SMPROGRAMS\$StartMenuFolder" "explore" ""