1 ; ///////////////////////////////////////////////////////////////////////////////
2 ; // MPlayer for Windows - Install Script
3 ; // Copyright (C) 2004-2013 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}"
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-2013 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"
145 File "/oname=${TempFileName}" "${MPLAYER_SRCFILE}"
149 ${StdUtils
.GetAllParameters
} $R9 0
150 ${IfThen} "$R9" ==
"too_long" ${|
} StrCpy $R9 "" ${|
}
153 DetailPrint "Parameters: $R9"
159 DetailPrint "ExecShellWait: ${TempFileName}"
160 ${StdUtils
.ExecShellWait
} $R1 "${TempFileName}" "open" '$R9'
161 DetailPrint "Result: $R1"
163 ${IfThen} $R1 ==
"no_wait" ${|
} Goto SetupCompleted
${|
}
168 ${StdUtils
.WaitForProc
} $R1
172 MessageBox MB_RETRYCANCEL|
MB_ICONSTOP|
MB_TOPMOST "Failed to launch the installer. Please try again!" IDCANCEL FallbackMode
180 ExecShell "open" "${TempFileName}" '$R9' SW_SHOWNORMAL
181 IfErrors 0 SetupCompleted
184 ExecShell "" "${TempFileName}" '$R9' SW_SHOWNORMAL
185 IfErrors 0 SetupCompleted
190 DetailPrint "Failed to launch installer :-("
191 SetDetailsPrint listonly
200 Delete "${TempFileName}"
204 Delete /REBOOTOK
"${TempFileName}"