1 ; ///////////////////////////////////////////////////////////////////////////////
2 ; // LameXP - Audio Encoder Front-End
3 ; // Copyright (C) 2004-2010 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 RequestExecutionLevel user
23 BrandingText `Date created: ${LAMEXP_DATE}`
26 !define ZIP2EXE_NAME `LameXP v${LAMEXP_VERSION} ${LAMEXP_SUFFIX} [Build #${LAMEXP_BUILD}]`
27 !define ZIP2EXE_OUTFILE `${LAMEXP_OUTPUT_FILE}`
28 !define ZIP2EXE_COMPRESSOR_LZMA
29 !define ZIP2EXE_COMPRESSOR_SOLID
30 !define ZIP2EXE_INSTALLDIR `$PROGRAMFILES\${ZIP2EXE_NAME}`
32 !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico"
33 !define MUI_WELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\orange.bmp"
34 !define MUI_HEADERIMAGE
35 !define MUI_HEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\orange.bmp"
36 !define MUI_PAGE_CUSTOMFUNCTION_SHOW CheckForUpdate
38 VIAddVersionKey /LANG=${LANG_ENGLISH} "Author" "LoRd_MuldeR <mulder2@gmx.de>"
39 VIAddVersionKey /LANG=${LANG_ENGLISH} "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."
40 VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "Free Software Foundation"
41 VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "LameXP v${LAMEXP_VERSION} ${LAMEXP_SUFFIX} [Build #${LAMEXP_BUILD}]"
42 VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${LAMEXP_DATE}.${LAMEXP_BUILD} (${LAMEXP_VERSION})"
43 VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "Copyright 2004-2010 LoRd_MuldeR"
44 VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalTrademarks" "GNU"
45 VIAddVersionKey /LANG=${LANG_ENGLISH} "OriginalFilename" "LameXP.${LAMEXP_DATE}.exe"
46 VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "LameXP - Audio Encoder Frontend"
47 VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductVersion" "${LAMEXP_VERSION}, Build #${LAMEXP_BUILD} (${LAMEXP_DATE})"
48 VIAddVersionKey /LANG=${LANG_ENGLISH} "Website" "http://mulder.at.gg/"
51 !include `parameters.nsh`
52 !include `${NSISDIR}\Contrib\zip2exe\Base.nsh`
53 !include `${NSISDIR}\Contrib\zip2exe\Modern.nsh`
57 !insertmacro UAC_RunElevated
60 ${IfThen} $1 = 1 ${|} Quit ${|}
61 ${IfThen} $3 <> 0 ${|} ${Break} ${|}
63 MessageBox MB_ICONEXCLAMATION|MB_TOPMOST|MB_SETFOREGROUND|MB_OKCANCEL "This installer requires admin access, please try again!" /SD IDCANCEL IDOK UAC_TryAgain
66 MessageBox MB_ICONEXCLAMATION|MB_TOPMOST|MB_SETFOREGROUND|MB_OKCANCEL "This installer requires admin privileges, please try again!" /SD IDCANCEL IDOK UAC_TryAgain
69 MessageBox MB_ICONSTOP|MB_TOPMOST|MB_SETFOREGROUND "Logon service not running, aborting!"
72 MessageBox MB_ICONSTOP|MB_TOPMOST|MB_SETFOREGROUND "Unable to elevate installer! (Error code: $0)"
77 Function .onInstSuccess
78 !insertmacro UAC_AsUser_Call Function LaunchApplication ${UAC_SYNCINSTDIR}
81 !insertmacro SECTION_BEGIN
82 File /r `${LAMEXP_SOURCE_PATH}\*.*`
83 !insertmacro SECTION_END
85 Function CheckForUpdate
86 !insertmacro GetCommandlineParameter "Update" "error" $R0
87 StrCmp $R0 "error" 0 +2
90 FindWindow $R0 "#32770" "" $HWNDPARENT
91 GetDlgItem $R1 $R0 1019
92 SendMessage $R1 ${EM_SETREADONLY} 1 0
94 FindWindow $R0 "#32770" "" $HWNDPARENT
95 GetDlgItem $R1 $R0 1001
98 GetDlgItem $R1 $HWNDPARENT 1
99 SendMessage $R1 ${WM_SETTEXT} 0 "STR:Update"
102 Function LaunchApplication
103 ExecShell "explore" "$INSTDIR"
104 Exec '"$INSTDIR\LameXP.exe"'