1 ; ///////////////////////////////////////////////////////////////////////////////
2 ; // LameXP - Audio Encoder Front-End
3 ; // Copyright (C) 2004-2016 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 ;--------------------------------
28 !error "NSIS_UNICODE is undefined, please compile with Unicode NSIS !!!"
31 !ifndef LAMEXP_VERSION
32 !error "LAMEXP_VERSION is not defined !!!"
35 !error "LAMEXP_BUILD is not defined !!!"
37 !ifndef LAMEXP_INSTTYPE
38 !error "LAMEXP_INSTTYPE is not defined !!!"
41 !error "LAMEXP_PATCH is not defined !!!"
44 !error "LAMEXP_DATE is not defined !!!"
46 !ifndef LAMEXP_OUTPUT_FILE
47 !error "LAMEXP_OUTPUT_FILE is not defined !!!"
49 !ifndef LAMEXP_SOURCE_PATH
50 !error "LAMEXP_SOURCE_PATH is not defined !!!"
52 !ifndef LAMEXP_UPX_PATH
53 !error "LAMEXP_UPX_PATH is not defined !!!"
57 !define MyRegPath
"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{FBD7A67D-D700-4043-B54F-DD106D00F308}"
60 !define AppPaths
"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths"
63 !define MyWebSite
"http://muldersoft.com/"
66 ;--------------------------------
67 ;Check for Pre-Release
68 ;--------------------------------
70 !define LAMEXP_IS_PRERELEASE
72 !if '${LAMEXP_INSTTYPE}' ==
'Final'
73 !undef LAMEXP_IS_PRERELEASE
75 !if '${LAMEXP_INSTTYPE}' ==
'Hotfix'
76 !undef LAMEXP_IS_PRERELEASE
80 ;--------------------------------
82 ;--------------------------------
85 !packhdr "${PACKHDRTEMP}" '"..\Utilities\MT.exe" -manifest "setup.manifest" -outputresource:"${PACKHDRTEMP};1"'
88 ;--------------------------------
90 ;--------------------------------
95 !include `StdUtils.nsh`
98 ;--------------------------------
100 ;--------------------------------
102 RequestExecutionLevel admin
104 ShowUninstDetails show
105 Name "LameXP v${LAMEXP_VERSION} ${LAMEXP_INSTTYPE}-${LAMEXP_PATCH} [Build #${LAMEXP_BUILD}]"
106 OutFile "${LAMEXP_OUTPUT_FILE}"
107 BrandingText "Date created: ${LAMEXP_DATE} [Build #${LAMEXP_BUILD}]"
108 InstallDir "$PROGRAMFILES\MuldeR\LameXP v${LAMEXP_VERSION}"
109 InstallDirRegKey HKLM "${MyRegPath}" "InstallLocation"
112 ;--------------------------------
114 ;--------------------------------
116 SetCompressor
/SOLID LZMA
117 SetCompressorDictSize
64
119 #!packhdr "$%TEMP%\exehead.tmp" '"${LAMEXP_UPX_PATH}\upx.exe" --brute "$%TEMP%\exehead.tmp"'
122 ;--------------------------------
124 ;--------------------------------
126 ReserveFile
"${NSISDIR}\Plugins\Aero.dll"
127 ReserveFile
"${NSISDIR}\Plugins\LangDLL.dll"
128 ReserveFile
"${NSISDIR}\Plugins\LockedList.dll"
129 ReserveFile
"${NSISDIR}\Plugins\LockedList64.dll"
130 ReserveFile
"${NSISDIR}\Plugins\nsDialogs.dll"
131 ReserveFile
"${NSISDIR}\Plugins\nsExec.dll"
132 ReserveFile
"${NSISDIR}\Plugins\StartMenu.dll"
133 ReserveFile
"${NSISDIR}\Plugins\StdUtils.dll"
134 ReserveFile
"${NSISDIR}\Plugins\System.dll"
135 ReserveFile
"${NSISDIR}\Plugins\UserInfo.dll"
138 ;--------------------------------
140 ;--------------------------------
145 ;--------------------------------
147 ;--------------------------------
149 !searchreplace PRODUCT_VERSION_DATE
"${LAMEXP_DATE}" "-" "."
150 VIProductVersion
"${PRODUCT_VERSION_DATE}.${LAMEXP_BUILD}"
152 VIAddVersionKey
"Author" "LoRd_MuldeR <mulder2@gmx.de>"
153 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."
154 VIAddVersionKey
"CompanyName" "Free Software Foundation"
155 VIAddVersionKey
"FileDescription" "LameXP v${LAMEXP_VERSION} ${LAMEXP_INSTTYPE}-${LAMEXP_PATCH} [Build #${LAMEXP_BUILD}]"
156 VIAddVersionKey
"FileVersion" "${PRODUCT_VERSION_DATE}.${LAMEXP_BUILD} (${LAMEXP_VERSION})"
157 VIAddVersionKey
"LegalCopyright" "Copyright 2004-2016 LoRd_MuldeR"
158 VIAddVersionKey
"LegalTrademarks" "GNU"
159 VIAddVersionKey
"OriginalFilename" "LameXP.${LAMEXP_DATE}.exe"
160 VIAddVersionKey
"ProductName" "LameXP - Audio Encoder Frontend"
161 VIAddVersionKey
"ProductVersion" "${LAMEXP_VERSION}, Build #${LAMEXP_BUILD} (${LAMEXP_DATE})"
162 VIAddVersionKey
"Website" "${MyWebSite}"
165 ;--------------------------------
166 ;MUI2 Interface Settings
167 ;--------------------------------
169 !define MUI_ABORTWARNING
170 !define MUI_STARTMENUPAGE_REGISTRY_ROOT
HKLM
171 !define MUI_STARTMENUPAGE_REGISTRY_KEY
"${MyRegPath}"
172 !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME
"StartmenuFolder"
173 !define MUI_LANGDLL_REGISTRY_ROOT
HKLM
174 !define MUI_LANGDLL_REGISTRY_KEY
"${MyRegPath}"
175 !define MUI_LANGDLL_REGISTRY_VALUENAME
"SetupLanguage"
176 !define MUI_STARTMENUPAGE_DEFAULTFOLDER
"LameXP v${LAMEXP_VERSION}"
177 !define MUI_FINISHPAGE_NOAUTOCLOSE
178 !define MUI_UNFINISHPAGE_NOAUTOCLOSE
179 !define MUI_FINISHPAGE_RUN
180 !define MUI_FINISHPAGE_RUN_FUNCTION RunAppFunction
181 !define MUI_FINISHPAGE_SHOWREADME
182 !define MUI_FINISHPAGE_SHOWREADME_FUNCTION ShowReadmeFunction
183 !define MUI_FINISHPAGE_LINK
${MyWebSite}
184 !define MUI_FINISHPAGE_LINK_LOCATION
${MyWebSite}
185 !define MUI_ICON
"${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico"
186 !define MUI_UNICON
"${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall.ico"
187 !define MUI_WELCOMEFINISHPAGE_BITMAP
"wizard.bmp"
188 !define MUI_UNWELCOMEFINISHPAGE_BITMAP
"wizard-un.bmp"
189 !define MUI_HEADERIMAGE
190 !define MUI_HEADERIMAGE_BITMAP
"header.bmp"
191 !define MUI_HEADERIMAGE_UNBITMAP
"header-un.bmp"
192 !define MUI_LANGDLL_ALLLANGUAGES
193 !define MUI_CUSTOMFUNCTION_GUIINIT MyGuiInit
194 !define MUI_CUSTOMFUNCTION_UNGUIINIT un
.MyGuiInit
195 !define MUI_LANGDLL_ALWAYSSHOW
198 ;--------------------------------
199 ;MUI2 Pages (Installer)
200 ;--------------------------------
203 !define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfUnattended
204 !define MUI_PAGE_CUSTOMFUNCTION_LEAVE CheckForPreRelease
205 !define MUI_WELCOMEPAGE_TITLE_3LINES
206 !define MUI_FINISHPAGE_TITLE_3LINES
207 !insertmacro MUI_PAGE_WELCOME
210 !define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfUnattended
211 !insertmacro MUI_PAGE_LICENSE
"license.rtf"
214 !define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfUnattended
215 !define MUI_PAGE_CUSTOMFUNCTION_SHOW CheckForUpdate
216 !insertmacro MUI_PAGE_DIRECTORY
219 !define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfUnattended
220 !insertmacro MUI_PAGE_STARTMENU Application
$StartMenuFolder
223 Page Custom LockedListShow
226 !insertmacro MUI_PAGE_INSTFILES
229 !define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfUnattended
230 !insertmacro MUI_PAGE_FINISH
233 ;--------------------------------
234 ;MUI2 Pages (Uninstaller)
235 ;--------------------------------
238 !define MUI_WELCOMEPAGE_TITLE_3LINES
239 !define MUI_FINISHPAGE_TITLE_3LINES
240 !define MUI_PAGE_CUSTOMFUNCTION_PRE un
.CheckForcedUninstall
241 !insertmacro MUI_UNPAGE_WELCOME
244 !define MUI_PAGE_CUSTOMFUNCTION_PRE un
.CheckForcedUninstall
245 !insertmacro MUI_UNPAGE_CONFIRM
248 UninstPage Custom un
.LockedListShow
251 !insertmacro MUI_UNPAGE_INSTFILES
254 !define MUI_PAGE_CUSTOMFUNCTION_PRE un
.CheckForcedUninstall
255 !insertmacro MUI_UNPAGE_FINISH
258 ;--------------------------------
260 ;--------------------------------
262 !insertmacro MUI_LANGUAGE
"English" ;first language is the default language
263 !insertmacro MUI_LANGUAGE
"German"
264 !insertmacro MUI_LANGUAGE
"Spanish"
265 !insertmacro MUI_LANGUAGE
"Russian"
266 !insertmacro MUI_LANGUAGE
"Ukrainian"
267 !insertmacro MUI_LANGUAGE
"Polish"
268 !insertmacro MUI_LANGUAGE
"Hungarian"
270 ; !insertmacro MUI_LANGUAGE "French"
271 ; !insertmacro MUI_LANGUAGE "SpanishInternational"
272 ; !insertmacro MUI_LANGUAGE "SimpChinese"
273 ; !insertmacro MUI_LANGUAGE "TradChinese"
274 ; !insertmacro MUI_LANGUAGE "Japanese"
275 ; !insertmacro MUI_LANGUAGE "Italian"
276 ; !insertmacro MUI_LANGUAGE "Dutch"
277 ; !insertmacro MUI_LANGUAGE "Greek"
278 ; !insertmacro MUI_LANGUAGE "Romanian"
279 ; !insertmacro MUI_LANGUAGE "Serbian"
280 ; !insertmacro MUI_LANGUAGE "SerbianLatin"
281 ; !insertmacro MUI_LANGUAGE "Arabic"
282 ; !insertmacro MUI_LANGUAGE "Portuguese"
283 ; !insertmacro MUI_LANGUAGE "Afrikaans"
284 ; !insertmacro MUI_LANGUAGE "Malay"
285 ; !insertmacro MUI_LANGUAGE "Indonesian"
288 ;--------------------------------
290 ;--------------------------------
293 !include "..\Translation\Blank.nsh"
296 !include "..\Translation\LameXP_DE.nsh"
299 !include "..\Translation\LameXP_ES.nsh"
302 !include "..\Translation\LameXP_RU.nsh"
305 !include "..\Translation\LameXP_UK.nsh"
308 !include "..\Translation\LameXP_PL.nsh"
311 !include "..\Translation\LameXP_HU.nsh"
314 ;--------------------------------
316 ;--------------------------------
318 !macro _UnattendedMode _a _b _t _f
319 !insertmacro _LOGICLIB_TEMP
320 ${StdUtils
.TestParameter
} $_LOGICLIB_TEMP "Update"
321 StrCmp "$_LOGICLIB_TEMP" "true" `${_t}` `${_f}`
323 !define UnattendedMode
`"" UnattendedMode ""`
325 !macro _ForcedMode _a _b _t _f
326 !insertmacro _LOGICLIB_TEMP
327 ${StdUtils
.TestParameter
} $_LOGICLIB_TEMP "Force"
328 StrCmp "$_LOGICLIB_TEMP" "true" `${_t}` `${_f}`
330 !define ForcedMode
`"" ForcedMode ""`
332 !macro _ValidFileName _a _b _t _f
333 !insertmacro _LOGICLIB_TEMP
334 ${StdUtils
.ValidFileName
} $_LOGICLIB_TEMP `${_b}`
335 StrCmp "$_LOGICLIB_TEMP" "ok" `${_t}` `${_f}`
337 !define ValidFileName
`"" ValidFileName`
340 ;--------------------------------
341 ;Installer initialization
342 ;--------------------------------
349 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "{2B3D1EBF-B3B6-4E93-92B9-6853029A7162}") i .r1 ?e'
352 MessageBox MB_ICONSTOP|
MB_TOPMOST "Sorry, the installer is already running!"
358 # Running on Windows NT family?
360 MessageBox MB_TOPMOST|
MB_ICONSTOP "Sorry, this application does *not* support Windows 9x or Windows ME!"
361 ExecShell "open" "http://windows.microsoft.com/"
365 # Running on Windows XP or later?
366 ${If} ${AtMostWin2000}
367 MessageBox MB_TOPMOST|
MB_ICONSTOP "Sorry, but your operating system is *not* supported anymore.$\nInstallation will be aborted!$\n$\nThe minimum required platform is Windows XP (Service Pack 3)."
368 ExecShell "open" "http://windows.microsoft.com/"
372 # If on Windows XP, is the required Service Pack installed?
374 ${IfNot} ${RunningX64} # Windows XP 32-Bit, requires Service Pack 3
375 ${AndIf} ${AtMostServicePack} 2
376 MessageBox MB_TOPMOST|
MB_ICONEXCLAMATION "This application requires Windows XP with Service Pack 3 installed!"
377 ${If} ${Cmd} `MessageBox MB_TOPMOST|MB_ICONQUESTION|MB_YESNO "Do you want to download Service Pack 3 for Windows XP now?" IDYES`
378 ExecShell "open" "http://www.microsoft.com/en-us/download/details.aspx?id=24"
380 ExecShell "open" "http://windowsupdate.microsoft.com/"
384 ${If} ${RunningX64} # Windows XP 64-Bit, requires Service Pack 2
385 ${AndIf} ${AtMostServicePack} 1
386 MessageBox MB_TOPMOST|
MB_ICONEXCLAMATION "This application requires Windows XP x64 Edition with Service Pack 2 installed!"
387 ${If} ${Cmd} `MessageBox MB_TOPMOST|MB_ICONQUESTION|MB_YESNO "Do you want to download Service Pack 2 for Windows XP x64 Edition now?" IDYES`
388 ExecShell "open" "http://www.microsoft.com/en-us/download/details.aspx?id=17791"
390 ExecShell "open" "http://windowsupdate.microsoft.com/"
398 ${IfNot} ${UnattendedMode}
399 !insertmacro MUI_LANGDLL_DISPLAY
404 UserInfo::GetAccountType
407 MessageBox MB_ICONSTOP|
MB_TOPMOST "Your system requires administrative permissions in order to install this software."
408 SetErrorLevel
740 ;ERROR_ELEVATION_REQUIRED
414 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "{2B3D1EBF-B3B6-4E93-92B9-6853029A7162}") i .r1 ?e'
417 MessageBox MB_ICONSTOP|
MB_TOPMOST "Sorry, the un-installer is already running!"
421 ${IfNot} ${ForcedMode}
422 !insertmacro MUI_LANGDLL_DISPLAY
427 UserInfo::GetAccountType
430 MessageBox MB_ICONSTOP|
MB_TOPMOST "Your system requires administrative permissions in order to install this software."
431 SetErrorLevel
740 ;ERROR_ELEVATION_REQUIRED
437 ;--------------------------------
439 ;--------------------------------
442 StrCpy $0 $HWNDPARENT
443 System::Call "user32::SetWindowPos(i r0, i -1, i 0, i 0, i 0, i 0, i 3)"
447 Function un
.MyGuiInit
448 StrCpy $0 $HWNDPARENT
449 System::Call "user32::SetWindowPos(i r0, i -1, i 0, i 0, i 0, i 0, i 3)"
454 ;--------------------------------
455 ;Macros & Auxiliary Functions
456 ;--------------------------------
458 !macro PrintProgress Text
459 SetDetailsPrint textonly
460 DetailPrint '${Text}'
461 SetDetailsPrint listonly
465 !macro CreateWebLink ShortcutFile TargetURL
468 StrCpy $0 "${ShortcutFile}"
469 StrCpy $1 "${TargetURL}"
475 Function _CreateWebLink
477 SetFileAttributes "$0" FILE_ATTRIBUTE_NORMAL
478 DeleteINISec "$0" "DEFAULT"
479 DeleteINISec "$0" "InternetShortcut"
480 WriteINIStr "$0" "DEFAULT" "BASEURL" "$1"
481 WriteINIStr "$0" "InternetShortcut" "ORIGURL" "$1"
482 WriteINIStr "$0" "InternetShortcut" "URL" "$1"
483 WriteINIStr "$0" "InternetShortcut" "IconFile" "$SYSDIR\SHELL32.dll"
484 WriteINIStr "$0" "InternetShortcut" "IconIndex" "150"
486 SetFileAttributes "$0" FILE_ATTRIBUTE_READONLY
489 !macro GetExecutableName OutVar
490 ${StdUtils
.GetParameter
} ${OutVar} "Update" ""
491 ${StdUtils
.TrimStr
} ${OutVar}
492 ${If} "${OutVar}" ==
""
493 ${OrIfNot} ${ValidFileName} "${OutVar}"
494 StrCpy ${OutVar} "LameXP.exe"
498 !macro DisableNextButton TmpVar
499 GetDlgItem
${TmpVar} $HWNDPARENT 1
500 EnableWindow
${TmpVar} 0
503 !macro DisableBackButton TmpVar
504 GetDlgItem
${TmpVar} $HWNDPARENT 3
505 EnableWindow
${TmpVar} 0
508 !macro CleanUpFiles options
509 Delete ${options} "$INSTDIR\Changelog.htm"
510 Delete ${options} "$INSTDIR\Changelog.html"
511 Delete ${options} "$INSTDIR\Contributors.txt"
512 Delete ${options} "$INSTDIR\Copying.txt"
513 Delete ${options} "$INSTDIR\FAQ.html"
514 Delete ${options} "$INSTDIR\Howto.html"
515 Delete ${options} "$INSTDIR\LameEnc.sys"
516 Delete ${options} "$INSTDIR\LameXP.exe"
517 Delete ${options} "$INSTDIR\LameXP.exe.sig"
518 Delete ${options} "$INSTDIR\LameXP-Portable.exe"
519 Delete ${options} "$INSTDIR\License.txt"
520 Delete ${options} "$INSTDIR\Manual.html"
521 Delete ${options} "$INSTDIR\Readme.htm"
522 Delete ${options} "$INSTDIR\ReadMe.txt"
523 Delete ${options} "$INSTDIR\PRE_RELEASE_INFO.txt"
524 Delete ${options} "$INSTDIR\Settings.cfg"
525 Delete ${options} "$INSTDIR\Translate.html"
526 Delete ${options} "$INSTDIR\Uninstall.exe"
527 Delete ${options} "$INSTDIR\Qt*.dll"
528 Delete ${options} "$INSTDIR\MUtils*.dll"
529 Delete ${options} "$INSTDIR\msvcr*.dll"
530 Delete ${options} "$INSTDIR\msvcp*.dll"
531 Delete ${options} "$INSTDIR\concrt*.dll"
532 Delete ${options} "$INSTDIR\vcruntime*.dll"
533 Delete ${options} "$INSTDIR\vccorlib*.dll"
534 Delete ${options} "$INSTDIR\api-ms-*.dll"
535 Delete ${options} "$INSTDIR\ucrtbase.dll"
537 RMDir /r
${options} "$INSTDIR\cache"
538 RMDir /r
${options} "$INSTDIR\img"
539 RMDir /r
${options} "$INSTDIR\imageformats"
540 RMDir /r
${options} "$INSTDIR\redist"
543 ;--------------------------------
545 ;--------------------------------
548 SetShellVarContext all
549 SetOutPath "$INSTDIR"
552 Section "-Clean Up Old Cruft"
553 !insertmacro PrintProgress
"$(LAMEXP_LANG_STATUS_CLEANUP)"
554 !insertmacro CleanUpFiles
""
557 Section "!Install Files"
558 !insertmacro PrintProgress
"$(LAMEXP_LANG_STATUS_INSTFILES)"
561 !insertmacro GetExecutableName
$R0
563 Delete "$INSTDIR\$R0"
566 MessageBox MB_TOPMOST|
MB_ICONSTOP|
MB_RETRYCANCEL 'Could not delete old "$R0" file. Is LameXP still running?' IDRETRY DeleteOldBinary
567 Abort "Could not delete old binary!"
570 File /a
`/oname=$R0` `${LAMEXP_SOURCE_PATH}\LameXP.exe`
571 File /nonfatal
/a
/r
`${LAMEXP_SOURCE_PATH}\*.dll`
573 File /a
/r
`${LAMEXP_SOURCE_PATH}\*.txt`
574 File /a
/r
`${LAMEXP_SOURCE_PATH}\*.html`
575 File /a
/r
`${LAMEXP_SOURCE_PATH}\*.png`
578 # Section "-Install VCRedist"
579 # !insertmacro PrintProgress "$(LAMEXP_LANG_STATUS_VCREDIST)"
580 # File /a `/oname=$PLUGINSDIR\vcredist_x86.exe` `${LAMEXP_SOURCE_PATH}\redist\vcredist_x86.exe`
581 # ExecWait '"$PLUGINSDIR\vcredist_x86.exe" /install /passive /norestart'
584 Section "-Write Uninstaller"
585 !insertmacro PrintProgress
"$(LAMEXP_LANG_STATUS_MAKEUNINST)"
586 WriteUninstaller "$INSTDIR\Uninstall.exe"
589 Section "-Create Shortcuts"
590 !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
591 !insertmacro PrintProgress
"$(LAMEXP_LANG_STATUS_SHORTCUTS)"
592 CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
594 SetShellVarContext current
596 Delete "$SMPROGRAMS\$StartMenuFolder\*.lnk"
597 Delete "$SMPROGRAMS\$StartMenuFolder\*.pif"
598 Delete "$SMPROGRAMS\$StartMenuFolder\*.url"
600 SetShellVarContext all
602 Delete "$SMPROGRAMS\$StartMenuFolder\*.lnk"
603 Delete "$SMPROGRAMS\$StartMenuFolder\*.pif"
604 Delete "$SMPROGRAMS\$StartMenuFolder\*.url"
606 !insertmacro GetExecutableName
$R0
608 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\LameXP.lnk" "$INSTDIR\$R0" "" "$INSTDIR\$R0" 0
609 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(LAMEXP_LANG_LINK_LICENSE).lnk" "$INSTDIR\License.txt"
610 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(LAMEXP_LANG_LINK_CHANGELOG).lnk" "$INSTDIR\Changelog.html"
611 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(LAMEXP_LANG_LINK_TRANSLATE).lnk" "$INSTDIR\Translate.html"
612 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(LAMEXP_LANG_LINK_MANUAL).lnk" "$INSTDIR\Manual.html"
613 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(LAMEXP_LANG_LINK_UNINSTALL).lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0
615 !insertmacro CreateWebLink
"$SMPROGRAMS\$StartMenuFolder\Official LameXP Homepage.url" "${MyWebSite}"
616 !insertmacro CreateWebLink
"$SMPROGRAMS\$StartMenuFolder\Doom9's Forum.url" "http://forum.doom9.org/"
617 !insertmacro CreateWebLink
"$SMPROGRAMS\$StartMenuFolder\Bug Tracker.url" "https://github.com/lordmulder/LameXP/issues"
618 !insertmacro CreateWebLink
"$SMPROGRAMS\$StartMenuFolder\RareWares.org.url" "http://rarewares.org/"
619 !insertmacro CreateWebLink
"$SMPROGRAMS\$StartMenuFolder\Hydrogenaudio Forums.url" "http://www.hydrogenaudio.org/"
621 ${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\LameXP.lnk"
622 ${StdUtils
.InvokeShellVerb
} $R1 "$SMPROGRAMS\$StartMenuFolder" "LameXP.lnk" ${StdUtils
.Const
.ShellVerb
.PinToTaskbar
}
623 DetailPrint 'Pin: "$SMPROGRAMS\$StartMenuFolder\LameXP.lnk" -> $R1'
625 !insertmacro MUI_STARTMENU_WRITE_END
628 Section "-Update Registry"
629 !insertmacro PrintProgress
"$(LAMEXP_LANG_STATUS_REGISTRY)"
631 !insertmacro GetExecutableName
$R0
632 WriteRegStr HKLM "${MyRegPath}" "InstallLocation" "$INSTDIR"
633 WriteRegStr HKLM "${MyRegPath}" "ExecutableName" "$R0"
634 WriteRegStr HKLM "${MyRegPath}" "DisplayIcon" "$INSTDIR\$R0,0"
635 WriteRegStr HKLM "${MyRegPath}" "UninstallString" '"$INSTDIR\Uninstall.exe"'
636 WriteRegStr HKLM "${MyRegPath}" "DisplayName" "LameXP v${LAMEXP_VERSION}"
637 WriteRegStr HKLM "${MyRegPath}" "Publisher" "LoRd_MuldeR <mulder2@gmx.de>"
638 WriteRegStr HKLM "${MyRegPath}" "DisplayVersion" "${LAMEXP_VERSION} ${LAMEXP_INSTTYPE}-${LAMEXP_PATCH} [Build #${LAMEXP_BUILD}]"
639 WriteRegStr HKLM "${MyRegPath}" "URLInfoAbout" "${MyWebSite}"
640 WriteRegStr HKLM "${MyRegPath}" "URLUpdateInfo" "${MyWebSite}"
642 WriteRegStr HKLM "${AppPaths}\LameXP.exe" "" "$INSTDIR\$R0"
643 WriteRegStr HKLM "${AppPaths}\LameXP.exe" "Path" "$INSTDIR"
647 !insertmacro PrintProgress
"$(MUI_TEXT_FINISH_TITLE)."
649 !ifdef LAMEXP_IS_PRERELEASE
650 ${If} ${FileExists} "$INSTDIR\PRE_RELEASE_INFO.txt"
651 ${StdUtils
.ExecShellAsUser
} $R1 "$INSTDIR\PRE_RELEASE_INFO.txt" "open" ""
655 ${IfThen} ${UnattendedMode} ${|
} SetAutoClose true
${|
}
659 ;--------------------------------
661 ;--------------------------------
665 !insertmacro PrintProgress
"$(LAMEXP_LANG_STATUS_UNINSTALL)"
671 !insertmacro MUI_STARTMENU_GETFOLDER Application
$StartMenuFolder
672 ${IfNot} "$StartMenuFolder" ==
""
673 SetShellVarContext current
674 ${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\LameXP.lnk"
675 ${StdUtils
.InvokeShellVerb
} $R1 "$SMPROGRAMS\$StartMenuFolder" "LameXP.lnk" ${StdUtils
.Const
.ShellVerb
.UnpinFromTaskbar
}
676 DetailPrint 'Unpin: "$SMPROGRAMS\$StartMenuFolder\LameXP.lnk" -> $R1'
678 ${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\*.*"
679 Delete /REBOOTOK
"$SMPROGRAMS\$StartMenuFolder\*.lnk"
680 Delete /REBOOTOK
"$SMPROGRAMS\$StartMenuFolder\*.url"
681 RMDir "$SMPROGRAMS\$StartMenuFolder"
684 SetShellVarContext all
685 ${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\LameXP.lnk"
686 ${StdUtils
.InvokeShellVerb
} $R1 "$SMPROGRAMS\$StartMenuFolder" "LameXP.lnk" ${StdUtils
.Const
.ShellVerb
.UnpinFromTaskbar
}
687 DetailPrint 'Unpin: "$SMPROGRAMS\$StartMenuFolder\LameXP.lnk" -> $R1'
689 ${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\*.*"
690 Delete /REBOOTOK
"$SMPROGRAMS\$StartMenuFolder\*.lnk"
691 Delete /REBOOTOK
"$SMPROGRAMS\$StartMenuFolder\*.url"
692 RMDir "$SMPROGRAMS\$StartMenuFolder"
700 ReadRegStr $R0 HKLM "${MyRegPath}" "ExecutableName"
701 ${IfThen} "$R0" ==
"" ${|
} StrCpy $R0 "LameXP.exe" ${|
}
702 ExecWait '"$INSTDIR\$R0" --uninstall'
704 Delete /REBOOTOK
"$INSTDIR\$R0"
705 !insertmacro CleanUpFiles
/REBOOTOK
712 DeleteRegKey HKLM "${MyRegPath}"
713 DeleteRegKey HKCU "${MyRegPath}"
715 DeleteRegKey HKLM "SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{54dcbccb-c905-46dc-b6e6-48563d0e9e55}"
716 DeleteRegKey HKCU "SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{54dcbccb-c905-46dc-b6e6-48563d0e9e55}"
718 DeleteRegKey HKLM "${AppPaths}\LameXP.exe"
719 DeleteRegKey HKCU "${AppPaths}\LameXP.exe"
721 MessageBox MB_YESNO|
MB_TOPMOST "$(LAMEXP_LANG_UNINST_PERSONAL)" IDNO +3
722 Delete "$LOCALAPPDATA\LoRd_MuldeR\LameXP - Audio Encoder Front-End\config.ini"
723 Delete "$INSTDIR\*.ini"
725 !insertmacro PrintProgress
"$(MUI_UNTEXT_FINISH_TITLE)."
729 ;--------------------------------
730 ;Check For Update Mode
731 ;--------------------------------
733 Function SkipIfUnattended
734 ${IfThen} ${UnattendedMode} ${|
} Abort ${|
}
737 Function CheckForUpdate
738 ${If} "$INSTDIR" ==
""
739 ${OrIf} "$INSTDIR" ==
"$EXEDIR"
740 ${OrIfNot} ${FileExists} "$INSTDIR\LameXP.exe"
744 FindWindow $R0 "#32770" "" $HWNDPARENT
745 GetDlgItem
$R1 $R0 1019
748 FindWindow $R0 "#32770" "" $HWNDPARENT
749 GetDlgItem
$R1 $R0 1001
753 Function un
.CheckForcedUninstall
754 ${IfThen} ${ForcedMode} ${|
} Abort ${|
}
758 ;--------------------------------
759 ;Check For Pre-Release
760 ;--------------------------------
762 Function CheckForPreRelease
763 !ifdef LAMEXP_IS_PRERELEASE
764 ${IfNot} ${UnattendedMode}
765 MessageBox MB_TOPMOST|
MB_ICONEXCLAMATION|
MB_OKCANCEL "$(LAMEXP_LANG_PRERELEASE_WARNING)" /SD
IDOK IDOK +2
772 ;--------------------------------
774 ;--------------------------------
776 !macro _LockedListShow uinst
777 !insertmacro MUI_HEADER_TEXT
"$(LAMEXP_LANG_LOCKEDLIST_HEADER)" "$(LAMEXP_LANG_LOCKEDLIST_TEXT)"
778 ${If} ${UnattendedMode}
779 !insertmacro DisableBackButton
$R0
783 File /oname=
$PLUGINSDIR\LockedList64
.dll
`${NSISDIR}\Plugins\LockedList64.dll`
785 !insertmacro GetExecutableName
$R0
786 LockedList::AddModule
"\$R0"
787 ${If} "$R0" !=
"LameXP.exe"
788 LockedList::AddModule
"\LameXP.exe"
790 LockedList::AddModule
"\Uninstall.exe"
792 LockedList::AddModule
"\Au_.exe"
794 LockedList::AddFolder
"$INSTDIR"
795 LockedList::Dialog
/autonext
/heading
"$(LAMEXP_LANG_LOCKEDLIST_HEADING)" /noprograms
"$(LAMEXP_LANG_LOCKEDLIST_NOPROG)" /searching
"$(LAMEXP_LANG_LOCKEDLIST_SEARCH)" /colheadings
"$(LAMEXP_LANG_LOCKEDLIST_COLHDR1)" "$(LAMEXP_LANG_LOCKEDLIST_COLHDR2)"
799 Function LockedListShow
800 !insertmacro _LockedListShow
0
803 Function un
.LockedListShow
804 !insertmacro _LockedListShow
1
808 ;--------------------------------
810 ;--------------------------------
812 Function RunAppFunction
813 !insertmacro DisableNextButton
$R0
814 !insertmacro GetExecutableName
$R0
815 ${StdUtils
.ExecShellAsUser
} $R1 "$INSTDIR" "explore" ""
816 ${StdUtils
.ExecShellAsUser
} $R1 "$INSTDIR\$R0" "open" "--first-run"
819 Function ShowReadmeFunction
820 !insertmacro DisableNextButton
$R0
821 ${StdUtils
.ExecShellAsUser
} $R1 "$INSTDIR\Manual.html" "open" ""
824 Function .onInstSuccess
825 ${If} ${UnattendedMode}
826 !insertmacro GetExecutableName
$R0
827 ${StdUtils
.ExecShellAsUser
} $R1 "$INSTDIR\$R0" "open" "--first-run"