1 ; ///////////////////////////////////////////////////////////////////////////////
2 ; // MPlayer for Windows - Install Script
3 ; // Copyright (C) 2004-2024 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 !define PrintProgress "!insertmacro _PrintProgress"
24 !define PrintStatus "!insertmacro _PrintStatus"
26 !macro _PrintProgress Text
27 SetDetailsPrint textonly
28 DetailPrint '${Text}, $(MPLAYER_LANG_STATUS_WAIT)...'
29 SetDetailsPrint listonly
30 DetailPrint '--- ${Text} ---'
34 !macro _PrintStatus Text
35 SetDetailsPrint textonly
36 DetailPrint '${Text}.'
37 SetDetailsPrint listonly
38 DetailPrint '--- ${Text} ---'
42 ; ----------------------------------------------------------------------------
44 !define ExtractSubDir "!insertmacro _ExtractSubDir"
46 !macro _ExtractSubDir BaseDir SubDir
47 SetOutPath "$INSTDIR\${SubDir}"
48 File /r "${BaseDir}\${SubDir}\*.*"
51 ; ----------------------------------------------------------------------------
53 !define CreateWebLink "!insertmacro _CreateWebLink"
55 !macro _CreateWebLink ShortcutFile TargetURL
58 StrCpy $0 "${ShortcutFile}"
59 StrCpy $1 "${TargetURL}"
60 Call _Imp_CreateWebLink
65 Function _Imp_CreateWebLink
67 SetFileAttributes "$0" FILE_ATTRIBUTE_NORMAL
68 DeleteINISec "$0" "DEFAULT"
69 DeleteINISec "$0" "InternetShortcut"
70 WriteINIStr "$0" "DEFAULT" "BASEURL" "$1"
71 WriteINIStr "$0" "InternetShortcut" "ORIGURL" "$1"
72 WriteINIStr "$0" "InternetShortcut" "URL" "$1"
73 WriteINIStr "$0" "InternetShortcut" "IconFile" "$SYSDIR\SHELL32.dll"
74 WriteINIStr "$0" "InternetShortcut" "IconIndex" "150"
76 SetFileAttributes "$0" FILE_ATTRIBUTE_READONLY
79 !macro DisableNextButton TmpVar
80 GetDlgItem ${TmpVar} $HWNDPARENT 1
81 EnableWindow ${TmpVar} 0
84 ; ----------------------------------------------------------------------------
86 !define PackAll "!insertmacro _PackAll"
88 !macro _PackAll path filter
101 FindFirst $1 $2 "$0\$1"
105 ${IfNot} "$2" == "Uninstall.exe"
106 ${AndIfNot} "$2" == "Updater.exe"
107 DetailPrint "$(MPLAYER_LANG_COMPRESSING): $2"
108 NsExec::Exec '"$PLUGINSDIR\UPX.exe" --compress-icons=0 "$0\$2"'
120 ; ----------------------------------------------------------------------------
122 !define MakeFilePublic "!insertmacro _MakeFilePublic"
123 !define MakePathPublic "!insertmacro _MakePathPublic"
125 !macro _MakeFilePublic filename
126 ${IfNot} ${FileExists} "${filename}"
128 FileOpen $R0 "${filename}" w
132 AccessControl::GrantOnFile "${filename}" "(BU)" "FullAccess"
135 !macro _MakePathPublic path
136 AccessControl::GrantOnFile "${path}" "(BU)" "GenericRead + GenericWrite"
139 ; ----------------------------------------------------------------------------
141 !define GetVirtualStorePath "!insertmacro _GetVirtualStorePath"
143 !macro _GetVirtualStorePath out path
144 StrCpy ${out} '${path}' "" 3
145 StrCpy ${out} '$LOCALAPPDATA\VirtualStore\${out}'
148 ; ----------------------------------------------------------------------------
150 !define RegisterFileExtCapability "!insertmacro _RegisterFileExtCapability"
152 !macro _RegisterFileExtCapability ext
153 WriteRegStr HKLM "${MPlayerRegPath}\Capabilities\FileAssociations" ".${ext}" "MPlayerForWindowsV2.File"