1 ; ///////////////////////////////////////////////////////////////////////////////
2 ; // LameXP - Audio Encoder Front-End
3 ; // Copyright (C) 2004-2019 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 !!!"
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 ;--------------------------------
64 ;Check for Pre-Release
65 ;--------------------------------
67 !define LAMEXP_IS_PRERELEASE
69 !if '${LAMEXP_INSTTYPE}' ==
'Final'
70 !undef LAMEXP_IS_PRERELEASE
72 !if '${LAMEXP_INSTTYPE}' ==
'Hotfix'
73 !undef LAMEXP_IS_PRERELEASE
77 ;--------------------------------
79 ;--------------------------------
82 !packhdr "${PACKHDRTEMP}" '"..\..\..\Prerequisites\MSVC\redist\bin\mt.exe" -manifest "setup.manifest" -outputresource:"${PACKHDRTEMP};1" && "..\..\..\Prerequisites\UPX\upx.exe" --brute "${PACKHDRTEMP}"'
85 ;--------------------------------
87 ;--------------------------------
92 !include `StdUtils.nsh`
95 ;--------------------------------
97 ;--------------------------------
99 RequestExecutionLevel admin
101 ShowUninstDetails show
102 Name "LameXP v${LAMEXP_VERSION} ${LAMEXP_INSTTYPE}-${LAMEXP_PATCH} [Build #${LAMEXP_BUILD}]"
103 OutFile "${LAMEXP_OUTPUT_FILE}"
104 BrandingText "Date created: ${LAMEXP_DATE} [Build #${LAMEXP_BUILD}]"
105 InstallDir "$PROGRAMFILES\MuldeR\LameXP"
106 InstallDirRegKey HKLM "${MyRegPath}" "InstallLocation"
109 ;--------------------------------
111 ;--------------------------------
113 SetCompressor
/SOLID LZMA
114 SetCompressorDictSize
64
117 ;--------------------------------
119 ;--------------------------------
121 ReserveFile
"${NSISDIR}\Plugins\Aero.dll"
122 ReserveFile
"${NSISDIR}\Plugins\LangDLL.dll"
123 ReserveFile
"${NSISDIR}\Plugins\LockedList.dll"
124 ReserveFile
"${NSISDIR}\Plugins\LockedList64.dll"
125 ReserveFile
"${NSISDIR}\Plugins\nsDialogs.dll"
126 ReserveFile
"${NSISDIR}\Plugins\nsExec.dll"
127 ReserveFile
"${NSISDIR}\Plugins\StartMenu.dll"
128 ReserveFile
"${NSISDIR}\Plugins\StdUtils.dll"
129 ReserveFile
"${NSISDIR}\Plugins\System.dll"
130 ReserveFile
"${NSISDIR}\Plugins\UserInfo.dll"
133 ;--------------------------------
135 ;--------------------------------
140 ;--------------------------------
142 ;--------------------------------
144 !searchreplace PRODUCT_VERSION_DATE
"${LAMEXP_DATE}" "-" "."
145 VIProductVersion
"${PRODUCT_VERSION_DATE}.${LAMEXP_BUILD}"
147 VIAddVersionKey
"Author" "LoRd_MuldeR <mulder2@gmx.de>"
148 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."
149 VIAddVersionKey
"CompanyName" "Free Software Foundation"
150 VIAddVersionKey
"FileDescription" "LameXP v${LAMEXP_VERSION} ${LAMEXP_INSTTYPE}-${LAMEXP_PATCH} [Build #${LAMEXP_BUILD}]"
151 VIAddVersionKey
"FileVersion" "${PRODUCT_VERSION_DATE}.${LAMEXP_BUILD} (${LAMEXP_VERSION})"
152 VIAddVersionKey
"LegalCopyright" "Copyright 2004-2019 LoRd_MuldeR"
153 VIAddVersionKey
"LegalTrademarks" "GNU"
154 VIAddVersionKey
"OriginalFilename" "LameXP.${LAMEXP_DATE}.exe"
155 VIAddVersionKey
"ProductName" "LameXP - Audio Encoder Frontend"
156 VIAddVersionKey
"ProductVersion" "${LAMEXP_VERSION}, Build #${LAMEXP_BUILD} (${LAMEXP_DATE})"
157 VIAddVersionKey
"Website" "${MyWebSite}"
160 ;--------------------------------
161 ;MUI2 Interface Settings
162 ;--------------------------------
164 !define MUI_ABORTWARNING
165 !define MUI_STARTMENUPAGE_REGISTRY_ROOT
HKLM
166 !define MUI_STARTMENUPAGE_REGISTRY_KEY
"${MyRegPath}"
167 !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME
"StartmenuFolder"
168 !define MUI_LANGDLL_REGISTRY_ROOT
HKLM
169 !define MUI_LANGDLL_REGISTRY_KEY
"${MyRegPath}"
170 !define MUI_LANGDLL_REGISTRY_VALUENAME
"SetupLanguage"
171 !define MUI_STARTMENUPAGE_DEFAULTFOLDER
"LameXP v${LAMEXP_VERSION}"
172 !define MUI_FINISHPAGE_NOAUTOCLOSE
173 !define MUI_UNFINISHPAGE_NOAUTOCLOSE
174 !define MUI_FINISHPAGE_RUN
175 !define MUI_FINISHPAGE_RUN_FUNCTION RunAppFunction
176 !define MUI_FINISHPAGE_SHOWREADME
177 !define MUI_FINISHPAGE_SHOWREADME_FUNCTION ShowReadmeFunction
178 !define MUI_FINISHPAGE_LINK
${MyWebSite}
179 !define MUI_FINISHPAGE_LINK_LOCATION
${MyWebSite}
180 !define MUI_ICON
"${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico"
181 !define MUI_UNICON
"${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall.ico"
182 !define MUI_WELCOMEFINISHPAGE_BITMAP
"wizard.bmp"
183 !define MUI_UNWELCOMEFINISHPAGE_BITMAP
"wizard-un.bmp"
184 !define MUI_HEADERIMAGE
185 !define MUI_HEADERIMAGE_BITMAP
"header.bmp"
186 !define MUI_HEADERIMAGE_UNBITMAP
"header-un.bmp"
187 !define MUI_LANGDLL_ALLLANGUAGES
188 !define MUI_CUSTOMFUNCTION_GUIINIT MyGuiInit
189 !define MUI_CUSTOMFUNCTION_UNGUIINIT un
.MyGuiInit
190 !define MUI_LANGDLL_ALWAYSSHOW
193 ;--------------------------------
194 ;MUI2 Pages (Installer)
195 ;--------------------------------
198 !define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfUnattended
199 !define MUI_PAGE_CUSTOMFUNCTION_LEAVE CheckForPreRelease
200 !define MUI_WELCOMEPAGE_TITLE_3LINES
201 !define MUI_FINISHPAGE_TITLE_3LINES
202 !insertmacro MUI_PAGE_WELCOME
205 !define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfUnattended
206 !insertmacro MUI_PAGE_LICENSE
"license.rtf"
209 !define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfUnattended
210 !define MUI_PAGE_CUSTOMFUNCTION_SHOW CheckForUpdate
211 !insertmacro MUI_PAGE_DIRECTORY
214 !define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfUnattended
215 !insertmacro MUI_PAGE_STARTMENU Application
$StartMenuFolder
218 Page Custom LockedListShow
221 !insertmacro MUI_PAGE_INSTFILES
224 !define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfUnattended
225 !insertmacro MUI_PAGE_FINISH
228 ;--------------------------------
229 ;MUI2 Pages (Uninstaller)
230 ;--------------------------------
233 !define MUI_WELCOMEPAGE_TITLE_3LINES
234 !define MUI_FINISHPAGE_TITLE_3LINES
235 !define MUI_PAGE_CUSTOMFUNCTION_PRE un
.CheckForcedUninstall
236 !insertmacro MUI_UNPAGE_WELCOME
239 !define MUI_PAGE_CUSTOMFUNCTION_PRE un
.CheckForcedUninstall
240 !insertmacro MUI_UNPAGE_CONFIRM
243 UninstPage Custom un
.LockedListShow
246 !insertmacro MUI_UNPAGE_INSTFILES
249 !define MUI_PAGE_CUSTOMFUNCTION_PRE un
.CheckForcedUninstall
250 !insertmacro MUI_UNPAGE_FINISH
253 ;--------------------------------
255 ;--------------------------------
257 !insertmacro MUI_LANGUAGE
"English" ;first language is the default language
258 !insertmacro MUI_LANGUAGE
"German"
259 !insertmacro MUI_LANGUAGE
"Spanish"
260 !insertmacro MUI_LANGUAGE
"Russian"
261 !insertmacro MUI_LANGUAGE
"Ukrainian"
262 !insertmacro MUI_LANGUAGE
"Polish"
263 !insertmacro MUI_LANGUAGE
"Hungarian"
265 ; !insertmacro MUI_LANGUAGE "French"
266 ; !insertmacro MUI_LANGUAGE "SpanishInternational"
267 ; !insertmacro MUI_LANGUAGE "SimpChinese"
268 ; !insertmacro MUI_LANGUAGE "TradChinese"
269 ; !insertmacro MUI_LANGUAGE "Japanese"
270 ; !insertmacro MUI_LANGUAGE "Italian"
271 ; !insertmacro MUI_LANGUAGE "Dutch"
272 ; !insertmacro MUI_LANGUAGE "Greek"
273 ; !insertmacro MUI_LANGUAGE "Romanian"
274 ; !insertmacro MUI_LANGUAGE "Serbian"
275 ; !insertmacro MUI_LANGUAGE "SerbianLatin"
276 ; !insertmacro MUI_LANGUAGE "Arabic"
277 ; !insertmacro MUI_LANGUAGE "Portuguese"
278 ; !insertmacro MUI_LANGUAGE "Afrikaans"
279 ; !insertmacro MUI_LANGUAGE "Malay"
280 ; !insertmacro MUI_LANGUAGE "Indonesian"
283 ;--------------------------------
285 ;--------------------------------
288 !include "..\Translation\Blank.nsh"
291 !include "..\Translation\LameXP_DE.nsh"
294 !include "..\Translation\LameXP_ES.nsh"
297 !include "..\Translation\LameXP_RU.nsh"
300 !include "..\Translation\LameXP_UK.nsh"
303 !include "..\Translation\LameXP_PL.nsh"
306 !include "..\Translation\LameXP_HU.nsh"
309 ;--------------------------------
311 ;--------------------------------
313 !macro _UnattendedMode _a _b _t _f
314 !insertmacro _LOGICLIB_TEMP
315 ${StdUtils
.TestParameter
} $_LOGICLIB_TEMP "Update"
316 StrCmp "$_LOGICLIB_TEMP" "true" `${_t}` `${_f}`
318 !define UnattendedMode
`"" UnattendedMode ""`
320 !macro _ForcedMode _a _b _t _f
321 !insertmacro _LOGICLIB_TEMP
322 ${StdUtils
.TestParameter
} $_LOGICLIB_TEMP "Force"
323 StrCmp "$_LOGICLIB_TEMP" "true" `${_t}` `${_f}`
325 !define ForcedMode
`"" ForcedMode ""`
327 !macro _ValidFileName _a _b _t _f
328 !insertmacro _LOGICLIB_TEMP
329 ${StdUtils
.ValidFileName
} $_LOGICLIB_TEMP `${_b}`
330 StrCmp "$_LOGICLIB_TEMP" "ok" `${_t}` `${_f}`
332 !define ValidFileName
`"" ValidFileName`
335 ;--------------------------------
336 ;Installer initialization
337 ;--------------------------------
344 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "{2B3D1EBF-B3B6-4E93-92B9-6853029A7162}") i .r1 ?e'
347 MessageBox MB_ICONSTOP|
MB_TOPMOST "Sorry, the installer is already running!"
353 # Running on Windows NT family?
355 MessageBox MB_TOPMOST|
MB_ICONSTOP "Sorry, this application does *not* support Windows 9x/ME!"
356 ExecShell "open" "http://windows.microsoft.com/"
360 # Running on Windows XP or later?
361 ${If} ${AtMostWin2000}
362 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)."
363 ExecShell "open" "http://windows.microsoft.com/"
367 # If on Windows XP, is the required Service Pack installed?
369 ${IfNot} ${RunningX64} # Windows XP 32-Bit, requires Service Pack 3
370 ${AndIf} ${AtMostServicePack} 2
371 MessageBox MB_TOPMOST|
MB_ICONEXCLAMATION "This application requires Service Pack 3 for Windows XP.$\nPlease install the required Service Pack and retry!"
374 ${If} ${RunningX64} # Windows XP 64-Bit, requires Service Pack 2
375 ${AndIf} ${AtMostServicePack} 1
376 MessageBox MB_TOPMOST|
MB_ICONEXCLAMATION "This application requires Service Pack 2 for Windows XP x64.$\nPlease install the required Service Pack and retry!"
379 ${IfNot} ${UnattendedMode}
380 ${If} ${Cmd} `MessageBox MB_TOPMOST|MB_ICONEXCLAMATION|MB_OKCANCEL|MB_DEFBUTTON2 "It appears that you are still running Windows XP, which reached $\"end of life$\" in April 2014 and therefore will not receive any updates or bug fixes anymore - not even for critical security vulnerabilities! We highly recommend updating to a contemporary operating system.$\n$\nClick 'OK' to proceed with the installation, or click 'Cancel' to abort." IDCANCEL`
386 # Running on Windows Vista?
388 ${If} ${AtMostServicePack} 1
389 MessageBox MB_TOPMOST|
MB_ICONEXCLAMATION "This application requires Service Pack 2 for Windows Vista.$\nPlease install the required Service Pack and retry!"
392 ${IfNot} ${UnattendedMode}
393 ${If} ${Cmd} `MessageBox MB_TOPMOST|MB_ICONEXCLAMATION|MB_OKCANCEL|MB_DEFBUTTON2 "It appears that you are still running Windows Vista, which reached $\"end of life$\" in April 2017 and therefore will not receive any updates or bug fixes anymore - not even for critical security vulnerabilities! We highly recommend updating to a contemporary operating system.$\n$\nClick 'OK' to proceed with the installation, or click 'Cancel' to abort." IDCANCEL`
401 ${IfNot} ${UnattendedMode}
402 !insertmacro MUI_LANGDLL_DISPLAY
407 UserInfo::GetAccountType
410 MessageBox MB_ICONSTOP|
MB_TOPMOST "Your system requires administrative permissions in order to install this software."
411 SetErrorLevel
740 ;ERROR_ELEVATION_REQUIRED
417 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "{2B3D1EBF-B3B6-4E93-92B9-6853029A7162}") i .r1 ?e'
420 MessageBox MB_ICONSTOP|
MB_TOPMOST "Sorry, the un-installer is already running!"
424 ${IfNot} ${ForcedMode}
425 !insertmacro MUI_LANGDLL_DISPLAY
430 UserInfo::GetAccountType
433 MessageBox MB_ICONSTOP|
MB_TOPMOST "Your system requires administrative permissions in order to install this software."
434 SetErrorLevel
740 ;ERROR_ELEVATION_REQUIRED
440 ;--------------------------------
442 ;--------------------------------
445 StrCpy $0 $HWNDPARENT
446 System::Call "user32::SetWindowPos(i r0, i -1, i 0, i 0, i 0, i 0, i 3)"
450 Function un
.MyGuiInit
451 StrCpy $0 $HWNDPARENT
452 System::Call "user32::SetWindowPos(i r0, i -1, i 0, i 0, i 0, i 0, i 3)"
457 ;--------------------------------
458 ;Macros & Auxiliary Functions
459 ;--------------------------------
461 !macro PrintProgress Text
462 SetDetailsPrint textonly
463 DetailPrint '${Text}'
464 SetDetailsPrint listonly
468 !macro CreateWebLink ShortcutFile TargetURL
471 StrCpy $0 "${ShortcutFile}"
472 StrCpy $1 "${TargetURL}"
478 Function _CreateWebLink
480 SetFileAttributes "$0" FILE_ATTRIBUTE_NORMAL
481 DeleteINISec "$0" "DEFAULT"
482 DeleteINISec "$0" "InternetShortcut"
483 WriteINIStr "$0" "DEFAULT" "BASEURL" "$1"
484 WriteINIStr "$0" "InternetShortcut" "ORIGURL" "$1"
485 WriteINIStr "$0" "InternetShortcut" "URL" "$1"
486 WriteINIStr "$0" "InternetShortcut" "IconFile" "$SYSDIR\SHELL32.dll"
487 WriteINIStr "$0" "InternetShortcut" "IconIndex" "150"
489 SetFileAttributes "$0" FILE_ATTRIBUTE_READONLY
492 !macro GetExecutableName OutVar
493 ${StdUtils
.GetParameter
} ${OutVar} "Update" ""
494 ${StdUtils
.TrimStr
} ${OutVar}
495 ${If} "${OutVar}" ==
""
496 ${OrIfNot} ${ValidFileName} "${OutVar}"
497 StrCpy ${OutVar} "LameXP.exe"
501 !macro DisableNextButton TmpVar
502 GetDlgItem
${TmpVar} $HWNDPARENT 1
503 EnableWindow
${TmpVar} 0
506 !macro DisableBackButton TmpVar
507 GetDlgItem
${TmpVar} $HWNDPARENT 3
508 EnableWindow
${TmpVar} 0
511 !macro CleanUpFiles options
512 Delete ${options} "$INSTDIR\Changelog.htm"
513 Delete ${options} "$INSTDIR\Changelog.html"
514 Delete ${options} "$INSTDIR\Contributors.txt"
515 Delete ${options} "$INSTDIR\Copying.txt"
516 Delete ${options} "$INSTDIR\FAQ.html"
517 Delete ${options} "$INSTDIR\Howto.html"
518 Delete ${options} "$INSTDIR\LameEnc.sys"
519 Delete ${options} "$INSTDIR\LameXP*.exe"
520 Delete ${options} "$INSTDIR\LameXP*.exe.sig"
521 Delete ${options} "$INSTDIR\LameXP*.rcc"
522 Delete ${options} "$INSTDIR\LameXP*.VisualElementsManifest.xml"
523 Delete ${options} "$INSTDIR\LameXP*.tag"
524 Delete ${options} "$INSTDIR\License.txt"
525 Delete ${options} "$INSTDIR\Manual.html"
526 Delete ${options} "$INSTDIR\Readme.htm"
527 Delete ${options} "$INSTDIR\Readme.html"
528 Delete ${options} "$INSTDIR\ReadMe.txt"
529 Delete ${options} "$INSTDIR\PRE_RELEASE_INFO.txt"
530 Delete ${options} "$INSTDIR\Settings.cfg"
531 Delete ${options} "$INSTDIR\Translate.html"
532 Delete ${options} "$INSTDIR\Uninstall.exe"
533 Delete ${options} "$INSTDIR\Qt*.dll"
534 Delete ${options} "$INSTDIR\MUtils*.dll"
535 Delete ${options} "$INSTDIR\msvcr*.dll"
536 Delete ${options} "$INSTDIR\msvcp*.dll"
537 Delete ${options} "$INSTDIR\concrt*.dll"
538 Delete ${options} "$INSTDIR\vcruntime*.dll"
539 Delete ${options} "$INSTDIR\vccorlib*.dll"
540 Delete ${options} "$INSTDIR\api-ms-*.dll"
541 Delete ${options} "$INSTDIR\ucrtbase.dll"
543 RMDir /r
${options} "$INSTDIR\cache"
544 RMDir /r
${options} "$INSTDIR\img"
545 RMDir /r
${options} "$INSTDIR\imageformats"
546 RMDir /r
${options} "$INSTDIR\redist"
549 ;--------------------------------
551 ;--------------------------------
554 SetShellVarContext all
555 SetOutPath "$INSTDIR"
558 Section "-Clean Up Old Cruft"
559 !insertmacro PrintProgress
"$(LAMEXP_LANG_STATUS_CLEANUP)"
560 !insertmacro CleanUpFiles
""
563 Section "!Install Files"
564 !insertmacro PrintProgress
"$(LAMEXP_LANG_STATUS_INSTFILES)"
567 !insertmacro GetExecutableName
$R0
569 Delete "$INSTDIR\$R0"
572 MessageBox MB_TOPMOST|
MB_ICONSTOP|
MB_RETRYCANCEL 'Could not delete old "$R0" file. Is LameXP still running?' IDRETRY DeleteOldBinary
573 Abort "Could not delete old binary!"
576 File /a
`/oname=$R0` `${LAMEXP_SOURCE_PATH}\LameXP.exe`
577 File /nonfatal
/a
/r
`${LAMEXP_SOURCE_PATH}\*.dll`
578 File /nonfatal
/a
/r
`${LAMEXP_SOURCE_PATH}\*.rcc`
580 ${StdUtils
.GetFileNamePart
} $R1 "$R0"
581 File /a
`/oname=$R1.VisualElementsManifest.xml` `${LAMEXP_SOURCE_PATH}\LameXP.VisualElementsManifest.xml`
582 File /a
`/oname=$R1.tag` `${LAMEXP_SOURCE_PATH}\LameXP.tag`
584 File /a
/r
`${LAMEXP_SOURCE_PATH}\*.txt`
585 File /a
/r
`${LAMEXP_SOURCE_PATH}\*.html`
586 File /a
/r
`${LAMEXP_SOURCE_PATH}\*.png`
589 # Section "-Install VCRedist"
590 # !insertmacro PrintProgress "$(LAMEXP_LANG_STATUS_VCREDIST)"
591 # File /a `/oname=$PLUGINSDIR\vcredist_x86.exe` `${LAMEXP_SOURCE_PATH}\redist\vcredist_x86.exe`
592 # ExecWait '"$PLUGINSDIR\vcredist_x86.exe" /install /passive /norestart'
595 Section "-Write Uninstaller"
596 !insertmacro PrintProgress
"$(LAMEXP_LANG_STATUS_MAKEUNINST)"
597 WriteUninstaller "$INSTDIR\Uninstall.exe"
600 Section "-Create Shortcuts"
601 !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
602 !insertmacro PrintProgress
"$(LAMEXP_LANG_STATUS_SHORTCUTS)"
603 CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
605 SetShellVarContext current
607 Delete "$SMPROGRAMS\$StartMenuFolder\*.lnk"
608 Delete "$SMPROGRAMS\$StartMenuFolder\*.pif"
609 Delete "$SMPROGRAMS\$StartMenuFolder\*.url"
611 SetShellVarContext all
613 Delete "$SMPROGRAMS\$StartMenuFolder\*.lnk"
614 Delete "$SMPROGRAMS\$StartMenuFolder\*.pif"
615 Delete "$SMPROGRAMS\$StartMenuFolder\*.url"
617 !insertmacro GetExecutableName
$R0
619 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\LameXP.lnk" "$INSTDIR\$R0" "" "$INSTDIR\$R0" 0
620 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(LAMEXP_LANG_LINK_LICENSE).lnk" "$INSTDIR\License.txt"
621 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(LAMEXP_LANG_LINK_CHANGELOG).lnk" "$INSTDIR\Changelog.html"
622 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(LAMEXP_LANG_LINK_TRANSLATE).lnk" "$INSTDIR\Translate.html"
623 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(LAMEXP_LANG_LINK_MANUAL).lnk" "$INSTDIR\Manual.html"
624 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(LAMEXP_LANG_LINK_UNINSTALL).lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0
626 !insertmacro CreateWebLink
"$SMPROGRAMS\$StartMenuFolder\Official LameXP Homepage.url" "${MyWebSite}"
627 !insertmacro CreateWebLink
"$SMPROGRAMS\$StartMenuFolder\Doom9's Forum.url" "http://forum.doom9.org/"
628 !insertmacro CreateWebLink
"$SMPROGRAMS\$StartMenuFolder\Bug Tracker.url" "https://github.com/lordmulder/LameXP/issues"
629 !insertmacro CreateWebLink
"$SMPROGRAMS\$StartMenuFolder\RareWares.org.url" "http://rarewares.org/"
630 !insertmacro CreateWebLink
"$SMPROGRAMS\$StartMenuFolder\Hydrogenaudio Forums.url" "http://www.hydrogenaudio.org/"
632 ${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\LameXP.lnk"
633 ${StdUtils
.InvokeShellVerb
} $R1 "$SMPROGRAMS\$StartMenuFolder" "LameXP.lnk" ${StdUtils
.Const
.ShellVerb
.PinToTaskbar
}
634 DetailPrint 'Pin: "$SMPROGRAMS\$StartMenuFolder\LameXP.lnk" -> $R1'
636 !insertmacro MUI_STARTMENU_WRITE_END
639 Section "-Update Registry"
640 !insertmacro PrintProgress
"$(LAMEXP_LANG_STATUS_REGISTRY)"
642 !insertmacro GetExecutableName
$R0
643 WriteRegStr HKLM "${MyRegPath}" "InstallLocation" "$INSTDIR"
644 WriteRegStr HKLM "${MyRegPath}" "ExecutableName" "$R0"
645 WriteRegStr HKLM "${MyRegPath}" "DisplayIcon" "$INSTDIR\$R0,0"
646 WriteRegStr HKLM "${MyRegPath}" "UninstallString" '"$INSTDIR\Uninstall.exe"'
647 WriteRegStr HKLM "${MyRegPath}" "DisplayName" "LameXP v${LAMEXP_VERSION}"
648 WriteRegStr HKLM "${MyRegPath}" "Publisher" "LoRd_MuldeR <mulder2@gmx.de>"
649 WriteRegStr HKLM "${MyRegPath}" "DisplayVersion" "${LAMEXP_VERSION} ${LAMEXP_INSTTYPE}-${LAMEXP_PATCH} [Build #${LAMEXP_BUILD}]"
650 WriteRegStr HKLM "${MyRegPath}" "URLInfoAbout" "${MyWebSite}"
651 WriteRegStr HKLM "${MyRegPath}" "URLUpdateInfo" "${MyWebSite}"
653 DeleteRegKey HKCU "${AppPaths}\LameXP.exe"
654 WriteRegStr HKLM "${AppPaths}\LameXP.exe" "" "$INSTDIR\$R0"
655 WriteRegStr HKLM "${AppPaths}\LameXP.exe" "Path" "$INSTDIR"
659 !insertmacro PrintProgress
"$(MUI_TEXT_FINISH_TITLE)."
661 !ifdef LAMEXP_IS_PRERELEASE
662 ${If} ${FileExists} "$INSTDIR\PRE_RELEASE_INFO.txt"
663 ${StdUtils
.ExecShellAsUser
} $R1 "$INSTDIR\PRE_RELEASE_INFO.txt" "open" ""
667 ${IfThen} ${UnattendedMode} ${|
} SetAutoClose true
${|
}
671 ;--------------------------------
673 ;--------------------------------
677 !insertmacro PrintProgress
"$(LAMEXP_LANG_STATUS_UNINSTALL)"
683 !insertmacro MUI_STARTMENU_GETFOLDER Application
$StartMenuFolder
684 ${IfNot} "$StartMenuFolder" ==
""
685 SetShellVarContext current
686 ${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\LameXP.lnk"
687 ${StdUtils
.InvokeShellVerb
} $R1 "$SMPROGRAMS\$StartMenuFolder" "LameXP.lnk" ${StdUtils
.Const
.ShellVerb
.UnpinFromTaskbar
}
688 DetailPrint 'Unpin: "$SMPROGRAMS\$StartMenuFolder\LameXP.lnk" -> $R1'
690 ${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\*.*"
691 Delete /REBOOTOK
"$SMPROGRAMS\$StartMenuFolder\*.lnk"
692 Delete /REBOOTOK
"$SMPROGRAMS\$StartMenuFolder\*.url"
693 RMDir "$SMPROGRAMS\$StartMenuFolder"
696 SetShellVarContext all
697 ${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\LameXP.lnk"
698 ${StdUtils
.InvokeShellVerb
} $R1 "$SMPROGRAMS\$StartMenuFolder" "LameXP.lnk" ${StdUtils
.Const
.ShellVerb
.UnpinFromTaskbar
}
699 DetailPrint 'Unpin: "$SMPROGRAMS\$StartMenuFolder\LameXP.lnk" -> $R1'
701 ${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\*.*"
702 Delete /REBOOTOK
"$SMPROGRAMS\$StartMenuFolder\*.lnk"
703 Delete /REBOOTOK
"$SMPROGRAMS\$StartMenuFolder\*.url"
704 RMDir "$SMPROGRAMS\$StartMenuFolder"
712 ReadRegStr $R0 HKLM "${MyRegPath}" "ExecutableName"
713 ${IfThen} "$R0" ==
"" ${|
} StrCpy $R0 "LameXP.exe" ${|
}
714 ExecWait '"$INSTDIR\$R0" --uninstall'
716 Delete /REBOOTOK
"$INSTDIR\$R0"
717 !insertmacro CleanUpFiles
/REBOOTOK
724 DeleteRegKey HKLM "${MyRegPath}"
725 DeleteRegKey HKCU "${MyRegPath}"
727 DeleteRegKey HKLM "SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{54dcbccb-c905-46dc-b6e6-48563d0e9e55}"
728 DeleteRegKey HKCU "SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{54dcbccb-c905-46dc-b6e6-48563d0e9e55}"
730 DeleteRegKey HKLM "${AppPaths}\LameXP.exe"
731 DeleteRegKey HKCU "${AppPaths}\LameXP.exe"
733 MessageBox MB_YESNO|
MB_TOPMOST "$(LAMEXP_LANG_UNINST_PERSONAL)" IDNO +3
734 Delete "$LOCALAPPDATA\LoRd_MuldeR\LameXP - Audio Encoder Front-End\config.ini"
735 Delete "$INSTDIR\*.ini"
737 !insertmacro PrintProgress
"$(MUI_UNTEXT_FINISH_TITLE)."
741 ;--------------------------------
742 ;Check For Update Mode
743 ;--------------------------------
745 Function SkipIfUnattended
746 ${IfThen} ${UnattendedMode} ${|
} Abort ${|
}
749 Function CheckForUpdate
750 ${If} "$INSTDIR" ==
""
751 ${OrIf} "$INSTDIR" ==
"$EXEDIR"
752 ${OrIfNot} ${FileExists} "$INSTDIR\LameXP.exe"
756 FindWindow $R0 "#32770" "" $HWNDPARENT
757 GetDlgItem
$R1 $R0 1019
760 FindWindow $R0 "#32770" "" $HWNDPARENT
761 GetDlgItem
$R1 $R0 1001
765 Function un
.CheckForcedUninstall
766 ${IfThen} ${ForcedMode} ${|
} Abort ${|
}
770 ;--------------------------------
771 ;Check For Pre-Release
772 ;--------------------------------
774 Function CheckForPreRelease
775 !ifdef LAMEXP_IS_PRERELEASE
776 ${IfNot} ${UnattendedMode}
777 MessageBox MB_TOPMOST|
MB_ICONEXCLAMATION|
MB_OKCANCEL "$(LAMEXP_LANG_PRERELEASE_WARNING)" /SD
IDOK IDOK +2
784 ;--------------------------------
786 ;--------------------------------
788 !macro _LockedListShow uinst
789 !insertmacro MUI_HEADER_TEXT
"$(LAMEXP_LANG_LOCKEDLIST_HEADER)" "$(LAMEXP_LANG_LOCKEDLIST_TEXT)"
790 ${If} ${UnattendedMode}
791 !insertmacro DisableBackButton
$R0
795 File /oname=
$PLUGINSDIR\LockedList64
.dll
`${NSISDIR}\Plugins\LockedList64.dll`
797 !insertmacro GetExecutableName
$R0
798 LockedList::AddModule
"\$R0"
799 ${If} "$R0" !=
"LameXP.exe"
800 LockedList::AddModule
"\LameXP.exe"
802 LockedList::AddModule
"\Uninstall.exe"
804 LockedList::AddModule
"\Au_.exe"
806 #LockedList::AddFolder "$INSTDIR"
807 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)"
811 Function LockedListShow
812 !insertmacro _LockedListShow
0
815 Function un
.LockedListShow
816 !insertmacro _LockedListShow
1
820 ;--------------------------------
822 ;--------------------------------
824 Function RunAppFunction
825 !insertmacro DisableNextButton
$R0
826 !insertmacro GetExecutableName
$R0
827 ${StdUtils
.ExecShellAsUser
} $R1 "$INSTDIR" "explore" ""
828 ${StdUtils
.ExecShellAsUser
} $R1 "$INSTDIR\$R0" "open" "--first-run"
831 Function ShowReadmeFunction
832 !insertmacro DisableNextButton
$R0
833 ${StdUtils
.ExecShellAsUser
} $R1 "$INSTDIR\Manual.html" "open" ""
836 Function .onInstSuccess
837 ${If} ${UnattendedMode}
838 !insertmacro GetExecutableName
$R0
839 ${StdUtils
.ExecShellAsUser
} $R1 "$INSTDIR\$R0" "open" "--first-run"