1 ; ///////////////////////////////////////////////////////////////////////////////
2 ; // LameXP - Audio Encoder Front-End
3 ; // Copyright (C) 2004-2023 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; always including the non-optional
9 ; // LAMEXP GNU GENERAL PUBLIC LICENSE ADDENDUM. See "License.txt" file!
11 ; // This program is distributed in the hope that it will be useful,
12 ; // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ; // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ; // GNU General Public License for more details.
16 ; // You should have received a copy of the GNU General Public License along
17 ; // with this program; if not, write to the Free Software Foundation, Inc.,
18 ; // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 ; // http://www.gnu.org/licenses/gpl-2.0.txt
21 ; ///////////////////////////////////////////////////////////////////////////////
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 !!!"
54 !define MyRegPath "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{FBD7A67D-D700-4043-B54F-DD106D00F308}"
57 !define AppPaths "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths"
60 !define MyWebSite "http://muldersoft.com/"
63 !define PrerequisitesDir "..\..\..\Prerequisites"
65 ;--------------------------------
66 ;Check for Pre-Release
67 ;--------------------------------
69 !define LAMEXP_IS_PRERELEASE
71 !if '${LAMEXP_INSTTYPE}' == 'Final'
72 !undef LAMEXP_IS_PRERELEASE
74 !if '${LAMEXP_INSTTYPE}' == 'Hotfix'
75 !undef LAMEXP_IS_PRERELEASE
79 ;--------------------------------
81 ;--------------------------------
84 !packhdr "${PACKHDRTEMP}" '"${PrerequisitesDir}\MSVC\redist\bin\mt.exe" -manifest "setup.manifest" -outputresource:"${PACKHDRTEMP};1" && "${PrerequisitesDir}\UPX\upx.exe" --brute "${PACKHDRTEMP}"'
87 ;--------------------------------
89 ;--------------------------------
94 !include `StdUtils.nsh`
97 ;--------------------------------
99 ;--------------------------------
101 RequestExecutionLevel admin
103 ShowUninstDetails show
104 Name "LameXP v${LAMEXP_VERSION} ${LAMEXP_INSTTYPE}-${LAMEXP_PATCH} [Build #${LAMEXP_BUILD}]"
105 OutFile "${LAMEXP_OUTPUT_FILE}"
106 BrandingText "Date created: ${LAMEXP_DATE} [Build #${LAMEXP_BUILD}]"
107 InstallDir "$PROGRAMFILES\MuldeR\LameXP"
108 InstallDirRegKey HKLM "${MyRegPath}" "InstallLocation"
111 ;--------------------------------
113 ;--------------------------------
115 SetCompressor /SOLID LZMA
116 SetCompressorDictSize 64
119 ;--------------------------------
121 ;--------------------------------
123 ReserveFile "${NSISDIR}\Plugins\Aero.dll"
124 ReserveFile "${NSISDIR}\Plugins\LangDLL.dll"
125 ReserveFile "${NSISDIR}\Plugins\LockedList.dll"
126 ReserveFile "${NSISDIR}\Plugins\LockedList64.dll"
127 ReserveFile "${NSISDIR}\Plugins\nsDialogs.dll"
128 ReserveFile "${NSISDIR}\Plugins\nsExec.dll"
129 ReserveFile "${NSISDIR}\Plugins\StartMenu.dll"
130 ReserveFile "${NSISDIR}\Plugins\StdUtils.dll"
131 ReserveFile "${NSISDIR}\Plugins\System.dll"
132 ReserveFile "${NSISDIR}\Plugins\UserInfo.dll"
135 ;--------------------------------
137 ;--------------------------------
142 ;--------------------------------
144 ;--------------------------------
146 !searchreplace PRODUCT_VERSION_DATE "${LAMEXP_DATE}" "-" "."
147 VIProductVersion "${PRODUCT_VERSION_DATE}.${LAMEXP_BUILD}"
149 VIAddVersionKey "Author" "LoRd_MuldeR <mulder2@gmx.de>"
150 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; always including the non-optional LAMEXP GNU GENERAL PUBLIC LICENSE ADDENDUM."
151 VIAddVersionKey "CompanyName" "Free Software Foundation"
152 VIAddVersionKey "FileDescription" "LameXP v${LAMEXP_VERSION} ${LAMEXP_INSTTYPE}-${LAMEXP_PATCH} [Build #${LAMEXP_BUILD}]"
153 VIAddVersionKey "FileVersion" "${PRODUCT_VERSION_DATE}.${LAMEXP_BUILD} (${LAMEXP_VERSION})"
154 VIAddVersionKey "LegalCopyright" "Copyright 2004-2023 LoRd_MuldeR"
155 VIAddVersionKey "LegalTrademarks" "GNU"
156 VIAddVersionKey "OriginalFilename" "LameXP.${LAMEXP_DATE}.exe"
157 VIAddVersionKey "ProductName" "LameXP - Audio Encoder Frontend"
158 VIAddVersionKey "ProductVersion" "${LAMEXP_VERSION}, Build #${LAMEXP_BUILD} (${LAMEXP_DATE})"
159 VIAddVersionKey "Website" "${MyWebSite}"
162 ;--------------------------------
163 ;MUI2 Interface Settings
164 ;--------------------------------
166 !define MUI_ABORTWARNING
167 !define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM
168 !define MUI_STARTMENUPAGE_REGISTRY_KEY "${MyRegPath}"
169 !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "StartmenuFolder"
170 !define MUI_LANGDLL_REGISTRY_ROOT HKLM
171 !define MUI_LANGDLL_REGISTRY_KEY "${MyRegPath}"
172 !define MUI_LANGDLL_REGISTRY_VALUENAME "SetupLanguage"
173 !define MUI_STARTMENUPAGE_DEFAULTFOLDER "LameXP v${LAMEXP_VERSION}"
174 !define MUI_FINISHPAGE_NOAUTOCLOSE
175 !define MUI_UNFINISHPAGE_NOAUTOCLOSE
176 !define MUI_FINISHPAGE_RUN
177 !define MUI_FINISHPAGE_RUN_FUNCTION RunAppFunction
178 !define MUI_FINISHPAGE_SHOWREADME
179 !define MUI_FINISHPAGE_SHOWREADME_FUNCTION ShowReadmeFunction
180 !define MUI_FINISHPAGE_LINK ${MyWebSite}
181 !define MUI_FINISHPAGE_LINK_LOCATION ${MyWebSite}
182 !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico"
183 !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall.ico"
184 !define MUI_WELCOMEFINISHPAGE_BITMAP "wizard.bmp"
185 !define MUI_UNWELCOMEFINISHPAGE_BITMAP "wizard-un.bmp"
186 !define MUI_HEADERIMAGE
187 !define MUI_HEADERIMAGE_BITMAP "header.bmp"
188 !define MUI_HEADERIMAGE_UNBITMAP "header-un.bmp"
189 !define MUI_LANGDLL_ALLLANGUAGES
190 !define MUI_CUSTOMFUNCTION_GUIINIT MyGuiInit
191 !define MUI_CUSTOMFUNCTION_UNGUIINIT un.MyGuiInit
192 !define MUI_LANGDLL_ALWAYSSHOW
195 ;--------------------------------
196 ;MUI2 Pages (Installer)
197 ;--------------------------------
200 !define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfUnattended
201 !define MUI_PAGE_CUSTOMFUNCTION_LEAVE CheckForPreRelease
202 !define MUI_WELCOMEPAGE_TITLE_3LINES
203 !define MUI_FINISHPAGE_TITLE_3LINES
204 !insertmacro MUI_PAGE_WELCOME
207 !define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfUnattended
208 !insertmacro MUI_PAGE_LICENSE "license.rtf"
211 !define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfUnattended
212 !define MUI_PAGE_CUSTOMFUNCTION_SHOW CheckForUpdate
213 !insertmacro MUI_PAGE_DIRECTORY
216 !define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfUnattended
217 !insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder
220 Page Custom LockedListShow
223 !insertmacro MUI_PAGE_INSTFILES
226 !define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfUnattended
227 !insertmacro MUI_PAGE_FINISH
230 ;--------------------------------
231 ;MUI2 Pages (Uninstaller)
232 ;--------------------------------
235 !define MUI_WELCOMEPAGE_TITLE_3LINES
236 !define MUI_FINISHPAGE_TITLE_3LINES
237 !define MUI_PAGE_CUSTOMFUNCTION_PRE un.CheckForcedUninstall
238 !insertmacro MUI_UNPAGE_WELCOME
241 !define MUI_PAGE_CUSTOMFUNCTION_PRE un.CheckForcedUninstall
242 !insertmacro MUI_UNPAGE_CONFIRM
245 UninstPage Custom un.LockedListShow
248 !insertmacro MUI_UNPAGE_INSTFILES
251 !define MUI_PAGE_CUSTOMFUNCTION_PRE un.CheckForcedUninstall
252 !insertmacro MUI_UNPAGE_FINISH
255 ;--------------------------------
257 ;--------------------------------
259 !insertmacro MUI_LANGUAGE "English" ;first language is the default language
260 !insertmacro MUI_LANGUAGE "Bulgarian"
261 !insertmacro MUI_LANGUAGE "German"
262 !insertmacro MUI_LANGUAGE "Hungarian"
263 !insertmacro MUI_LANGUAGE "Japanese"
264 !insertmacro MUI_LANGUAGE "Polish"
265 !insertmacro MUI_LANGUAGE "Russian"
266 !insertmacro MUI_LANGUAGE "Spanish"
267 !insertmacro MUI_LANGUAGE "Ukrainian"
268 !insertmacro MUI_LANGUAGE "Korean"
270 ; !insertmacro MUI_LANGUAGE "Afrikaans"
271 ; !insertmacro MUI_LANGUAGE "Arabic"
272 ; !insertmacro MUI_LANGUAGE "Dutch"
273 ; !insertmacro MUI_LANGUAGE "French"
274 ; !insertmacro MUI_LANGUAGE "Greek"
275 ; !insertmacro MUI_LANGUAGE "Indonesian"
276 ; !insertmacro MUI_LANGUAGE "Italian"
277 ; !insertmacro MUI_LANGUAGE "Malay"
278 ; !insertmacro MUI_LANGUAGE "Portuguese"
279 ; !insertmacro MUI_LANGUAGE "Romanian"
280 ; !insertmacro MUI_LANGUAGE "Serbian"
281 ; !insertmacro MUI_LANGUAGE "SerbianLatin"
282 ; !insertmacro MUI_LANGUAGE "SimpChinese"
283 ; !insertmacro MUI_LANGUAGE "SpanishInternational"
284 ; !insertmacro MUI_LANGUAGE "TradChinese"
287 ;--------------------------------
289 ;--------------------------------
292 !include "..\Translation\Blank.nsh" ;first language is the default language
295 !include "..\Translation\LameXP_BG.nsh"
298 !include "..\Translation\LameXP_DE.nsh"
301 !include "..\Translation\LameXP_HU.nsh"
304 !include "..\Translation\LameXP_JA.nsh"
307 !include "..\Translation\LameXP_PL.nsh"
310 !include "..\Translation\LameXP_RU.nsh"
313 !include "..\Translation\LameXP_ES.nsh"
316 !include "..\Translation\LameXP_UK.nsh"
319 !include "..\Translation\LameXP_KR.nsh"
321 ;--------------------------------
323 ;--------------------------------
325 !macro _UnattendedMode _a _b _t _f
326 !insertmacro _LOGICLIB_TEMP
327 ${StdUtils.TestParameter} $_LOGICLIB_TEMP "Update"
328 StrCmp "$_LOGICLIB_TEMP" "true" `${_t}` `${_f}`
330 !define UnattendedMode `"" UnattendedMode ""`
332 !macro _ForcedMode _a _b _t _f
333 !insertmacro _LOGICLIB_TEMP
334 ${StdUtils.TestParameter} $_LOGICLIB_TEMP "Force"
335 StrCmp "$_LOGICLIB_TEMP" "true" `${_t}` `${_f}`
337 !define ForcedMode `"" ForcedMode ""`
339 !macro _ValidFileName _a _b _t _f
340 !insertmacro _LOGICLIB_TEMP
341 ${StdUtils.ValidFileName} $_LOGICLIB_TEMP `${_b}`
342 StrCmp "$_LOGICLIB_TEMP" "ok" `${_t}` `${_f}`
344 !define ValidFileName `"" ValidFileName`
347 ;--------------------------------
348 ;Installer initialization
349 ;--------------------------------
356 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "{2B3D1EBF-B3B6-4E93-92B9-6853029A7162}") i .r1 ?e'
359 MessageBox MB_ICONSTOP|MB_TOPMOST "Sorry, the installer is already running!"
365 # Running on Windows NT family?
367 MessageBox MB_TOPMOST|MB_ICONSTOP "Sorry, this application does *not* support Windows 9x/ME!"
368 ExecShell "open" "http://windows.microsoft.com/"
372 # Running on Windows XP or later?
373 ${If} ${AtMostWin2000}
374 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)."
375 ExecShell "open" "http://windows.microsoft.com/"
379 # If on Windows XP, is the required Service Pack installed?
381 ${IfNot} ${RunningX64} # Windows XP 32-Bit, requires Service Pack 3
382 ${AndIf} ${AtMostServicePack} 2
383 MessageBox MB_TOPMOST|MB_ICONEXCLAMATION "This application requires Service Pack 3 for Windows XP.$\nPlease install the required Service Pack and retry!"
386 ${If} ${RunningX64} # Windows XP 64-Bit, requires Service Pack 2
387 ${AndIf} ${AtMostServicePack} 1
388 MessageBox MB_TOPMOST|MB_ICONEXCLAMATION "This application requires Service Pack 2 for Windows XP x64.$\nPlease install the required Service Pack and retry!"
393 # Running on Windows Vista?
395 ${AndIf} ${AtMostServicePack} 1
396 MessageBox MB_TOPMOST|MB_ICONEXCLAMATION "This application requires Service Pack 2 for Windows Vista.$\nPlease install the required Service Pack and retry!"
400 # Running on Windows 8.0?
404 MessageBox MB_TOPMOST|MB_ICONEXCLAMATION "This application requires Windows 8.1 or later.$\nPlease upgrade your Windows and retry!"
411 ${IfNot} ${UnattendedMode}
412 !insertmacro MUI_LANGDLL_DISPLAY
417 UserInfo::GetAccountType
420 MessageBox MB_ICONSTOP|MB_TOPMOST "Your system requires administrative permissions in order to install this software."
421 SetErrorLevel 740 ;ERROR_ELEVATION_REQUIRED
427 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "{2B3D1EBF-B3B6-4E93-92B9-6853029A7162}") i .r1 ?e'
430 MessageBox MB_ICONSTOP|MB_TOPMOST "Sorry, the un-installer is already running!"
434 ${IfNot} ${ForcedMode}
435 !insertmacro MUI_LANGDLL_DISPLAY
440 UserInfo::GetAccountType
443 MessageBox MB_ICONSTOP|MB_TOPMOST "Your system requires administrative permissions in order to install this software."
444 SetErrorLevel 740 ;ERROR_ELEVATION_REQUIRED
450 ;--------------------------------
452 ;--------------------------------
455 StrCpy $0 $HWNDPARENT
456 System::Call "user32::SetWindowPos(i r0, i -1, i 0, i 0, i 0, i 0, i 3)"
460 Function un.MyGuiInit
461 StrCpy $0 $HWNDPARENT
462 System::Call "user32::SetWindowPos(i r0, i -1, i 0, i 0, i 0, i 0, i 3)"
467 ;--------------------------------
468 ;Macros & Auxiliary Functions
469 ;--------------------------------
471 !macro PrintProgress Text
472 SetDetailsPrint textonly
473 DetailPrint '${Text}'
474 SetDetailsPrint listonly
478 !macro CreateWebLink ShortcutFile TargetURL
481 StrCpy $0 "${ShortcutFile}"
482 StrCpy $1 "${TargetURL}"
488 Function _CreateWebLink
490 SetFileAttributes "$0" FILE_ATTRIBUTE_NORMAL
491 DeleteINISec "$0" "DEFAULT"
492 DeleteINISec "$0" "InternetShortcut"
493 WriteINIStr "$0" "DEFAULT" "BASEURL" "$1"
494 WriteINIStr "$0" "InternetShortcut" "ORIGURL" "$1"
495 WriteINIStr "$0" "InternetShortcut" "URL" "$1"
496 WriteINIStr "$0" "InternetShortcut" "IconFile" "$SYSDIR\SHELL32.dll"
497 WriteINIStr "$0" "InternetShortcut" "IconIndex" "150"
499 SetFileAttributes "$0" FILE_ATTRIBUTE_READONLY
502 !macro GetExecutableName OutVar
503 ${StdUtils.GetParameter} ${OutVar} "Update" ""
504 ${StdUtils.TrimStr} ${OutVar}
505 ${If} "${OutVar}" == ""
506 ${OrIfNot} ${ValidFileName} "${OutVar}"
507 StrCpy ${OutVar} "LameXP.exe"
511 !macro DisableNextButton TmpVar
512 GetDlgItem ${TmpVar} $HWNDPARENT 1
513 EnableWindow ${TmpVar} 0
516 !macro DisableBackButton TmpVar
517 GetDlgItem ${TmpVar} $HWNDPARENT 3
518 EnableWindow ${TmpVar} 0
521 !macro CleanUpFiles options
522 Delete ${options} "$INSTDIR\Changelog.htm"
523 Delete ${options} "$INSTDIR\Changelog.html"
524 Delete ${options} "$INSTDIR\Contributors.txt"
525 Delete ${options} "$INSTDIR\Copying.txt"
526 Delete ${options} "$INSTDIR\FAQ.html"
527 Delete ${options} "$INSTDIR\Howto.html"
528 Delete ${options} "$INSTDIR\LameEnc.sys"
529 Delete ${options} "$INSTDIR\LameXP*.exe"
530 Delete ${options} "$INSTDIR\LameXP*.exe.sig"
531 Delete ${options} "$INSTDIR\LameXP*.rcc"
532 Delete ${options} "$INSTDIR\LameXP*.VisualElementsManifest.xml"
533 Delete ${options} "$INSTDIR\LameXP*.tag"
534 Delete ${options} "$INSTDIR\License.txt"
535 Delete ${options} "$INSTDIR\Manual.html"
536 Delete ${options} "$INSTDIR\Readme.htm"
537 Delete ${options} "$INSTDIR\Readme.html"
538 Delete ${options} "$INSTDIR\ReadMe.txt"
539 Delete ${options} "$INSTDIR\PRE_RELEASE_INFO.txt"
540 Delete ${options} "$INSTDIR\Settings.cfg"
541 Delete ${options} "$INSTDIR\Translate.html"
542 Delete ${options} "$INSTDIR\Uninstall.exe"
543 Delete ${options} "$INSTDIR\Qt*.dll"
544 Delete ${options} "$INSTDIR\MUtils*.dll"
545 Delete ${options} "$INSTDIR\msvcr*.dll"
546 Delete ${options} "$INSTDIR\msvcp*.dll"
547 Delete ${options} "$INSTDIR\concrt*.dll"
548 Delete ${options} "$INSTDIR\vcruntime*.dll"
549 Delete ${options} "$INSTDIR\vccorlib*.dll"
550 Delete ${options} "$INSTDIR\api-ms-*.dll"
551 Delete ${options} "$INSTDIR\ucrtbase.dll"
553 RMDir /r ${options} "$INSTDIR\cache"
554 RMDir /r ${options} "$INSTDIR\img"
555 RMDir /r ${options} "$INSTDIR\imageformats"
556 RMDir /r ${options} "$INSTDIR\redist"
559 !macro InstallRedist srcdir filename
560 File /a `/oname=$PLUGINSDIR\${filename}` `${srcdir}\${filename}`
561 ExecWait `"$PLUGINSDIR\${filename}" /passive`
564 ;--------------------------------
566 ;--------------------------------
569 SetShellVarContext all
570 SetOutPath "$INSTDIR"
573 Section "-Clean Up Old Cruft"
574 !insertmacro PrintProgress "$(LAMEXP_LANG_STATUS_CLEANUP)"
575 !insertmacro CleanUpFiles ""
578 Section "!Install Files"
579 !insertmacro PrintProgress "$(LAMEXP_LANG_STATUS_INSTFILES)"
582 !insertmacro GetExecutableName $R0
584 Delete "$INSTDIR\$R0"
587 MessageBox MB_TOPMOST|MB_ICONSTOP|MB_RETRYCANCEL 'Could not delete old "$R0" file. Is LameXP still running?' IDRETRY DeleteOldBinary
588 Abort "Could not delete old binary!"
591 File /a `/oname=$R0` `${LAMEXP_SOURCE_PATH}\LameXP.exe`
592 File /nonfatal /a /r `${LAMEXP_SOURCE_PATH}\*.dll`
593 File /nonfatal /a /r `${LAMEXP_SOURCE_PATH}\*.rcc`
595 ${StdUtils.GetFileNamePart} $R1 "$R0"
596 File /a `/oname=$R1.VisualElementsManifest.xml` `${LAMEXP_SOURCE_PATH}\LameXP.VisualElementsManifest.xml`
597 File /a `/oname=$R1.tag` `${LAMEXP_SOURCE_PATH}\LameXP.tag`
599 File /a /r `${LAMEXP_SOURCE_PATH}\*.txt`
600 File /a /r `${LAMEXP_SOURCE_PATH}\*.html`
601 File /a /r `${LAMEXP_SOURCE_PATH}\*.png`
604 Section "-Write Uninstaller"
605 !insertmacro PrintProgress "$(LAMEXP_LANG_STATUS_MAKEUNINST)"
606 WriteUninstaller "$INSTDIR\Uninstall.exe"
609 Section "-Install Runtime Libraries"
611 ${AndIfNot} ${FileExists} `$SYSDIR\normaliz.dll`
612 !insertmacro PrintProgress "$(LAMEXP_LANG_STATUS_VCREDIST)"
614 !insertmacro InstallRedist '${PrerequisitesDir}\IDNMInstaller' 'idndl.x64.exe'
616 !insertmacro InstallRedist '${PrerequisitesDir}\IDNMInstaller' 'idndl.x86.exe'
621 Section "-Create Shortcuts"
622 !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
623 !insertmacro PrintProgress "$(LAMEXP_LANG_STATUS_SHORTCUTS)"
624 CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
626 SetShellVarContext current
628 Delete "$SMPROGRAMS\$StartMenuFolder\*.lnk"
629 Delete "$SMPROGRAMS\$StartMenuFolder\*.pif"
630 Delete "$SMPROGRAMS\$StartMenuFolder\*.url"
632 SetShellVarContext all
634 Delete "$SMPROGRAMS\$StartMenuFolder\*.lnk"
635 Delete "$SMPROGRAMS\$StartMenuFolder\*.pif"
636 Delete "$SMPROGRAMS\$StartMenuFolder\*.url"
638 !insertmacro GetExecutableName $R0
640 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\LameXP.lnk" "$INSTDIR\$R0" "" "$INSTDIR\$R0" 0
641 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(LAMEXP_LANG_LINK_LICENSE).lnk" "$INSTDIR\License.txt"
642 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(LAMEXP_LANG_LINK_CHANGELOG).lnk" "$INSTDIR\Changelog.html"
643 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(LAMEXP_LANG_LINK_TRANSLATE).lnk" "$INSTDIR\Translate.html"
644 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(LAMEXP_LANG_LINK_MANUAL).lnk" "$INSTDIR\Manual.html"
645 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(LAMEXP_LANG_LINK_UNINSTALL).lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0
647 !insertmacro CreateWebLink "$SMPROGRAMS\$StartMenuFolder\Official LameXP Homepage.url" "${MyWebSite}"
648 !insertmacro CreateWebLink "$SMPROGRAMS\$StartMenuFolder\Doom9's Forum.url" "http://forum.doom9.org/"
649 !insertmacro CreateWebLink "$SMPROGRAMS\$StartMenuFolder\Bug Tracker.url" "https://github.com/lordmulder/LameXP/issues"
650 !insertmacro CreateWebLink "$SMPROGRAMS\$StartMenuFolder\RareWares.org.url" "http://rarewares.org/"
651 !insertmacro CreateWebLink "$SMPROGRAMS\$StartMenuFolder\Hydrogenaudio Forums.url" "http://www.hydrogenaudio.org/"
653 ${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\LameXP.lnk"
654 ${StdUtils.InvokeShellVerb} $R1 "$SMPROGRAMS\$StartMenuFolder" "LameXP.lnk" ${StdUtils.Const.ShellVerb.PinToTaskbar}
655 DetailPrint 'Pin: "$SMPROGRAMS\$StartMenuFolder\LameXP.lnk" -> $R1'
657 !insertmacro MUI_STARTMENU_WRITE_END
660 Section "-Update Registry"
661 !insertmacro PrintProgress "$(LAMEXP_LANG_STATUS_REGISTRY)"
663 !insertmacro GetExecutableName $R0
664 WriteRegStr HKLM "${MyRegPath}" "InstallLocation" "$INSTDIR"
665 WriteRegStr HKLM "${MyRegPath}" "ExecutableName" "$R0"
666 WriteRegStr HKLM "${MyRegPath}" "DisplayIcon" "$INSTDIR\$R0,0"
667 WriteRegStr HKLM "${MyRegPath}" "UninstallString" '"$INSTDIR\Uninstall.exe"'
668 WriteRegStr HKLM "${MyRegPath}" "DisplayName" "LameXP v${LAMEXP_VERSION}"
669 WriteRegStr HKLM "${MyRegPath}" "Publisher" "LoRd_MuldeR <mulder2@gmx.de>"
670 WriteRegStr HKLM "${MyRegPath}" "DisplayVersion" "${LAMEXP_VERSION} ${LAMEXP_INSTTYPE}-${LAMEXP_PATCH} [Build #${LAMEXP_BUILD}]"
671 WriteRegStr HKLM "${MyRegPath}" "URLInfoAbout" "${MyWebSite}"
672 WriteRegStr HKLM "${MyRegPath}" "URLUpdateInfo" "${MyWebSite}"
674 DeleteRegKey HKCU "${AppPaths}\LameXP.exe"
675 WriteRegStr HKLM "${AppPaths}\LameXP.exe" "" "$INSTDIR\$R0"
676 WriteRegStr HKLM "${AppPaths}\LameXP.exe" "Path" "$INSTDIR"
680 !insertmacro PrintProgress "$(MUI_TEXT_FINISH_TITLE)."
682 !ifdef LAMEXP_IS_PRERELEASE
683 ${If} ${FileExists} "$INSTDIR\PRE_RELEASE_INFO.txt"
684 ${StdUtils.ExecShellAsUser} $R1 "$INSTDIR\PRE_RELEASE_INFO.txt" "open" ""
688 ${IfThen} ${UnattendedMode} ${|} SetAutoClose true ${|}
692 ;--------------------------------
694 ;--------------------------------
698 !insertmacro PrintProgress "$(LAMEXP_LANG_STATUS_UNINSTALL)"
704 !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
705 ${IfNot} "$StartMenuFolder" == ""
706 SetShellVarContext current
707 ${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\LameXP.lnk"
708 ${StdUtils.InvokeShellVerb} $R1 "$SMPROGRAMS\$StartMenuFolder" "LameXP.lnk" ${StdUtils.Const.ShellVerb.UnpinFromTaskbar}
709 DetailPrint 'Unpin: "$SMPROGRAMS\$StartMenuFolder\LameXP.lnk" -> $R1'
711 ${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\*.*"
712 Delete /REBOOTOK "$SMPROGRAMS\$StartMenuFolder\*.lnk"
713 Delete /REBOOTOK "$SMPROGRAMS\$StartMenuFolder\*.url"
714 RMDir "$SMPROGRAMS\$StartMenuFolder"
717 SetShellVarContext all
718 ${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\LameXP.lnk"
719 ${StdUtils.InvokeShellVerb} $R1 "$SMPROGRAMS\$StartMenuFolder" "LameXP.lnk" ${StdUtils.Const.ShellVerb.UnpinFromTaskbar}
720 DetailPrint 'Unpin: "$SMPROGRAMS\$StartMenuFolder\LameXP.lnk" -> $R1'
722 ${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\*.*"
723 Delete /REBOOTOK "$SMPROGRAMS\$StartMenuFolder\*.lnk"
724 Delete /REBOOTOK "$SMPROGRAMS\$StartMenuFolder\*.url"
725 RMDir "$SMPROGRAMS\$StartMenuFolder"
733 ReadRegStr $R0 HKLM "${MyRegPath}" "ExecutableName"
734 ${IfThen} "$R0" == "" ${|} StrCpy $R0 "LameXP.exe" ${|}
735 ExecWait '"$INSTDIR\$R0" --uninstall'
737 Delete /REBOOTOK "$INSTDIR\$R0"
738 !insertmacro CleanUpFiles /REBOOTOK
745 DeleteRegKey HKLM "${MyRegPath}"
746 DeleteRegKey HKCU "${MyRegPath}"
748 DeleteRegKey HKLM "SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{54dcbccb-c905-46dc-b6e6-48563d0e9e55}"
749 DeleteRegKey HKCU "SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{54dcbccb-c905-46dc-b6e6-48563d0e9e55}"
751 DeleteRegKey HKLM "${AppPaths}\LameXP.exe"
752 DeleteRegKey HKCU "${AppPaths}\LameXP.exe"
754 MessageBox MB_YESNO|MB_TOPMOST "$(LAMEXP_LANG_UNINST_PERSONAL)" IDNO +3
755 Delete "$LOCALAPPDATA\LoRd_MuldeR\LameXP - Audio Encoder Front-End\config.ini"
756 Delete "$INSTDIR\*.ini"
758 !insertmacro PrintProgress "$(MUI_UNTEXT_FINISH_TITLE)."
762 ;--------------------------------
763 ;Check For Update Mode
764 ;--------------------------------
766 Function SkipIfUnattended
767 ${IfThen} ${UnattendedMode} ${|} Abort ${|}
770 Function CheckForUpdate
771 ${If} "$INSTDIR" == ""
772 ${OrIf} "$INSTDIR" == "$EXEDIR"
773 ${OrIfNot} ${FileExists} "$INSTDIR\LameXP.exe"
777 FindWindow $R0 "#32770" "" $HWNDPARENT
778 GetDlgItem $R1 $R0 1019
781 FindWindow $R0 "#32770" "" $HWNDPARENT
782 GetDlgItem $R1 $R0 1001
786 Function un.CheckForcedUninstall
787 ${IfThen} ${ForcedMode} ${|} Abort ${|}
791 ;--------------------------------
792 ;Check For Pre-Release
793 ;--------------------------------
795 Function CheckForPreRelease
796 !ifdef LAMEXP_IS_PRERELEASE
797 ${IfNot} ${UnattendedMode}
798 MessageBox MB_TOPMOST|MB_ICONEXCLAMATION|MB_OKCANCEL "$(LAMEXP_LANG_PRERELEASE_WARNING)" /SD IDOK IDOK +2
805 ;--------------------------------
807 ;--------------------------------
809 !macro _LockedListShow uinst
810 !insertmacro MUI_HEADER_TEXT "$(LAMEXP_LANG_LOCKEDLIST_HEADER)" "$(LAMEXP_LANG_LOCKEDLIST_TEXT)"
811 ${If} ${UnattendedMode}
812 !insertmacro DisableBackButton $R0
816 File /oname=$PLUGINSDIR\LockedList64.dll `${NSISDIR}\Plugins\LockedList64.dll`
818 !insertmacro GetExecutableName $R0
819 LockedList::AddModule "\$R0"
820 ${If} "$R0" != "LameXP.exe"
821 LockedList::AddModule "\LameXP.exe"
823 LockedList::AddModule "\Uninstall.exe"
825 LockedList::AddModule "\Au_.exe"
827 #LockedList::AddFolder "$INSTDIR"
828 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)"
832 Function LockedListShow
833 !insertmacro _LockedListShow 0
836 Function un.LockedListShow
837 !insertmacro _LockedListShow 1
841 ;--------------------------------
843 ;--------------------------------
845 Function RunAppFunction
846 !insertmacro DisableNextButton $R0
847 !insertmacro GetExecutableName $R0
848 ${StdUtils.ExecShellAsUser} $R1 "$INSTDIR" "explore" ""
849 ${StdUtils.ExecShellAsUser} $R1 "$INSTDIR\$R0" "open" "--first-run"
852 Function ShowReadmeFunction
853 !insertmacro DisableNextButton $R0
854 ${StdUtils.ExecShellAsUser} $R1 "$INSTDIR\Manual.html" "open" ""
857 Function .onInstSuccess
858 ${If} ${UnattendedMode}
859 !insertmacro GetExecutableName $R0
860 ${StdUtils.ExecShellAsUser} $R1 "$INSTDIR\$R0" "open" "--first-run"