blob: d91e7cb5798a8fcc63bc3e3b1119b6b670a90748 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
|
!define WMFDIST "Windows Media Format"
; ToDo
; Win7 package (wmfdist11): http://www.microsoft.com/en-us/download/details.aspx?id=16546
; Win8 package (wmfdist12): http://www.microsoft.com/en-us/download/details.aspx?id=30685
Function WMF_Download
Call GetWMFLink
Exch $0
${If} $0 != ""
DetailPrint "$(IDS_RUN_DOWNLOAD) ${WMFDIST}..."
NSISdl::download /TRANSLATE2 "$(IDS_RUN_DOWNLOAD) ${WMFDIST}..." "$(IDS_CONNECTING)" "$(IDS_SECOND)" "$(IDS_MINUTE)" "$(IDS_HOUR)" "$(IDS_SECONDS)" "$(IDS_MINUTES)" "$(IDS_HOURS)" "$(IDS_PROGRESS)" /TIMEOUT=30000 "$0" "$PLUGINSDIR\wmfdist.exe"
Pop $0 ; Get the return value
${If} $0 == "success"
DetailPrint "$(IDS_RUN_DOWNLOADSUCCESS)"
${ElseIf} $0 == "cancel"
DetailPrint "$(IDS_RUN_DOWNLOADCANCELLED)"
${Else}
DetailPrint "$(IDS_RUN_DOWNLOADFAILED) $R0"
${EndIf}
${EndIf}
Pop $0
FunctionEnd
Function WMF_Install
ClearErrors
IfFileExists "$PLUGINSDIR\wmfdist.exe" 0 wmf_install_end
DetailPrint "$(IDS_RUN_INSTALL) ${WMFDIST}..."
SetDetailsPrint none
ExecWait '$PLUGINSDIR\wmfdist.exe /Q:A' $0
SetDetailsPrint lastused
${If} ${Errors}
StrCpy $1 "1"
${Else}
ReadRegDWORD $0 HKCU "Software\Microsoft\MediaPlayer\Setup" InstallResult
IntOp $1 $0 & 0x80000000
${If} $0 = 0xd2af9
SetRebootFlag true
${EndIf}
${EndIf}
${If} $1 = "1"
DetailPrint "$(IDS_RUN_INSTALLFIALED)"
${Else}
DetailPrint "$(IDS_RUN_DONE)"
${EndIf}
wmf_install_end:
FunctionEnd
Function WMF_NeedDownload
DetailPrint "$(IDS_RUN_EXTRACT) ${WMFDIST}..."
SetDetailsPrint none
${FileIfExist} "$PLUGINSDIR\wmfdist.exe" "..\..\resources\bundles\wmfdist\wmfdist.exe"
SetDetailsPrint lastused
${Unless} ${FileExists} "$PLUGINSDIR\${WMFDIST}"
DetailPrint "$(IDS_RUN_FILE_NOT_FOUND_SCHEDULE_DOWNLOAD)"
Call GetWMFLink
Exch $0
${If} $0 != ""
StrCpy $0 "1"
${Else}
StrCpy $0 "0"
${EndIF}
Exch $0
${Else}
DetailPrint "$(IDS_RUN_DONE)"
Push "0"
${EndUnless}
FunctionEnd
;------------------------
; return link to the wmf distributives or '' (empty string) if you don't need to download
;------------------------
Function GetWMFLink
Push $0
Push $R0
Push $R1
Push $R2
Push $R3
Push $R4
Push $R5
; check if wma/wmv selected
${IfNot} ${SectionIsSelected} ${IDX_SEC_WMA_DEC}
!ifdef IDX_SEC_WMV_DEC
${AndIfNot} ${SectionIsSelected} ${IDX_SEC_WMV_DEC}
!endif
!ifdef IDX_SEC_WMA_ENC
${AndIfNot} ${SectionIsSelected} ${IDX_SEC_WMA_ENC}
!endif
Goto no_download
${EndIf}
GetDllVersion "$SYSDIR\wmvcore.dll" $R0 $R1
IntOp $R2 $R0 / 0x00010000
IntOp $R3 $R0 & 0x0000FFFF
IntOp $R4 $R1 / 0x00010000
IntOp $R5 $R1 & 0x0000FFFF
; StrCpy $1 "$R2.$R3.$R4.$R5"
; StrCmp $WinVer "ME" wmf90_link
; TODO check this out!
/*StrCmp $WinVer "NT" wmf90_link
StrCmp $WinVer "2000" wmf90_link
StrCmp $WinVer "XP" wmf95_link
StrCmp $WinVer "2003" wmf95_link*/
Goto no_download
;wmf95_link:
IntCmp $R2 10 +1 copy_link1 no_download
IntCmp $R3 0 +1 copy_link1 no_download
IntCmp $R4 0 +1 copy_link1 no_download
IntCmp $R5 2802 no_download copy_link1 no_download
copy_link1:
StrCpy $0 https://download.nullsoft.com/redist/wm/wmfdist95.exe
Goto function_end
;wmf90_link:
IntCmp $R2 9 +1 copy_link2 no_download
IntCmp $R3 0 +1 copy_link2 no_download
IntCmp $R4 0 +1 copy_link2 no_download
IntCmp $R5 3287 no_download copy_link2 no_download
copy_link2:
StrCpy $0 https://download.nullsoft.com/redist/wm/wmfdist9.exe
Goto function_end
no_download:
StrCpy $0 ''
goto function_end
function_end:
Pop $R5
Pop $R4
Pop $R3
Pop $R2
Pop $R1
Pop $R0
Exch $0
FunctionEnd
|