1 ; ///////////////////////////////////////////////////////////////////////////////
2 ; // MPlayer for Windows - Install Script
3 ; // Copyright (C) 2004-2018 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
94 !packhdr "${PACKHDRTEMP}" '"Utils\MT.exe" -manifest "Resources\Setup.manifest" -outputresource:"${PACKHDRTEMP};1"'
96 !packhdr "$%TEMP%\exehead.tmp" '"${UPX_PATH}\upx.exe" --brute "$%TEMP%\exehead.tmp"'
99 ;--------------------------------------------------------------------------------
101 ;--------------------------------------------------------------------------------
103 ReserveFile
"${NSISDIR}\Plugins\Aero.dll"
104 ReserveFile
"${NSISDIR}\Plugins\Banner.dll"
105 ReserveFile
"${NSISDIR}\Plugins\CPUFeatures.dll"
106 ReserveFile
"${NSISDIR}\Plugins\InstallOptions.dll"
107 ReserveFile
"${NSISDIR}\Plugins\LangDLL.dll"
108 ReserveFile
"${NSISDIR}\Plugins\LockedList.dll"
109 ReserveFile
"${NSISDIR}\Plugins\LockedList64.dll"
110 ReserveFile
"${NSISDIR}\Plugins\nsDialogs.dll"
111 ReserveFile
"${NSISDIR}\Plugins\nsExec.dll"
112 ReserveFile
"${NSISDIR}\Plugins\StartMenu.dll"
113 ReserveFile
"${NSISDIR}\Plugins\StdUtils.dll"
114 ReserveFile
"${NSISDIR}\Plugins\System.dll"
115 ReserveFile
"${NSISDIR}\Plugins\UserInfo.dll"
116 ReserveFile
"Dialogs\Page_CPU.ini"
117 ReserveFile
"Resources\Splash.gif"
120 ;--------------------------------------------------------------------------------
122 ;--------------------------------------------------------------------------------
125 !include `InstallOptions.nsh`
126 !include `WinVer.nsh`
128 !include `StrFunc.nsh`
129 !include `StdUtils.nsh`
130 !include `CPUFeatures.nsh`
131 !include `MPUI_Common.nsh`
137 ;--------------------------------------------------------------------------------
139 ;--------------------------------------------------------------------------------
149 ;--------------------------------------------------------------------------------
151 ;--------------------------------------------------------------------------------
153 !searchreplace PRODUCT_VERSION_DATE
"${MPLAYER_DATE}" "-" "."
154 VIProductVersion
"${PRODUCT_VERSION_DATE}.${MPLAYER_BUILDNO}"
156 VIAddVersionKey
"Author" "LoRd_MuldeR <mulder2@gmx.de>"
157 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."
158 VIAddVersionKey
"CompanyName" "Free Software Foundation"
159 VIAddVersionKey
"FileDescription" "MPlayer for Windows (Build #${MPLAYER_BUILDNO})"
160 VIAddVersionKey
"FileVersion" "${PRODUCT_VERSION_DATE}.${MPLAYER_BUILDNO}"
161 VIAddVersionKey
"LegalCopyright" "Copyright 2000-2018 The MPlayer Project"
162 VIAddVersionKey
"LegalTrademarks" "GNU"
163 VIAddVersionKey
"OriginalFilename" "MPUI-Setup.exe"
164 VIAddVersionKey
"ProductName" "MPlayer for Windows"
165 VIAddVersionKey
"ProductVersion" "Build #${MPLAYER_BUILDNO} (${MPLAYER_DATE})"
166 VIAddVersionKey
"Website" "${MPlayerWebSite}"
169 ;--------------------------------------------------------------------------------
170 ; MUI2 INTERFACE SETTINGS
171 ;--------------------------------------------------------------------------------
173 !define MUI_ABORTWARNING
174 !define MUI_STARTMENUPAGE_REGISTRY_ROOT
HKLM
175 !define MUI_STARTMENUPAGE_REGISTRY_KEY
"${MPlayerRegPath}"
176 !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME
"StartmenuFolder"
177 !define MUI_LANGDLL_REGISTRY_ROOT
HKLM
178 !define MUI_LANGDLL_REGISTRY_KEY
"${MPlayerRegPath}"
179 !define MUI_LANGDLL_REGISTRY_VALUENAME
"SetupLanguage"
180 !define MUI_STARTMENUPAGE_DEFAULTFOLDER
"MPlayer for Windows"
181 !define MUI_FINISHPAGE_NOAUTOCLOSE
182 !define MUI_UNFINISHPAGE_NOAUTOCLOSE
183 !define MUI_FINISHPAGE_RUN
184 !define MUI_FINISHPAGE_RUN_FUNCTION RunAppFunction
185 !define MUI_FINISHPAGE_SHOWREADME
186 !define MUI_FINISHPAGE_SHOWREADME_FUNCTION ShowReadmeFunction
187 !define MUI_FINISHPAGE_LINK
${MPlayerWebSite}
188 !define MUI_FINISHPAGE_LINK_LOCATION
${MPlayerWebSite}
189 !define MUI_ICON
"${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico"
190 !define MUI_UNICON
"${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall.ico"
191 !define MUI_WELCOMEFINISHPAGE_BITMAP
"Artwork\wizard.bmp"
192 !define MUI_UNWELCOMEFINISHPAGE_BITMAP
"Artwork\wizard-un.bmp"
193 !define MUI_HEADERIMAGE
194 !define MUI_HEADERIMAGE_BITMAP
"Artwork\header.bmp"
195 !define MUI_HEADERIMAGE_UNBITMAP
"Artwork\header-un.bmp"
196 !define MUI_LANGDLL_ALLLANGUAGES
197 !define MUI_CUSTOMFUNCTION_GUIINIT MyGuiInit
198 !define MUI_CUSTOMFUNCTION_UNGUIINIT un
.MyGuiInit
199 !define MUI_LANGDLL_ALWAYSSHOW
200 !define MUI_COMPONENTSPAGE_SMALLDESC
203 ;--------------------------------------------------------------------------------
205 ;--------------------------------------------------------------------------------
208 !define MUI_WELCOMEPAGE_TITLE_3LINES
209 !define MUI_FINISHPAGE_TITLE_3LINES
210 !insertmacro MUI_PAGE_WELCOME
211 !insertmacro MUI_PAGE_LICENSE
"Docs\License.txt"
212 !define MUI_PAGE_CUSTOMFUNCTION_SHOW CheckForUpdate
213 !insertmacro MUI_PAGE_DIRECTORY
214 !insertmacro MUI_PAGE_COMPONENTS
215 !insertmacro MUI_PAGE_STARTMENU Application
$StartMenuFolder
216 Page Custom SelectCPUPage_Show SelectCPUPage_Validate
217 Page Custom SetTweaksPage_Show
218 Page Custom LockedListPage_Show
219 !insertmacro MUI_PAGE_INSTFILES
220 !insertmacro MUI_PAGE_FINISH
223 !define MUI_WELCOMEPAGE_TITLE_3LINES
224 !define MUI_FINISHPAGE_TITLE_3LINES
225 !insertmacro MUI_UNPAGE_WELCOME
226 !insertmacro MUI_UNPAGE_CONFIRM
227 UninstPage Custom un
.LockedListPage_Show
228 !insertmacro MUI_UNPAGE_INSTFILES
229 !insertmacro MUI_UNPAGE_FINISH
232 ;--------------------------------------------------------------------------------
234 ;--------------------------------------------------------------------------------
236 !insertmacro MUI_LANGUAGE
"English"
237 !insertmacro MUI_LANGUAGE
"German"
240 !include "Language\MPUI_EN.nsh"
241 !include "Language\MPUI_DE.nsh"
244 ;--------------------------------------------------------------------------------
246 ;--------------------------------------------------------------------------------
248 InstType "$(MPLAYER_LANG_INSTTYPE_COMPLETE)"
249 InstType "$(MPLAYER_LANG_INSTTYPE_MINIMAL)"
252 ;--------------------------------------------------------------------------------
254 ;--------------------------------------------------------------------------------
257 StrCpy $SelectedCPUType 0
258 StrCpy $DetectedCPUType 0
259 StrCpy $DetectedCPUCores 0
260 StrCpy $SelectedTweaks 1
261 StrCpy $NotUpdateInstall 1
267 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "{B800490C-C100-4B12-9F09-1A54DF063049}") i .r1 ?e'
270 MessageBox MB_ICONSTOP|
MB_TOPMOST "Oups, the installer is already running!"
276 # Running on Windows NT family?
278 MessageBox MB_TOPMOST|
MB_ICONSTOP "Sorry, this application does *not* support Windows 9x or Windows ME!"
279 ExecShell "open" "http://windows.microsoft.com/"
283 # Running on Windows XP or later?
284 ${If} ${AtMostWin2000}
285 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."
286 ExecShell "open" "http://windows.microsoft.com/"
292 UserInfo::GetAccountType
295 MessageBox MB_ICONSTOP|
MB_TOPMOST "Your system requires administrative permissions in order to install this software."
296 SetErrorLevel
740 ;ERROR_ELEVATION_REQUIRED
302 !insertmacro MUI_LANGDLL_DISPLAY
304 !insertmacro INSTALLOPTIONS_EXTRACT_AS
"Dialogs\Page_CPU.ini" "Page_CPU.ini"
305 !insertmacro INSTALLOPTIONS_EXTRACT_AS
"Dialogs\Page_Tweaks.ini" "Page_Tweaks.ini"
308 ${IfCmd} MessageBox MB_TOPMOST|
MB_ICONEXCLAMATION|
MB_OKCANCEL|MB_DEFBUTTON2
"Note: This is an early pre-release version for test only!" IDCANCEL ${||
} Quit ${|
}
314 File "/oname=$PLUGINSDIR\Splash.gif" "Resources\Splash.gif"
315 newadvsplash::show
3000 1000 500 -1 /NOCANCEL
"$PLUGINSDIR\Splash.gif"
316 Delete /REBOOTOK
"$PLUGINSDIR\Splash.gif"
323 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "{B800490C-C100-4B12-9F09-1A54DF063049}") i .r1 ?e'
326 MessageBox MB_ICONSTOP|
MB_TOPMOST "Sorry, the un-installer is already running!"
332 UserInfo::GetAccountType
335 MessageBox MB_ICONSTOP|
MB_TOPMOST "Your system requires administrative permissions in order to un-install this software."
336 SetErrorLevel
740 ;ERROR_ELEVATION_REQUIRED
342 !insertmacro MUI_LANGDLL_DISPLAY
346 ;--------------------------------------------------------------------------------
348 ;--------------------------------------------------------------------------------
351 StrCpy $0 $HWNDPARENT
352 System::Call "user32::SetWindowPos(i r0, i -1, i 0, i 0, i 0, i 0, i 3)"
356 Function un
.MyGuiInit
357 StrCpy $0 $HWNDPARENT
358 System::Call "user32::SetWindowPos(i r0, i -1, i 0, i 0, i 0, i 0, i 3)"
363 ;--------------------------------------------------------------------------------
365 ;--------------------------------------------------------------------------------
367 Section "-Check Current Version"
368 ${StdUtils
.TestParameter
} $0 "Update"
369 ${IfNot} "$0" ==
"true"
370 ${AndIf} ${FileExists} "$INSTDIR\MPlayer.exe"
371 ${AndIf} ${FileExists} "$INSTDIR\version.tag"
372 ReadINIStr $0 "$INSTDIR\version.tag" "mplayer_version" "build_no"
373 ${If} $0 > ${MPLAYER_BUILDNO}
374 MessageBox MB_OK|
MB_ICONEXCLAMATION|
MB_TOPMOST "$(MPLAYER_LANG_CAN_NOT_UPDATE)"
381 ${PrintProgress} "$(MPLAYER_LANG_STATUS_INST_CLEAN)"
383 SetShellVarContext all
384 SetOutPath "$INSTDIR"
386 ; Uninstall old version (aka "Setup v1")
388 ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{DB9E4EAB-2717-499F-8D56-4CC8A644AB60}" "InstallLocation"
390 MessageBox MB_ICONINFORMATION|
MB_OK "$(MPLAYER_LANG_UNINSTALL_OLDVER)"
391 File "/oname=$PLUGINSDIR\Uninstall-V1.exe" "Resources\Uninstall-V1.exe"
393 ExecWait '"$PLUGINSDIR\Uninstall-V1.exe" _?=$0'
394 Delete /REBOOTOK
"$PLUGINSDIR\Uninstall-V1.exe"
399 DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{DB9E4EAB-2717-499F-8D56-4CC8A644AB60}"
400 DeleteRegKey HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{DB9E4EAB-2717-499F-8D56-4CC8A644AB60}"
401 DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" "MPlayerForWindows_UpdateReminder"
402 DeleteRegValue HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" "MPlayerForWindows_UpdateReminder"
404 ; Make sure MPlayer isn't running
407 Delete "$INSTDIR\MPlayer.exe"
408 Delete "$INSTDIR\SMPlayer.exe"
409 Delete "$INSTDIR\MPUI.exe"
411 ${IfCmd} MessageBox MB_TOPMOST|
MB_ICONEXCLAMATION|
MB_OKCANCEL "$(MPLAYER_LANG_STILL_RUNNING)" IDCANCEL ${||
} Abort ${|
}
417 ; Clean the install folder
418 Delete "$INSTDIR\*.exe"
419 Delete "$INSTDIR\*.dll"
420 Delete "$INSTDIR\*.ini"
421 Delete "$INSTDIR\*.txt"
422 Delete "$INSTDIR\*.html"
423 Delete "$INSTDIR\*.htm"
424 Delete "$INSTDIR\*.ass"
425 Delete "$INSTDIR\*.m3u8"
426 Delete "$INSTDIR\*.tag"
428 RMDir /r
"$INSTDIR\codecs"
429 RMDir /r
"$INSTDIR\fonts"
430 RMDir /r
"$INSTDIR\imageformats"
431 RMDir /r
"$INSTDIR\legal_stuff"
432 RMDir /r
"$INSTDIR\locale"
433 RMDir /r
"$INSTDIR\mplayer"
434 RMDir /r
"$INSTDIR\platforms"
435 RMDir /r
"$INSTDIR\shortcuts"
436 RMDir /r
"$INSTDIR\themes"
437 RMDir /r
"$INSTDIR\translations"
439 ; Now deal with Virtual Store
440 ${GetVirtualStorePath} $0 "$INSTDIR"
441 ${If} ${FileExists} "$0\*.*"
446 Section "!MPlayer r${MPLAYER_REVISION}" SECID_MPLAYER
448 ${PrintProgress} "$(MPLAYER_LANG_STATUS_INST_MPLAYER)"
449 SetOutPath "$INSTDIR"
454 StrCpy $SelectedCPUType $DetectedCPUType
458 ${Select} $SelectedCPUType
460 DetailPrint "$(MPLAYER_LANG_SELECTED_TYPE): core2"
461 File "Builds\MPlayer-core2\MPlayer.exe"
463 DetailPrint "$(MPLAYER_LANG_SELECTED_TYPE): corei7"
464 File "Builds\MPlayer-corei7\MPlayer.exe"
466 DetailPrint "$(MPLAYER_LANG_SELECTED_TYPE): k8-sse3"
467 File "Builds\MPlayer-k8-sse3\MPlayer.exe"
469 DetailPrint "$(MPLAYER_LANG_SELECTED_TYPE): generic"
470 File "Builds\MPlayer-generic\MPlayer.exe"
472 MessageBox MB_TOPMOST|
MB_ICONEXCLAMATION|
MB_OK "Internal error: Invalid CPU type selection detected!"
477 File ".Compile\Updater.exe"
478 File "Resources\AppRegGUI.exe"
480 ; Other MPlayer-related files
481 File "Builds\MPlayer-generic\*.dll"
482 ${ExtractSubDir} "Builds\MPlayer-generic" "mplayer"
483 ${ExtractSubDir} "Builds\MPlayer-generic" "fonts"
486 SetOutPath "$INSTDIR"
488 File "/oname=Manual.html" "Builds\MPlayer-generic\MPlayer.man.html"
489 File "Docs\Readme.html"
490 SetOutPath "$INSTDIR\legal_stuff"
491 File "Docs\legal_stuff\*.txt"
496 Delete "$INSTDIR\version.tag"
498 ${IfCmd} MessageBox MB_TOPMOST|
MB_ICONEXCLAMATION|
MB_OKCANCEL "$(MPLAYER_LANG_TAG_WRITE)" IDCANCEL ${||
} Abort ${|
}
503 WriteINIStr "$INSTDIR\version.tag" "mplayer_version" "build_no" "${MPLAYER_BUILDNO}"
504 WriteINIStr "$INSTDIR\version.tag" "mplayer_version" "pkg_date" "${MPLAYER_DATE}"
505 SetFileAttributes "$INSTDIR\version.tag" FILE_ATTRIBUTE_READONLY
507 ; Set file access rights
508 ${MakePathPublic} "$INSTDIR"
509 ${MakeFilePublic} "$INSTDIR\mplayer\config"
510 ${MakeFilePublic} "$INSTDIR\fonts\fonts.conf"
513 Section "!MPUI $(MPLAYER_LANG_FRONT_END) v${MPUI_VERSION}" SECID_MPUI
515 ${PrintProgress} "$(MPLAYER_LANG_STATUS_INST_MPUI)"
518 SetOutPath "$INSTDIR"
522 SetOutPath "$INSTDIR\locale"
523 File "MPUI\locale\*.txt"
525 ; Set file access rights
526 ${MakeFilePublic} "$INSTDIR\MPUI.ini"
528 ; Setup initial config
530 WriteINIStr "$INSTDIR\MPUI.ini" "MPUI" "Params" "-vo direct3d -lavdopts threads=$DetectedCPUCores"
531 WriteINIStr "$INSTDIR\MPUI.ini" "MPUI" "Locale" "$(MPLAYER_LANG_MPUI_DEFAULT_LANGUAGE)"
533 ${IfCmd} MessageBox MB_TOPMOST|
MB_ICONSTOP|MB_DEFBUTTON2|
MB_OKCANCEL "$(MPLAYER_LANG_CONFIG_MPUI)" IDCANCEL ${||
} Abort ${|
}
537 Section "!SMPlayer $(MPLAYER_LANG_FRONT_END) v${SMPLAYER_VERSION}" SECID_SMPLAYER
539 ${PrintProgress} "$(MPLAYER_LANG_STATUS_INST_SMPLAYER)"
541 ; SMPlayer program files
542 SetOutPath "$INSTDIR"
543 File "SMPlayer\*.exe"
544 File "SMPlayer\*.dll"
546 ; Additional SMPlayer files
547 ${ExtractSubDir} "SMPlayer" "imageformats"
548 ${ExtractSubDir} "SMPlayer" "platforms"
549 ${ExtractSubDir} "SMPlayer" "shortcuts"
550 ${ExtractSubDir} "SMPlayer" "themes"
551 ${ExtractSubDir} "SMPlayer" "translations"
553 ; Set file access rights
554 ${MakeFilePublic} "$INSTDIR\SMPlayer.ini"
555 ${MakeFilePublic} "$INSTDIR\SMPlayer_files.ini"
556 ${MakeFilePublic} "$INSTDIR\player_info.ini"
557 ${MakeFilePublic} "$INSTDIR\playlist.ini"
558 ${MakeFilePublic} "$INSTDIR\favorites.m3u8"
559 ${MakeFilePublic} "$INSTDIR\radio.m3u8"
560 ${MakeFilePublic} "$INSTDIR\tv.m3u8"
561 ${MakeFilePublic} "$INSTDIR\styles.ass"
562 ${MakeFilePublic} "$INSTDIR\shortcuts\default.keys"
564 ; Setup initial config
565 ${StrRep} $0 "$INSTDIR\MPlayer.exe" "\" "/"
567 WriteINIStr "$INSTDIR\SMPlayer.ini" "%General" "autosync" "true"
568 WriteINIStr "$INSTDIR\SMPlayer.ini" "%General" "autosync_factor" "30"
569 WriteINIStr "$INSTDIR\SMPlayer.ini" "%General" "config_version" "5"
570 WriteINIStr "$INSTDIR\SMPlayer.ini" "%General" "driver\vo" "direct3d"
571 WriteINIStr "$INSTDIR\SMPlayer.ini" "%General" "file_settings_method" "normal"
572 WriteINIStr "$INSTDIR\SMPlayer.ini" "%General" "mplayer_bin" "$0"
573 WriteINIStr "$INSTDIR\SMPlayer.ini" "%General" "osd" "1"
574 WriteINIStr "$INSTDIR\SMPlayer.ini" "%General" "use_audio_equalizer" "false"
575 WriteINIStr "$INSTDIR\SMPlayer.ini" "%General" "use_scaletempo" "0"
576 WriteINIStr "$INSTDIR\SMPlayer.ini" "advanced" "mplayer_additional_options" ""
577 WriteINIStr "$INSTDIR\SMPlayer.ini" "gui" "gui" "DefaultGUI"
578 WriteINIStr "$INSTDIR\SMPlayer.ini" "gui" "iconset" "Numix-remix"
579 WriteINIStr "$INSTDIR\SMPlayer.ini" "gui" "qt_style" "WindowsVista"
580 WriteINIStr "$INSTDIR\SMPlayer.ini" "mplayer_info" "is_mplayer2" "false"
581 WriteINIStr "$INSTDIR\SMPlayer.ini" "mplayer_info" "mplayer_detected_version" "${MPLAYER_REVISION}"
582 WriteINIStr "$INSTDIR\SMPlayer.ini" "mplayer_info" "mplayer_user_supplied_version" "-1"
583 WriteINIStr "$INSTDIR\SMPlayer.ini" "performance" "frame_drop" "true"
584 WriteINIStr "$INSTDIR\SMPlayer.ini" "performance" "priority" "1"
585 WriteINIStr "$INSTDIR\SMPlayer.ini" "performance" "threads" "$DetectedCPUCores"
586 WriteINIStr "$INSTDIR\SMPlayer.ini" "smplayer" "check_for_new_version" "false"
587 WriteINIStr "$INSTDIR\SMPlayer.ini" "smplayer" "check_if_upgraded" "false"
588 WriteINIStr "$INSTDIR\SMPlayer.ini" "update_checker" "enabled" "false"
591 ${IfCmd} MessageBox MB_TOPMOST|
MB_ICONSTOP|MB_DEFBUTTON2|
MB_OKCANCEL "$(MPLAYER_LANG_CONFIG_SMPLAYER)" IDCANCEL ${||
} Abort ${|
}
595 Section "!$(MPLAYER_LANG_BIN_CODECS) (${CODECS_DATE})"
597 ${PrintProgress} "$(MPLAYER_LANG_STATUS_INST_CODECS)"
599 SetOutPath "$INSTDIR\codecs"
611 Section "-Write Uninstaller"
612 ${PrintProgress} "$(MPLAYER_LANG_STATUS_MAKEUNINST)"
613 WriteUninstaller "$INSTDIR\Uninstall.exe"
616 Section "-Create Shortcuts"
617 !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
618 ${PrintProgress} "$(MPLAYER_LANG_STATUS_SHORTCUTS)"
619 CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
621 SetShellVarContext current
622 Delete "$SMPROGRAMS\$StartMenuFolder\*.lnk"
623 Delete "$SMPROGRAMS\$StartMenuFolder\*.pif"
624 Delete "$SMPROGRAMS\$StartMenuFolder\*.url"
626 SetShellVarContext all
627 Delete "$SMPROGRAMS\$StartMenuFolder\*.lnk"
628 Delete "$SMPROGRAMS\$StartMenuFolder\*.pif"
629 Delete "$SMPROGRAMS\$StartMenuFolder\*.url"
631 ${If} ${FileExists} "$INSTDIR\MPUI.exe"
632 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\MPUI.lnk" "$INSTDIR\MPUI.exe"
633 CreateShortCut "$DESKTOP\MPUI.lnk" "$INSTDIR\MPUI.exe"
635 ${If} ${FileExists} "$INSTDIR\SMPlayer.exe"
636 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\SMPlayer.lnk" "$INSTDIR\SMPlayer.exe"
637 CreateShortCut "$DESKTOP\SMPlayer.lnk" "$INSTDIR\SMPlayer.exe"
640 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(MPLAYER_LANG_SHORTCUT_UPDATE).lnk" "$INSTDIR\Updater.exe" "/L=$LANGUAGE"
641 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(MPLAYER_LANG_SHORTCUT_README).lnk" "$INSTDIR\Readme.html"
642 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(MPLAYER_LANG_SHORTCUT_MANUAL).lnk" "$INSTDIR\Manual.html"
644 ${If} ${AtLeastWinVista}
645 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(MPLAYER_LANG_SHORTCUT_APPREG).lnk" "$INSTDIR\AppRegGUI.exe"
648 ${CreateWebLink} "$SMPROGRAMS\$StartMenuFolder\$(MPLAYER_LANG_SHORTCUT_SITE_MULDERS).url" "http://muldersoft.com/"
649 ${CreateWebLink} "$SMPROGRAMS\$StartMenuFolder\$(MPLAYER_LANG_SHORTCUT_SITE_MPWIN32).url" "http://oss.netfarm.it/mplayer-win32.php"
650 ${CreateWebLink} "$SMPROGRAMS\$StartMenuFolder\$(MPLAYER_LANG_SHORTCUT_SITE_MPLAYER).url" "http://www.mplayerhq.hu/"
652 ${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\SMPlayer.lnk"
653 ${StdUtils
.InvokeShellVerb
} $R1 "$SMPROGRAMS\$StartMenuFolder" "SMPlayer.lnk" ${StdUtils
.Const
.ShellVerb
.PinToTaskbar
}
654 DetailPrint 'Pin: "$SMPROGRAMS\$StartMenuFolder\SMPlayer.lnk" -> $R1'
656 !insertmacro MUI_STARTMENU_WRITE_END
659 Section "-ApplyTweaks"
660 ${PrintProgress} "$(MPLAYER_LANG_STATUS_TWEAKS)"
661 DetailPrint "$(MPLAYER_LANG_APPLYING_TWEAKS)"
663 IntOp $0 $SelectedTweaks & 1
665 ${AndIf} ${FileExists} "$INSTDIR\SMPlayer.ini"
666 DetailPrint "SMPlayer: Enable tweak 'gui=SkinGUI'"
667 WriteINIStr "$INSTDIR\SMPlayer.ini" "gui" "gui" "SkinGUI"
668 WriteINIStr "$INSTDIR\SMPlayer.ini" "gui" "qt_style" "Fusion"
669 WriteINIStr "$INSTDIR\SMPlayer.ini" "gui" "iconset" "Modern"
672 IntOp $0 $SelectedTweaks & 2
674 ${AndIf} ${FileExists} "$INSTDIR\MPUI.ini"
675 DetailPrint "MPUI: Enable tweak '-vo gl'"
676 WriteINIStr "$INSTDIR\MPUI.ini" "MPUI" "Params" "-vo gl -lavdopts threads=$DetectedCPUCores"
679 ${AndIf} ${FileExists} "$INSTDIR\SMPlayer.ini"
680 DetailPrint "SMPlayer: Enable tweak '-vo gl'"
681 WriteINIStr "$INSTDIR\SMPlayer.ini" "%General" "driver\vo" "gl"
684 IntOp $0 $SelectedTweaks & 4
686 ${AndIf} ${FileExists} "$INSTDIR\MPUI.ini"
687 DetailPrint "MPUI: Enable tweak '-af volnorm=2'"
688 ReadINIStr $1 "$INSTDIR\MPUI.ini" "MPUI" "Params"
689 WriteINIStr "$INSTDIR\MPUI.ini" "MPUI" "Params" "$1 -af volnorm=2"
692 ${AndIf} ${FileExists} "$INSTDIR\SMPlayer.ini"
693 DetailPrint "SMPlayer: Enable tweak 'initial_volnorm=true'"
694 WriteINIStr "$INSTDIR\SMPlayer.ini" "defaults" "initial_volnorm" "true"
698 Section "$(MPLAYER_LANG_COMPRESS_FILES)"
700 ${PrintProgress} "$(MPLAYER_LANG_STATUS_INST_COMPRESS)"
702 File "/oname=$PLUGINSDIR\UPX.exe" "${UPX_PATH}\UPX.exe"
704 ${PackAll} "$INSTDIR" "*.exe"
705 ${PackAll} "$INSTDIR" "*.dll"
706 ${PackAll} "$INSTDIR\codecs" "*.acm"
707 ${PackAll} "$INSTDIR\codecs" "*.ax"
708 ${PackAll} "$INSTDIR\codecs" "*.dll"
709 ${PackAll} "$INSTDIR\codecs" "*.qtx"
711 Delete "$PLUGINSDIR\UPX.exe"
714 Section "-Update Font Cache"
715 ${PrintProgress} "$(MPLAYER_LANG_STATUS_INST_FONTCACHE)"
717 SetShellVarContext current
718 Delete "$APPDATA\fontconfig\cache\*.*"
719 Delete "$LOCALAPPDATA\fontconfig\cache\*.*"
721 SetShellVarContext all
722 Delete "$APPDATA\fontconfig\cache\*.*"
723 Delete "$LOCALAPPDATA\fontconfig\cache\*.*"
725 File "/oname=$PLUGINSDIR\Sample.avi" "Resources\Sample.avi"
726 DetailPrint "$(MPLAYER_LANG_UPDATING_FONTCACHE)"
727 NsExec::Exec '"$INSTDIR\MPlayer.exe" -fontconfig -ass -vo null -ao null "$PLUGINSDIR\Sample.avi"'
728 Delete "Resources\Sample.avi"
731 Section "-Update Registry"
732 ${PrintProgress} "$(MPLAYER_LANG_STATUS_REGISTRY)"
733 DetailPrint "$(MPLAYER_LANG_WRITING_REGISTRY)"
736 DeleteRegKey HKLM "${MPlayerRegPath}"
737 DeleteRegKey HKCU "${MPlayerRegPath}"
738 DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" "MPlayerForWindows_AutoUpdateV2"
739 DeleteRegValue HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" "MPlayerForWindows_AutoUpdateV2"
742 WriteRegStr HKLM "${MPlayerRegPath}" "InstallLocation" "$INSTDIR"
743 WriteRegStr HKLM "${MPlayerRegPath}" "UninstallString" '"$INSTDIR\Uninstall.exe"'
744 WriteRegStr HKLM "${MPlayerRegPath}" "DisplayName" "$(MPLAYER_LANG_MPLAYER_WIN32)"
745 WriteRegStr HKLM "${MPlayerRegPath}" "DisplayIcon" "$INSTDIR\MPlayer.exe,0"
746 WriteRegStr HKLM "${MPlayerRegPath}" "DisplayVersion" "${MPLAYER_DATE}"
747 WriteRegStr HKLM "${MPlayerRegPath}" "URLInfoAbout" "http://muldersoft.com/"
748 WriteRegStr HKLM "${MPlayerRegPath}" "URLUpdateInfo" "http://muldersoft.com/"
749 WriteRegStr HKLM "${MPlayerRegPath}" "Publisher" "The MPlayer Team"
750 WriteRegDWORD HKLM "${MPlayerRegPath}" "NoModify" 1
751 WriteRegDWORD HKLM "${MPlayerRegPath}" "NoRepair" 1
754 DeleteRegKey HKCR "MPlayerForWindowsV2.File"
755 DeleteRegKey HKLM "SOFTWARE\Classes\MPlayerForWindowsV2.File"
756 DeleteRegKey HKCU "SOFTWARE\Classes\MPlayerForWindowsV2.File"
757 ${If} ${FileExists} "$INSTDIR\MPUI.exe"
758 WriteRegStr HKLM "SOFTWARE\Classes\MPlayerForWindowsV2.File\shell\open\command" "" '"$INSTDIR\MPUI.exe" "%1"'
759 WriteRegStr HKLM "SOFTWARE\Classes\MPlayerForWindowsV2.File\DefaultIcon" "" "$INSTDIR\MPUI.exe,0"
761 ${If} ${FileExists} "$INSTDIR\SMPlayer.exe"
762 WriteRegStr HKLM "SOFTWARE\Classes\MPlayerForWindowsV2.File\shell\open\command" "" '"$INSTDIR\SMPlayer.exe" "%1"'
763 WriteRegStr HKLM "SOFTWARE\Classes\MPlayerForWindowsV2.File\DefaultIcon" "" "$INSTDIR\SMPlayer.exe,1"
767 DeleteRegValue HKCU "SOFTWARE\RegisteredApplications" "MPlayerForWindowsV2"
768 WriteRegStr HKLM "SOFTWARE\RegisteredApplications" "MPlayerForWindowsV2" "${MPlayerRegPath}\Capabilities"
771 WriteRegStr HKLM "${MPlayerRegPath}\Capabilities" "ApplicationName" "$(MPLAYER_LANG_MPLAYER_WIN32)"
772 WriteRegStr HKLM "${MPlayerRegPath}\Capabilities" "ApplicationDescription" "$(MPLAYER_LANG_MPLAYER_WIN32)"
773 WriteRegStr HKLM "${MPlayerRegPath}\Capabilities" "ApplicationDescription" "$(MPLAYER_LANG_MPLAYER_WIN32)"
776 ${RegisterFileExtCapability} "256"
777 ${RegisterFileExtCapability} "3GP"
778 ${RegisterFileExtCapability} "AAC"
779 ${RegisterFileExtCapability} "ASF"
780 ${RegisterFileExtCapability} "AVI"
781 ${RegisterFileExtCapability} "BIN"
782 ${RegisterFileExtCapability} "DAT"
783 ${RegisterFileExtCapability} "DIVX"
784 ${RegisterFileExtCapability} "EVO"
785 ${RegisterFileExtCapability} "FLV"
786 ${RegisterFileExtCapability} "M2V"
787 ${RegisterFileExtCapability} "M2TS"
788 ${RegisterFileExtCapability} "M4A"
789 ${RegisterFileExtCapability} "MKA"
790 ${RegisterFileExtCapability} "MKV"
791 ${RegisterFileExtCapability} "MOV"
792 ${RegisterFileExtCapability} "MP2"
793 ${RegisterFileExtCapability} "MP3"
794 ${RegisterFileExtCapability} "MP4"
795 ${RegisterFileExtCapability} "MPEG"
796 ${RegisterFileExtCapability} "MPG"
797 ${RegisterFileExtCapability} "MPV"
798 ${RegisterFileExtCapability} "NSV"
799 ${RegisterFileExtCapability} "OGG"
800 ${RegisterFileExtCapability} "OGM"
801 ${RegisterFileExtCapability} "RM"
802 ${RegisterFileExtCapability} "RMVB"
803 ${RegisterFileExtCapability} "TS"
804 ${RegisterFileExtCapability} "VOB"
805 ${RegisterFileExtCapability} "WAV"
806 ${RegisterFileExtCapability} "WEBM"
807 ${RegisterFileExtCapability} "WMV"
809 ; Reset auto update interval
810 DeleteRegValue HKLM "${MPlayerRegPath}" "LastUpdateCheck"
811 DeleteRegValue HKCU "${MPlayerRegPath}" "LastUpdateCheck"
814 Section "$(MPLAYER_LANG_INST_AUTOUPDATE)" SECID_AUTOUPDATE
816 DetailPrint "$(MPLAYER_LANG_SCHEDULE_UPDATE)"
817 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" "MPlayerForWindows_AutoUpdateV2" '"$INSTDIR\Updater.exe" /L=$LANGUAGE /AutoCheck'
820 Section "-Protect Files"
821 SetFileAttributes "$INSTDIR\AppRegGUI.exe" FILE_ATTRIBUTE_READONLY
822 SetFileAttributes "$INSTDIR\mplayer.exe" FILE_ATTRIBUTE_READONLY
823 SetFileAttributes "$INSTDIR\MPUI.exe" FILE_ATTRIBUTE_READONLY
824 SetFileAttributes "$INSTDIR\smplayer.exe" FILE_ATTRIBUTE_READONLY
825 SetFileAttributes "$INSTDIR\Updater.exe" FILE_ATTRIBUTE_READONLY
827 SetFileAttributes "$INSTDIR\dsnative.dll" FILE_ATTRIBUTE_READONLY
828 SetFileAttributes "$INSTDIR\libeay32.dll" FILE_ATTRIBUTE_READONLY
829 SetFileAttributes "$INSTDIR\libgcc_s_dw2-1.dll" FILE_ATTRIBUTE_READONLY
830 SetFileAttributes "$INSTDIR\libstdc++-6.dll" FILE_ATTRIBUTE_READONLY
831 SetFileAttributes "$INSTDIR\libwinpthread-1.dll" FILE_ATTRIBUTE_READONLY
832 SetFileAttributes "$INSTDIR\Qt5Core.dll" FILE_ATTRIBUTE_READONLY
833 SetFileAttributes "$INSTDIR\Qt5Gui.dll" FILE_ATTRIBUTE_READONLY
834 SetFileAttributes "$INSTDIR\Qt5Network.dll" FILE_ATTRIBUTE_READONLY
835 SetFileAttributes "$INSTDIR\Qt5Script.dll" FILE_ATTRIBUTE_READONLY
836 SetFileAttributes "$INSTDIR\Qt5Widgets.dll" FILE_ATTRIBUTE_READONLY
837 SetFileAttributes "$INSTDIR\Qt5Xml.dll" FILE_ATTRIBUTE_READONLY
838 SetFileAttributes "$INSTDIR\ssleay32.dll" FILE_ATTRIBUTE_READONLY
839 SetFileAttributes "$INSTDIR\zlib1.dll" FILE_ATTRIBUTE_READONLY
843 ${PrintStatus} "$(MUI_TEXT_FINISH_TITLE)"
847 ;--------------------------------------------------------------------------------
848 ; UN-INSTALL SECTIONS
849 ;--------------------------------------------------------------------------------
853 ${PrintProgress} "$(MPLAYER_LANG_STATUS_UNINSTALL)"
855 ; Validate uninstall path
856 ${IfThen} "$INSTDIR" ==
"" ${|
} Abort ${|
}
857 StrCpy $0 "$INSTDIR" "" -2
858 ${IfThen} $0 ==
":\" ${|
} Abort ${|
}
861 !insertmacro MUI_STARTMENU_GETFOLDER Application
$StartMenuFolder
862 ${IfNot} "$StartMenuFolder" ==
""
863 SetShellVarContext current
864 ${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\SMPlayer.lnk"
865 ${StdUtils
.InvokeShellVerb
} $R1 "$SMPROGRAMS\$StartMenuFolder" "SMPlayer.lnk" ${StdUtils
.Const
.ShellVerb
.UnpinFromTaskbar
}
866 DetailPrint 'Unpin: "$SMPROGRAMS\$StartMenuFolder\SMPlayer.lnk" -> $R1'
868 ${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\*.*"
869 Delete /REBOOTOK
"$SMPROGRAMS\$StartMenuFolder\*.lnk"
870 Delete /REBOOTOK
"$SMPROGRAMS\$StartMenuFolder\*.url"
871 Delete /REBOOTOK
"$SMPROGRAMS\$StartMenuFolder\*.pif"
872 RMDir "$SMPROGRAMS\$StartMenuFolder"
874 SetShellVarContext all
875 ${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\SMPlayer.lnk"
876 ${StdUtils
.InvokeShellVerb
} $R1 "$SMPROGRAMS\$StartMenuFolder" "SMPlayer.lnk" ${StdUtils
.Const
.ShellVerb
.UnpinFromTaskbar
}
877 DetailPrint 'Unpin: "$SMPROGRAMS\$StartMenuFolder\SMPlayer.lnk" -> $R1'
879 ${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\*.*"
880 Delete /REBOOTOK
"$SMPROGRAMS\$StartMenuFolder\*.lnk"
881 Delete /REBOOTOK
"$SMPROGRAMS\$StartMenuFolder\*.url"
882 Delete /REBOOTOK
"$SMPROGRAMS\$StartMenuFolder\*.pif"
883 RMDir "$SMPROGRAMS\$StartMenuFolder"
888 Delete /REBOOTOK
"$DESKTOP\MPUI.lnk"
889 Delete /REBOOTOK
"$DESKTOP\SMPlayer.lnk"
895 ${GetVirtualStorePath} $0 "$INSTDIR"
896 ${If} ${FileExists} "$0\*.*"
901 DeleteRegKey HKLM "${MPlayerRegPath}"
902 DeleteRegKey HKCU "${MPlayerRegPath}"
903 DeleteRegValue HKLM "SOFTWARE\RegisteredApplications" "MPlayerForWindowsV2"
904 DeleteRegValue HKCU "SOFTWARE\RegisteredApplications" "MPlayerForWindowsV2"
907 DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" "MPlayerForWindows_AutoUpdateV2"
908 DeleteRegValue HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" "MPlayerForWindows_AutoUpdateV2"
911 DeleteRegKey HKCR "MPlayerForWindowsV2.File"
912 DeleteRegKey HKLM "SOFTWARE\Classes\MPlayerForWindowsV2.File"
913 DeleteRegKey HKCU "SOFTWARE\Classes\MPlayerForWindowsV2.File"
915 ${PrintStatus} "$(MUI_UNTEXT_FINISH_TITLE)"
919 ;--------------------------------------------------------------------------------
920 ; SECTION SELECTION CHANGED
921 ;--------------------------------------------------------------------------------
923 Function .onSelChange
924 ${IfNot} ${SectionIsSelected} ${SECID_MPUI}
925 ${AndIfNot} ${SectionIsSelected} ${SECID_SMPLAYER}
926 MessageBox MB_TOPMOST|
MB_ICONEXCLAMATION "$(MPLAYER_LANG_SELCHANGE)"
927 SectionGetFlags
${SECID_MPUI} $0
928 IntOp $0 $0 |
${SF_SELECTED}
929 SectionSetFlags
${SECID_MPUI} $0
932 ${IfNot} ${SectionIsSelected} ${SECID_AUTOUPDATE}
934 ${IfCmd} MessageBox MB_TOPMOST|
MB_ICONEXCLAMATION|
MB_YESNO|MB_DEFBUTTON2
"$(MPLAYER_LANG_SEL_AUTOUPDATE)" IDNO ${||
} StrCpy $0 "ok" ${|
}
936 SectionGetFlags
${SECID_AUTOUPDATE} $0
937 IntOp $0 $0 |
${SF_SELECTED}
938 SectionSetFlags
${SECID_AUTOUPDATE} $0
944 ;--------------------------------------------------------------------------------
946 ;--------------------------------------------------------------------------------
948 !macro LockedListPage_Function
949 !insertmacro MUI_HEADER_TEXT
"$(MPLAYER_LANG_LOCKEDLIST_HEADER)" "$(MPLAYER_LANG_LOCKEDLIST_TEXT)"
952 File /oname=
$PLUGINSDIR\LockedList64
.dll
`${NSISDIR}\Plugins\LockedList64.dll`
954 LockedList::AddModule
"\MPlayer.exe"
955 LockedList::AddModule
"\SMPlayer.exe"
956 LockedList::AddModule
"\MPUI.exe"
957 LockedList::AddModule
"${NSISDIR}\Qt5Core.dll"
959 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)"
963 Function LockedListPage_Show
964 !insertmacro LockedListPage_Function
967 Function un
.LockedListPage_Show
968 !insertmacro LockedListPage_Function
972 ;--------------------------------------------------------------------------------
973 ; CUSTOME PAGE: CPU SELECTOR
974 ;--------------------------------------------------------------------------------
976 Function SelectCPUPage_Show
977 ; Detect CPU type, if not detected yet
978 ${If} $DetectedCPUType < 2
979 ${OrIf} $DetectedCPUType > 5
981 !insertmacro INSTALLOPTIONS_READ
$0 "Page_CPU.ini" "Field $DetectedCPUType" "Text"
982 !insertmacro INSTALLOPTIONS_WRITE
"Page_CPU.ini" "Field $DetectedCPUType" "Text" "$0 <---"
985 ; Make sure the current selection is valid
986 ${IfThen} $SelectedCPUType < 2 ${|
} StrCpy $SelectedCPUType $DetectedCPUType ${|
}
987 ${IfThen} $SelectedCPUType > 5 ${|
} StrCpy $SelectedCPUType $DetectedCPUType ${|
}
990 !insertmacro INSTALLOPTIONS_WRITE
"Page_CPU.ini" "Field 1" "Text" "$(MPLAYER_LANG_SELECT_CPU_TYPE)"
991 !insertmacro INSTALLOPTIONS_WRITE
"Page_CPU.ini" "Field 6" "Text" "$(MPLAYER_LANG_SELECT_CPU_HINT)"
993 ; Apply current selection to dialog
995 ${If} $0 ==
$SelectedCPUType
996 !insertmacro INSTALLOPTIONS_WRITE
"Page_CPU.ini" "Field $0" "State" "1"
998 !insertmacro INSTALLOPTIONS_WRITE
"Page_CPU.ini" "Field $0" "State" "0"
1003 !insertmacro MUI_HEADER_TEXT
"$(MPLAYER_LANG_SELECT_CPU_HEAD)" "$(MPLAYER_LANG_SELECT_CPU_TEXT)"
1004 !insertmacro INSTALLOPTIONS_DISPLAY
"Page_CPU.ini"
1006 ; Read new selection from dialog
1007 StrCpy $SelectedCPUType 0
1009 !insertmacro INSTALLOPTIONS_READ
$1 "Page_CPU.ini" "Field $0" "State"
1010 ${IfThen} $1 ==
1 ${|
} StrCpy $SelectedCPUType $0 ${|
}
1014 Function SelectCPUPage_Validate
1015 ; Read new selection from dialog
1018 !insertmacro INSTALLOPTIONS_READ
$1 "Page_CPU.ini" "Field $0" "State"
1019 ${IfThen} $1 ==
1 ${|
} StrCpy $2 $0 ${|
}
1022 ; Validate selection
1025 MessageBox MB_ICONSTOP "Oups, invalid selection detected!"
1030 Function DetectCPUType
1031 StrCpy $DetectedCPUType 5 ;generic
1032 StrCpy $DetectedCPUCores 2
1035 Banner::show
/NOUNLOAD
"$(MPLAYER_LANG_DETECTING)"
1038 ${CPUFeatures
.GetCount
} $0
1039 ${IfNot} $0 ==
"error"
1040 StrCpy $DetectedCPUCores $0
1044 !ifdef CPU_DETECT_DEBUG
1045 ${CPUFeatures
.GetVendor
} $0
1046 ${CPUFeatures
.CheckFeature
} "MMX1" $1
1047 ${CPUFeatures
.CheckFeature
} "3DNOW" $2
1048 ${CPUFeatures
.CheckFeature
} "SSE3" $3
1049 ${CPUFeatures
.CheckFeature
} "SSSE3" $4
1050 ${CPUFeatures
.CheckFeature
} "SSE4.2" $5
1051 ${CPUFeatures
.CheckFeature
} "AVX1" $6
1052 ${CPUFeatures
.CheckFeature
} "FMA4" $7
1053 StrCpy $9 `Vendor = $0`
1054 StrCpy $9 `$9$\n"MMX1" = $1`
1055 StrCpy $9 `$9$\n"3DNOW" = $2`
1056 StrCpy $9 `$9$\n"SSE3" = $3`
1057 StrCpy $9 `$9$\n"SSSE3" = $4`
1058 StrCpy $9 `$9$\n"SSE4.2" = $5`
1059 StrCpy $9 `$9$\n"AVX1" = $6`
1060 StrCpy $9 `$9$\n"FMA4" = $7`
1061 MessageBox MB_TOPMOST `$9`
1064 ; Make sure we have at least MMX
1065 ${IfNot} ${CPUSupports} "MMX1"
1070 ; Select the "best" model for Intel's
1072 ; Core2 (SSE3 + SSSE3)
1073 ${If} ${CPUSupportsAll} "SSE3,SSSE3"
1074 StrCpy $DetectedCPUType 2 ;
1076 ; Nehalem (SSE3 + SSSE3 + SSE4.2)
1077 ${If} ${CPUSupportsAll} "SSE3,SSSE3,SSE4.2"
1078 StrCpy $DetectedCPUType 3
1082 ; Select the "best" model for AMD's
1084 ; K8+SSE3 (3DNow! + SSE3)
1085 ${If} ${CPUSupportsAll} "3DNOW,SSE3"
1086 StrCpy $DetectedCPUType 4
1088 ; Bulldozer (SSE3 + SSSE3 + SSE4.2 + AVX + FMA4)
1089 ;${If} ${CPUSupportsAll} "SSE3,SSSE3,SSE4.2,AVX1,FMA4"
1090 ; StrCpy $DetectedCPUType 5 #5 is now generic, as 'bdver1' build got dropped
1098 ;--------------------------------------------------------------------------------
1099 ; CUSTOME PAGE: TWEAKS
1100 ;--------------------------------------------------------------------------------
1102 Function SetTweaksPage_Show
1103 ; Apply current selection to dialog
1106 IntOp $2 $0 & $SelectedTweaks
1108 !insertmacro INSTALLOPTIONS_WRITE
"Page_Tweaks.ini" "Field $1" "State" "1"
1110 !insertmacro INSTALLOPTIONS_WRITE
"Page_Tweaks.ini" "Field $1" "State" "0"
1116 !insertmacro INSTALLOPTIONS_WRITE
"Page_Tweaks.ini" "Field 1" "Text" "$(MPLAYER_LANG_TWEAKS_HINT)"
1117 !insertmacro INSTALLOPTIONS_WRITE
"Page_Tweaks.ini" "Field 2" "Text" "$(MPLAYER_LANG_TWEAKS_SKINNEDUI)"
1118 !insertmacro INSTALLOPTIONS_WRITE
"Page_Tweaks.ini" "Field 3" "Text" "$(MPLAYER_LANG_TWEAKS_OPENGL)"
1119 !insertmacro INSTALLOPTIONS_WRITE
"Page_Tweaks.ini" "Field 4" "Text" "$(MPLAYER_LANG_TWEAKS_VOLNORM)"
1122 !insertmacro MUI_HEADER_TEXT
"$(MPLAYER_LANG_TWEAKS_HEAD)" "$(MPLAYER_LANG_TWEAKS_TEXT)"
1123 !insertmacro INSTALLOPTIONS_DISPLAY
"Page_Tweaks.ini"
1125 ; Read new selection from dialog
1127 StrCpy $SelectedTweaks 0
1129 !insertmacro INSTALLOPTIONS_READ
$2 "Page_Tweaks.ini" "Field $1" "State"
1130 ${IfThen} $2 =
1 ${|
} IntOp $SelectedTweaks $SelectedTweaks |
$0 ${|
}
1136 ;--------------------------------------------------------------------------------
1137 ; CHECK FOR UPDATE MODE
1138 ;--------------------------------------------------------------------------------
1140 !macro SetControlEnabled item_id enable
1141 FindWindow $0 "#32770" "" $HWNDPARENT
1143 GetDlgItem
$1 $0 ${item_id}
1144 EnableWindow
$1 ${enable}
1148 !macro SkipToNextPage
1149 GetDlgItem
$0 $HWNDPARENT 1
1150 System::Call "User32::PostMessage(i $HWNDPARENT, i ${WM_COMMAND}, i 1, i $R0)"
1153 !macro EnablePathEditable flag show_msg
1154 !insertmacro SetControlEnabled
1019 ${flag}
1155 !insertmacro SetControlEnabled
1001 ${flag}
1156 ${IfNot} $NotUpdateInstall =
${flag}
1157 !if ${show_msg} ==
1
1158 MessageBox MB_OK|MB_ICONINFORMATION
"$(MPLAYER_LANG_FORCE_UPDATE)" /SD
IDOK
1160 StrCpy $NotUpdateInstall ${flag}
1161 !insertmacro SkipToNextPage
1165 Function CheckForUpdate
1166 ${StdUtils
.TestParameter
} $0 "Update"
1167 ${If} "$0" ==
"true"
1168 !insertmacro EnablePathEditable
0 0
1172 ${If} ${FileExists} "$INSTDIR\MPlayer.exe"
1173 ${If} $NotUpdateInstall =
1
1174 ${AndIf} ${FileExists} "$INSTDIR\version.tag"
1175 ReadINIStr $0 "$INSTDIR\version.tag" "mplayer_version" "build_no"
1176 ${If} $0 > ${MPLAYER_BUILDNO}
1177 MessageBox MB_OK|
MB_ICONEXCLAMATION "$(MPLAYER_LANG_CAN_NOT_UPDATE)"
1180 ${If} $0 =
${MPLAYER_BUILDNO}
1181 ${IfCmd} MessageBox MB_YESNO|
MB_ICONEXCLAMATION "$(MPLAYER_LANG_CONFIRM_UPDATE)" /SD
IDYES IDNO ${||
} Quit ${|
}
1184 !insertmacro EnablePathEditable
0 1
1188 !insertmacro EnablePathEditable
1 0
1192 ;--------------------------------------------------------------------------------
1194 ;--------------------------------------------------------------------------------
1196 Function RunAppFunction
1197 !insertmacro DisableNextButton
$R0
1198 ${If} ${FileExists} "$INSTDIR\SMPlayer.exe"
1199 ${StdUtils
.ExecShellAsUser
} $R0 "$INSTDIR\SMPlayer.exe" "open" "https://www.youtube.com/watch?v=SkVqJ1SGeL0"
1201 ${StdUtils
.ExecShellAsUser
} $R0 "$INSTDIR\MPUI.exe" "open" "http://www.caminandes.com/download/03_caminandes_llamigos_1080p.mp4"
1205 Function ShowReadmeFunction
1206 !insertmacro DisableNextButton
$R0
1207 ${StdUtils
.ExecShellAsUser
} $R0 "$INSTDIR\Readme.html" "open" ""
1210 Function .onInstSuccess
1211 ${StdUtils
.ExecShellAsUser
} $R0 "$SMPROGRAMS\$StartMenuFolder" "explore" ""