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 ;--------------------------------------------------------------------------------
25 ;--------------------------------------------------------------------------------
27 !ifndef MPLAYER_BUILDNO
28 !error "MPLAYER_BUILDNO is not defined !!!"
32 !error "MPLAYER_DATE is not defined !!!"
35 !ifndef MPLAYER_OUTFILE
36 !error "MPLAYER_OUTPUT_FILE is not defined !!!"
39 !ifndef MPLAYER_SRCFILE
40 !error "MPLAYER_SOURCE_FILE is not defined !!!"
44 !error "UPX_PATH is not defined !!!"
48 !define MyWebSite
"http://mulder.at.gg/"
51 !define TempFileName
"$PLUGINSDIR\MPUI-Installer-r${MPLAYER_BUILDNO}.exe"
54 ;--------------------------------------------------------------------------------
56 ;--------------------------------------------------------------------------------
58 !include `LogicLib.nsh`
59 !include `StdUtils.nsh`
62 ;--------------------------------------------------------------------------------
63 ; INSTALLER ATTRIBUTES
64 ;--------------------------------------------------------------------------------
67 RequestExecutionLevel user
68 InstallColors /windows
70 Name "MPlayer for Windows ${MPLAYER_DATE} (Build #${MPLAYER_BUILDNO})"
71 Caption "MPlayer for Windows ${MPLAYER_DATE} (Build #${MPLAYER_BUILDNO})"
72 BrandingText "MPlayer-Win32 (Build #${MPLAYER_BUILDNO})"
73 Icon "${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico"
74 ChangeUI all
"${NSISDIR}\Contrib\UIs\sdbarker_tiny.exe"
75 OutFile "${MPLAYER_OUTFILE}"
79 ShowInstDetails nevershow
82 ;--------------------------------
84 ;--------------------------------
93 ;--------------------------------------------------------------------------------
95 ;--------------------------------------------------------------------------------
97 !packhdr "$%TEMP%\exehead.tmp" '"${UPX_PATH}\upx.exe" --brute "$%TEMP%\exehead.tmp"'
100 ;--------------------------------------------------------------------------------
102 ;--------------------------------------------------------------------------------
104 ReserveFile
"${NSISDIR}\Plugins\Banner.dll"
105 ReserveFile
"${NSISDIR}\Plugins\LangDLL.dll"
106 ReserveFile
"${NSISDIR}\Plugins\LockedList.dll"
107 ReserveFile
"${NSISDIR}\Plugins\nsDialogs.dll"
108 ReserveFile
"${NSISDIR}\Plugins\nsExec.dll"
109 ReserveFile
"${NSISDIR}\Plugins\StdUtils.dll"
110 ReserveFile
"${NSISDIR}\Plugins\System.dll"
111 ReserveFile
"${NSISDIR}\Plugins\UserInfo.dll"
114 ;--------------------------------------------------------------------------------
116 ;--------------------------------------------------------------------------------
118 !searchreplace PRODUCT_VERSION_DATE
"${MPLAYER_DATE}" "-" "."
119 VIProductVersion
"${PRODUCT_VERSION_DATE}.${MPLAYER_BUILDNO}"
121 VIAddVersionKey
"Author" "LoRd_MuldeR <mulder2@gmx.de>"
122 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."
123 VIAddVersionKey
"CompanyName" "Free Software Foundation"
124 VIAddVersionKey
"FileDescription" "MPlayer for Windows (Build #${MPLAYER_BUILDNO})"
125 VIAddVersionKey
"FileVersion" "${PRODUCT_VERSION_DATE}.${MPLAYER_BUILDNO}"
126 VIAddVersionKey
"LegalCopyright" "Copyright 2000-2018 The MPlayer Project"
127 VIAddVersionKey
"LegalTrademarks" "GNU"
128 VIAddVersionKey
"OriginalFilename" "MPUI-Setup.exe"
129 VIAddVersionKey
"ProductName" "MPlayer for Windows"
130 VIAddVersionKey
"ProductVersion" "Build #${MPLAYER_BUILDNO} (${MPLAYER_DATE})"
131 VIAddVersionKey
"Website" "${MPlayerWebSite}"
134 ;--------------------------------
135 ;Installer initialization
136 ;--------------------------------
138 Section "-LaunchTheInstaller"
139 SetDetailsPrint textonly
140 DetailPrint "Launching installer, please stay tuned..."
141 SetDetailsPrint listonly
144 SetOutPath "$PLUGINSDIR"
147 File "/oname=${TempFileName}" "${MPLAYER_SRCFILE}"
151 ${StdUtils
.GetAllParameters
} $R9 0
152 ${IfThen} "$R9" ==
"too_long" ${|
} StrCpy $R9 "" ${|
}
155 DetailPrint "Parameters: $R9"
162 File "/oname=${TempFileName}" "${MPLAYER_SRCFILE}"
164 DetailPrint "ExecShellWait: ${TempFileName}"
165 ${StdUtils
.ExecShellWaitEx
} $R1 $R2 "${TempFileName}" "open" '$R9'
166 DetailPrint "Result: $R1 ($R2)"
168 ${IfThen} $R1 ==
"no_wait" ${|
} Goto SetupCompleted
${|
}
173 ${StdUtils
.WaitForProcEx
} $R1 $R2
177 MessageBox MB_RETRYCANCEL|
MB_ICONSTOP|
MB_TOPMOST "Failed to launch the installer. Please try again!" IDCANCEL FallbackMode
185 File "/oname=${TempFileName}" "${MPLAYER_SRCFILE}"
188 ExecShell "open" "${TempFileName}" '$R9' SW_SHOWNORMAL
189 IfErrors 0 SetupCompleted
192 ExecShell "" "${TempFileName}" '$R9' SW_SHOWNORMAL
193 IfErrors 0 SetupCompleted
198 DetailPrint "Failed to launch installer :-("
199 SetDetailsPrint listonly
208 Delete "${TempFileName}"
212 Delete /REBOOTOK
"${TempFileName}"