1 ; ///////////////////////////////////////////////////////////////////////////////
2 ; // MPlayer for Windows - Install Script
3 ; // Copyright (C) 2004-2014 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 CreateWebLink "!insertmacro _CreateWebLink"
46 !macro _CreateWebLink ShortcutFile TargetURL
49 StrCpy $0 "${ShortcutFile}"
50 StrCpy $1 "${TargetURL}"
51 Call _Imp_CreateWebLink
56 Function _Imp_CreateWebLink
58 SetFileAttributes "$0" FILE_ATTRIBUTE_NORMAL
59 DeleteINISec "$0" "DEFAULT"
60 DeleteINISec "$0" "InternetShortcut"
61 WriteINIStr "$0" "DEFAULT" "BASEURL" "$1"
62 WriteINIStr "$0" "InternetShortcut" "ORIGURL" "$1"
63 WriteINIStr "$0" "InternetShortcut" "URL" "$1"
64 WriteINIStr "$0" "InternetShortcut" "IconFile" "$SYSDIR\SHELL32.dll"
65 WriteINIStr "$0" "InternetShortcut" "IconIndex" "150"
67 SetFileAttributes "$0" FILE_ATTRIBUTE_READONLY
70 !macro DisableNextButton TmpVar
71 GetDlgItem ${TmpVar} $HWNDPARENT 1
72 EnableWindow ${TmpVar} 0
75 ; ----------------------------------------------------------------------------
77 !define PackAll "!insertmacro _PackAll"
79 !macro _PackAll path filter
92 FindFirst $1 $2 "$0\$1"
95 DetailPrint "$(MPLAYER_LANG_COMPRESSING): $2"
96 NsExec::Exec '"$PLUGINSDIR\UPX.exe" --compress-icons=0 "$0\$2"'
105 ; ----------------------------------------------------------------------------
107 !define MakeFilePublic "!insertmacro _MakeFilePublic"
109 !macro _MakeFilePublic filename
110 ${IfNot} ${FileExists} "${filename}"
112 FileOpen $R0 "${filename}" w
116 AccessControl::GrantOnFile "${filename}" "(S-1-1-0)" "FullAccess"
119 ; ----------------------------------------------------------------------------
121 !define GetVirtualStorePath "!insertmacro _GetVirtualStorePath"
123 !macro _GetVirtualStorePath out path
124 StrCpy ${out} '${path}' "" 3
125 StrCpy ${out} '$LOCALAPPDATA\VirtualStore\${out}'
128 ; ----------------------------------------------------------------------------
130 !define RegisterFileExtCapability "!insertmacro _RegisterFileExtCapability"
132 !macro _RegisterFileExtCapability ext
133 WriteRegStr HKLM "${MPlayerRegPath}\Capabilities\FileAssociations" ".${ext}" "MPlayerForWindowsV2.File"