1 ; ///////////////////////////////////////////////////////////////////////////////
2 ; // LameXP - Audio Encoder Front-End
3 ; // Copyright (C) 2004-2012 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 ; ///////////////////////////////////////////////////////////////////////////////
22 ;--------------------------------
24 ;--------------------------------
26 !ifndef LAMEXP_VERSION
27 !error "LAMEXP_VERSION is not defined !!!"
30 !error "LAMEXP_BUILD is not defined !!!"
32 !ifndef LAMEXP_INSTTYPE
33 !error "LAMEXP_INSTTYPE is not defined !!!"
36 !error "LAMEXP_PATCH is not defined !!!"
39 !error "LAMEXP_DATE is not defined !!!"
41 !ifndef LAMEXP_OUTPUT_FILE
42 !error "LAMEXP_OUTPUT_FILE is not defined !!!"
44 !ifndef LAMEXP_SOURCE_FILE
45 !error "LAMEXP_SOURCE_FILE is not defined !!!"
47 !ifndef LAMEXP_UPX_PATH
48 !error "LAMEXP_UPX_PATH is not defined !!!"
52 !define MyWebSite "http://mulder.at.gg/"
55 !define InstallerFileName "$PLUGINSDIR\LameXP-SETUP-r${LAMEXP_BUILD}.exe"
57 ;--------------------------------
59 ;--------------------------------
61 !include `LogicLib.nsh`
62 !include `StdUtils.nsh`
65 ;--------------------------------
67 ;--------------------------------
70 RequestExecutionLevel user
71 InstallColors /windows
72 Name "LameXP v${LAMEXP_VERSION} ${LAMEXP_INSTTYPE}-${LAMEXP_PATCH} [Build #${LAMEXP_BUILD}]"
73 OutFile "${LAMEXP_OUTPUT_FILE}"
74 BrandingText "${LAMEXP_DATE} / Build #${LAMEXP_BUILD}"
75 Icon "${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico"
76 ChangeUI all "${NSISDIR}\Contrib\UIs\sdbarker_tiny.exe"
82 ;--------------------------------
84 ;--------------------------------
93 ;--------------------------------
95 ;--------------------------------
97 !packhdr "$%TEMP%\exehead.tmp" '"${LAMEXP_UPX_PATH}\upx.exe" --brute "$%TEMP%\exehead.tmp"'
100 ;--------------------------------
102 ;--------------------------------
104 ReserveFile "${NSISDIR}\Plugins\System.dll"
105 ReserveFile "${NSISDIR}\Plugins\StdUtils.dll"
108 ;--------------------------------
110 ;--------------------------------
112 !searchreplace PRODUCT_VERSION_DATE "${LAMEXP_DATE}" "-" "."
113 VIProductVersion "${PRODUCT_VERSION_DATE}.${LAMEXP_BUILD}"
115 VIAddVersionKey "Author" "LoRd_MuldeR <mulder2@gmx.de>"
116 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."
117 VIAddVersionKey "CompanyName" "Free Software Foundation"
118 VIAddVersionKey "FileDescription" "LameXP v${LAMEXP_VERSION} ${LAMEXP_INSTTYPE}-${LAMEXP_PATCH} [Build #${LAMEXP_BUILD}]"
119 VIAddVersionKey "FileVersion" "${PRODUCT_VERSION_DATE}.${LAMEXP_BUILD} (${LAMEXP_VERSION})"
120 VIAddVersionKey "LegalCopyright" "Copyright 2004-2012 LoRd_MuldeR"
121 VIAddVersionKey "LegalTrademarks" "GNU"
122 VIAddVersionKey "OriginalFilename" "LameXP.${LAMEXP_DATE}.Build-${LAMEXP_BUILD}.exe"
123 VIAddVersionKey "ProductName" "LameXP - Audio Encoder Frontend"
124 VIAddVersionKey "ProductVersion" "${LAMEXP_VERSION}, Build #${LAMEXP_BUILD} (${LAMEXP_DATE})"
125 VIAddVersionKey "Website" "${MyWebSite}"
128 ;--------------------------------
129 ;Installer initialization
130 ;--------------------------------
132 Section "-LaunchTheInstaller"
133 SetDetailsPrint textonly
134 DetailPrint "Launching installer, please stay tuned..."
135 SetDetailsPrint listonly
138 SetOutPath "$PLUGINSDIR"
141 File "/oname=${InstallerFileName}" "${LAMEXP_SOURCE_FILE}"
145 ${If} "$EXEFILE" == "LameXP.exe"
146 ${OrIf} "$EXEFILE" == "LameXP-Portable.exe"
147 MessageBox MB_ICONSTOP|MB_TOPMOST "Sorry, you must NOT rename the LameXP installation program to 'LameXP.exe' or 'LameXP-Portable.exe'. Please re-rename the installer executable file (e.g. to 'LameXP-Setup.exe') and then try again!"
153 ${StdUtils.GetAllParameters} $R9 0
154 ${IfThen} "$R9" == "too_long" ${|} StrCpy $R9 "" ${|}
157 DetailPrint "Parameters: $R9"
164 File "/oname=${InstallerFileName}" "${LAMEXP_SOURCE_FILE}"
166 DetailPrint "ExecShellWait: ${InstallerFileName}"
167 ${StdUtils.ExecShellWaitEx} $R1 $R2 "${InstallerFileName}" "open" '$R9'
168 DetailPrint "Result: $R1 ($R2)"
170 ${IfThen} $R1 == "no_wait" ${|} Goto RunSuccess ${|}
175 ${StdUtils.WaitForProcEx} $R1 $R2
179 MessageBox MB_RETRYCANCEL|MB_ICONSTOP|MB_TOPMOST "Failed to launch the installer. Please try again!" IDCANCEL FallbackMode
187 DetailPrint "Installer not launched yet, trying fallback mode!"
190 File "/oname=${InstallerFileName}" "${LAMEXP_SOURCE_FILE}"
193 ExecShell "open" "${InstallerFileName}" '$R9' SW_SHOWNORMAL
194 IfErrors 0 RunSuccess
197 ExecShell "" "${InstallerFileName}" '$R9' SW_SHOWNORMAL
198 IfErrors 0 RunSuccess
203 DetailPrint "Failed to launch installer :-("
204 SetDetailsPrint listonly
213 Delete /REBOOTOK "${InstallerFileName}"