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}" '"..\..\..\Prerequisites\MSVC\redist\bin\mt.exe" -manifest "setup.manifest" -outputresource:"${PACKHDRTEMP};1" && "..\..\..\Prerequisites\UPX\upx.exe" --brute "${PACKHDRTEMP}"'
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
120 ;--------------------------------
122 ;--------------------------------
124 ReserveFile
"${NSISDIR}\Plugins\Aero.dll"
125 ReserveFile
"${NSISDIR}\Plugins\LangDLL.dll"
126 ReserveFile
"${NSISDIR}\Plugins\LockedList.dll"
127 ReserveFile
"${NSISDIR}\Plugins\LockedList64.dll"
128 ReserveFile
"${NSISDIR}\Plugins\nsDialogs.dll"
129 ReserveFile
"${NSISDIR}\Plugins\nsExec.dll"
130 ReserveFile
"${NSISDIR}\Plugins\StartMenu.dll"
131 ReserveFile
"${NSISDIR}\Plugins\StdUtils.dll"
132 ReserveFile
"${NSISDIR}\Plugins\System.dll"
133 ReserveFile
"${NSISDIR}\Plugins\UserInfo.dll"
136 ;--------------------------------
138 ;--------------------------------
143 ;--------------------------------
145 ;--------------------------------
147 !searchreplace PRODUCT_VERSION_DATE
"${LAMEXP_DATE}" "-" "."
148 VIProductVersion
"${PRODUCT_VERSION_DATE}.${LAMEXP_BUILD}"
150 VIAddVersionKey
"Author" "LoRd_MuldeR <mulder2@gmx.de>"
151 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."
152 VIAddVersionKey
"CompanyName" "Free Software Foundation"
153 VIAddVersionKey
"FileDescription" "LameXP v${LAMEXP_VERSION} ${LAMEXP_INSTTYPE}-${LAMEXP_PATCH} [Build #${LAMEXP_BUILD}]"
154 VIAddVersionKey
"FileVersion" "${PRODUCT_VERSION_DATE}.${LAMEXP_BUILD} (${LAMEXP_VERSION})"
155 VIAddVersionKey
"LegalCopyright" "Copyright 2004-2016 LoRd_MuldeR"
156 VIAddVersionKey
"LegalTrademarks" "GNU"
157 VIAddVersionKey
"OriginalFilename" "LameXP.${LAMEXP_DATE}.exe"
158 VIAddVersionKey
"ProductName" "LameXP - Audio Encoder Frontend"
159 VIAddVersionKey
"ProductVersion" "${LAMEXP_VERSION}, Build #${LAMEXP_BUILD} (${LAMEXP_DATE})"
160 VIAddVersionKey
"Website" "${MyWebSite}"
163 ;--------------------------------
164 ;MUI2 Interface Settings
165 ;--------------------------------
167 !define MUI_ABORTWARNING
168 !define MUI_STARTMENUPAGE_REGISTRY_ROOT
HKLM
169 !define MUI_STARTMENUPAGE_REGISTRY_KEY
"${MyRegPath}"
170 !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME
"StartmenuFolder"
171 !define MUI_LANGDLL_REGISTRY_ROOT
HKLM
172 !define MUI_LANGDLL_REGISTRY_KEY
"${MyRegPath}"
173 !define MUI_LANGDLL_REGISTRY_VALUENAME
"SetupLanguage"
174 !define MUI_STARTMENUPAGE_DEFAULTFOLDER
"LameXP v${LAMEXP_VERSION}"
175 !define MUI_FINISHPAGE_NOAUTOCLOSE
176 !define MUI_UNFINISHPAGE_NOAUTOCLOSE
177 !define MUI_FINISHPAGE_RUN
178 !define MUI_FINISHPAGE_RUN_FUNCTION RunAppFunction
179 !define MUI_FINISHPAGE_SHOWREADME
180 !define MUI_FINISHPAGE_SHOWREADME_FUNCTION ShowReadmeFunction
181 !define MUI_FINISHPAGE_LINK
${MyWebSite}
182 !define MUI_FINISHPAGE_LINK_LOCATION
${MyWebSite}
183 !define MUI_ICON
"${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico"
184 !define MUI_UNICON
"${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall.ico"
185 !define MUI_WELCOMEFINISHPAGE_BITMAP
"wizard.bmp"
186 !define MUI_UNWELCOMEFINISHPAGE_BITMAP
"wizard-un.bmp"
187 !define MUI_HEADERIMAGE
188 !define MUI_HEADERIMAGE_BITMAP
"header.bmp"
189 !define MUI_HEADERIMAGE_UNBITMAP
"header-un.bmp"
190 !define MUI_LANGDLL_ALLLANGUAGES
191 !define MUI_CUSTOMFUNCTION_GUIINIT MyGuiInit
192 !define MUI_CUSTOMFUNCTION_UNGUIINIT un
.MyGuiInit
193 !define MUI_LANGDLL_ALWAYSSHOW
196 ;--------------------------------
197 ;MUI2 Pages (Installer)
198 ;--------------------------------
201 !define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfUnattended
202 !define MUI_PAGE_CUSTOMFUNCTION_LEAVE CheckForPreRelease
203 !define MUI_WELCOMEPAGE_TITLE_3LINES
204 !define MUI_FINISHPAGE_TITLE_3LINES
205 !insertmacro MUI_PAGE_WELCOME
208 !define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfUnattended
209 !insertmacro MUI_PAGE_LICENSE
"license.rtf"
212 !define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfUnattended
213 !define MUI_PAGE_CUSTOMFUNCTION_SHOW CheckForUpdate
214 !insertmacro MUI_PAGE_DIRECTORY
217 !define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfUnattended
218 !insertmacro MUI_PAGE_STARTMENU Application
$StartMenuFolder
221 Page Custom LockedListShow
224 !insertmacro MUI_PAGE_INSTFILES
227 !define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfUnattended
228 !insertmacro MUI_PAGE_FINISH
231 ;--------------------------------
232 ;MUI2 Pages (Uninstaller)
233 ;--------------------------------
236 !define MUI_WELCOMEPAGE_TITLE_3LINES
237 !define MUI_FINISHPAGE_TITLE_3LINES
238 !define MUI_PAGE_CUSTOMFUNCTION_PRE un
.CheckForcedUninstall
239 !insertmacro MUI_UNPAGE_WELCOME
242 !define MUI_PAGE_CUSTOMFUNCTION_PRE un
.CheckForcedUninstall
243 !insertmacro MUI_UNPAGE_CONFIRM
246 UninstPage Custom un
.LockedListShow
249 !insertmacro MUI_UNPAGE_INSTFILES
252 !define MUI_PAGE_CUSTOMFUNCTION_PRE un
.CheckForcedUninstall
253 !insertmacro MUI_UNPAGE_FINISH
256 ;--------------------------------
258 ;--------------------------------
260 !insertmacro MUI_LANGUAGE
"English" ;first language is the default language
261 !insertmacro MUI_LANGUAGE
"German"
262 !insertmacro MUI_LANGUAGE
"Spanish"
263 !insertmacro MUI_LANGUAGE
"Russian"
264 !insertmacro MUI_LANGUAGE
"Ukrainian"
265 !insertmacro MUI_LANGUAGE
"Polish"
266 !insertmacro MUI_LANGUAGE
"Hungarian"
268 ; !insertmacro MUI_LANGUAGE "French"
269 ; !insertmacro MUI_LANGUAGE "SpanishInternational"
270 ; !insertmacro MUI_LANGUAGE "SimpChinese"
271 ; !insertmacro MUI_LANGUAGE "TradChinese"
272 ; !insertmacro MUI_LANGUAGE "Japanese"
273 ; !insertmacro MUI_LANGUAGE "Italian"
274 ; !insertmacro MUI_LANGUAGE "Dutch"
275 ; !insertmacro MUI_LANGUAGE "Greek"
276 ; !insertmacro MUI_LANGUAGE "Romanian"
277 ; !insertmacro MUI_LANGUAGE "Serbian"
278 ; !insertmacro MUI_LANGUAGE "SerbianLatin"
279 ; !insertmacro MUI_LANGUAGE "Arabic"
280 ; !insertmacro MUI_LANGUAGE "Portuguese"
281 ; !insertmacro MUI_LANGUAGE "Afrikaans"
282 ; !insertmacro MUI_LANGUAGE "Malay"
283 ; !insertmacro MUI_LANGUAGE "Indonesian"
286 ;--------------------------------
288 ;--------------------------------
291 !include "..\Translation\Blank.nsh"
294 !include "..\Translation\LameXP_DE.nsh"
297 !include "..\Translation\LameXP_ES.nsh"
300 !include "..\Translation\LameXP_RU.nsh"
303 !include "..\Translation\LameXP_UK.nsh"
306 !include "..\Translation\LameXP_PL.nsh"
309 !include "..\Translation\LameXP_HU.nsh"
312 ;--------------------------------
314 ;--------------------------------
316 !macro _UnattendedMode _a _b _t _f
317 !insertmacro _LOGICLIB_TEMP
318 ${StdUtils
.TestParameter
} $_LOGICLIB_TEMP "Update"
319 StrCmp "$_LOGICLIB_TEMP" "true" `${_t}` `${_f}`
321 !define UnattendedMode
`"" UnattendedMode ""`
323 !macro _ForcedMode _a _b _t _f
324 !insertmacro _LOGICLIB_TEMP
325 ${StdUtils
.TestParameter
} $_LOGICLIB_TEMP "Force"
326 StrCmp "$_LOGICLIB_TEMP" "true" `${_t}` `${_f}`
328 !define ForcedMode
`"" ForcedMode ""`
330 !macro _ValidFileName _a _b _t _f
331 !insertmacro _LOGICLIB_TEMP
332 ${StdUtils
.ValidFileName
} $_LOGICLIB_TEMP `${_b}`
333 StrCmp "$_LOGICLIB_TEMP" "ok" `${_t}` `${_f}`
335 !define ValidFileName
`"" ValidFileName`
338 ;--------------------------------
339 ;Installer initialization
340 ;--------------------------------
347 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "{2B3D1EBF-B3B6-4E93-92B9-6853029A7162}") i .r1 ?e'
350 MessageBox MB_ICONSTOP|
MB_TOPMOST "Sorry, the installer is already running!"
356 # Running on Windows NT family?
358 MessageBox MB_TOPMOST|
MB_ICONSTOP "Sorry, this application does *not* support Windows 9x or Windows ME!"
359 ExecShell "open" "http://windows.microsoft.com/"
363 # Running on Windows XP or later?
364 ${If} ${AtMostWin2000}
365 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)."
366 ExecShell "open" "http://windows.microsoft.com/"
370 # If on Windows XP, is the required Service Pack installed?
372 ${IfNot} ${RunningX64} # Windows XP 32-Bit, requires Service Pack 3
373 ${AndIf} ${AtMostServicePack} 2
374 MessageBox MB_TOPMOST|
MB_ICONEXCLAMATION "This application requires Windows XP with Service Pack 3 installed!"
375 ${If} ${Cmd} `MessageBox MB_TOPMOST|MB_ICONQUESTION|MB_YESNO "Do you want to download Service Pack 3 for Windows XP now?" IDYES`
376 ExecShell "open" "http://www.microsoft.com/en-us/download/details.aspx?id=24"
378 ExecShell "open" "http://windowsupdate.microsoft.com/"
382 ${If} ${RunningX64} # Windows XP 64-Bit, requires Service Pack 2
383 ${AndIf} ${AtMostServicePack} 1
384 MessageBox MB_TOPMOST|
MB_ICONEXCLAMATION "This application requires Windows XP x64 Edition with Service Pack 2 installed!"
385 ${If} ${Cmd} `MessageBox MB_TOPMOST|MB_ICONQUESTION|MB_YESNO "Do you want to download Service Pack 2 for Windows XP x64 Edition now?" IDYES`
386 ExecShell "open" "http://www.microsoft.com/en-us/download/details.aspx?id=17791"
388 ExecShell "open" "http://windowsupdate.microsoft.com/"
396 ${IfNot} ${UnattendedMode}
397 !insertmacro MUI_LANGDLL_DISPLAY
402 UserInfo::GetAccountType
405 MessageBox MB_ICONSTOP|
MB_TOPMOST "Your system requires administrative permissions in order to install this software."
406 SetErrorLevel
740 ;ERROR_ELEVATION_REQUIRED
412 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "{2B3D1EBF-B3B6-4E93-92B9-6853029A7162}") i .r1 ?e'
415 MessageBox MB_ICONSTOP|
MB_TOPMOST "Sorry, the un-installer is already running!"
419 ${IfNot} ${ForcedMode}
420 !insertmacro MUI_LANGDLL_DISPLAY
425 UserInfo::GetAccountType
428 MessageBox MB_ICONSTOP|
MB_TOPMOST "Your system requires administrative permissions in order to install this software."
429 SetErrorLevel
740 ;ERROR_ELEVATION_REQUIRED
435 ;--------------------------------
437 ;--------------------------------
440 StrCpy $0 $HWNDPARENT
441 System::Call "user32::SetWindowPos(i r0, i -1, i 0, i 0, i 0, i 0, i 3)"
445 Function un
.MyGuiInit
446 StrCpy $0 $HWNDPARENT
447 System::Call "user32::SetWindowPos(i r0, i -1, i 0, i 0, i 0, i 0, i 3)"
452 ;--------------------------------
453 ;Macros & Auxiliary Functions
454 ;--------------------------------
456 !macro PrintProgress Text
457 SetDetailsPrint textonly
458 DetailPrint '${Text}'
459 SetDetailsPrint listonly
463 !macro CreateWebLink ShortcutFile TargetURL
466 StrCpy $0 "${ShortcutFile}"
467 StrCpy $1 "${TargetURL}"
473 Function _CreateWebLink
475 SetFileAttributes "$0" FILE_ATTRIBUTE_NORMAL
476 DeleteINISec "$0" "DEFAULT"
477 DeleteINISec "$0" "InternetShortcut"
478 WriteINIStr "$0" "DEFAULT" "BASEURL" "$1"
479 WriteINIStr "$0" "InternetShortcut" "ORIGURL" "$1"
480 WriteINIStr "$0" "InternetShortcut" "URL" "$1"
481 WriteINIStr "$0" "InternetShortcut" "IconFile" "$SYSDIR\SHELL32.dll"
482 WriteINIStr "$0" "InternetShortcut" "IconIndex" "150"
484 SetFileAttributes "$0" FILE_ATTRIBUTE_READONLY
487 !macro GetExecutableName OutVar
488 ${StdUtils
.GetParameter
} ${OutVar} "Update" ""
489 ${StdUtils
.TrimStr
} ${OutVar}
490 ${If} "${OutVar}" ==
""
491 ${OrIfNot} ${ValidFileName} "${OutVar}"
492 StrCpy ${OutVar} "LameXP.exe"
496 !macro DisableNextButton TmpVar
497 GetDlgItem
${TmpVar} $HWNDPARENT 1
498 EnableWindow
${TmpVar} 0
501 !macro DisableBackButton TmpVar
502 GetDlgItem
${TmpVar} $HWNDPARENT 3
503 EnableWindow
${TmpVar} 0
506 !macro CleanUpFiles options
507 Delete ${options} "$INSTDIR\Changelog.htm"
508 Delete ${options} "$INSTDIR\Changelog.html"
509 Delete ${options} "$INSTDIR\Contributors.txt"
510 Delete ${options} "$INSTDIR\Copying.txt"
511 Delete ${options} "$INSTDIR\FAQ.html"
512 Delete ${options} "$INSTDIR\Howto.html"
513 Delete ${options} "$INSTDIR\LameEnc.sys"
514 Delete ${options} "$INSTDIR\LameXP.exe"
515 Delete ${options} "$INSTDIR\LameXP.exe.sig"
516 Delete ${options} "$INSTDIR\LameXP-Portable.exe"
517 Delete ${options} "$INSTDIR\License.txt"
518 Delete ${options} "$INSTDIR\Manual.html"
519 Delete ${options} "$INSTDIR\Readme.htm"
520 Delete ${options} "$INSTDIR\ReadMe.txt"
521 Delete ${options} "$INSTDIR\PRE_RELEASE_INFO.txt"
522 Delete ${options} "$INSTDIR\Settings.cfg"
523 Delete ${options} "$INSTDIR\Translate.html"
524 Delete ${options} "$INSTDIR\Uninstall.exe"
525 Delete ${options} "$INSTDIR\Qt*.dll"
526 Delete ${options} "$INSTDIR\MUtils*.dll"
527 Delete ${options} "$INSTDIR\msvcr*.dll"
528 Delete ${options} "$INSTDIR\msvcp*.dll"
529 Delete ${options} "$INSTDIR\concrt*.dll"
530 Delete ${options} "$INSTDIR\vcruntime*.dll"
531 Delete ${options} "$INSTDIR\vccorlib*.dll"
532 Delete ${options} "$INSTDIR\api-ms-*.dll"
533 Delete ${options} "$INSTDIR\ucrtbase.dll"
535 RMDir /r
${options} "$INSTDIR\cache"
536 RMDir /r
${options} "$INSTDIR\img"
537 RMDir /r
${options} "$INSTDIR\imageformats"
538 RMDir /r
${options} "$INSTDIR\redist"
541 ;--------------------------------
543 ;--------------------------------
546 SetShellVarContext all
547 SetOutPath "$INSTDIR"
550 Section "-Clean Up Old Cruft"
551 !insertmacro PrintProgress
"$(LAMEXP_LANG_STATUS_CLEANUP)"
552 !insertmacro CleanUpFiles
""
555 Section "!Install Files"
556 !insertmacro PrintProgress
"$(LAMEXP_LANG_STATUS_INSTFILES)"
559 !insertmacro GetExecutableName
$R0
561 Delete "$INSTDIR\$R0"
564 MessageBox MB_TOPMOST|
MB_ICONSTOP|
MB_RETRYCANCEL 'Could not delete old "$R0" file. Is LameXP still running?' IDRETRY DeleteOldBinary
565 Abort "Could not delete old binary!"
568 File /a
`/oname=$R0` `${LAMEXP_SOURCE_PATH}\LameXP.exe`
569 File /nonfatal
/a
/r
`${LAMEXP_SOURCE_PATH}\*.dll`
571 File /a
/r
`${LAMEXP_SOURCE_PATH}\*.txt`
572 File /a
/r
`${LAMEXP_SOURCE_PATH}\*.html`
573 File /a
/r
`${LAMEXP_SOURCE_PATH}\*.png`
576 # Section "-Install VCRedist"
577 # !insertmacro PrintProgress "$(LAMEXP_LANG_STATUS_VCREDIST)"
578 # File /a `/oname=$PLUGINSDIR\vcredist_x86.exe` `${LAMEXP_SOURCE_PATH}\redist\vcredist_x86.exe`
579 # ExecWait '"$PLUGINSDIR\vcredist_x86.exe" /install /passive /norestart'
582 Section "-Write Uninstaller"
583 !insertmacro PrintProgress
"$(LAMEXP_LANG_STATUS_MAKEUNINST)"
584 WriteUninstaller "$INSTDIR\Uninstall.exe"
587 Section "-Create Shortcuts"
588 !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
589 !insertmacro PrintProgress
"$(LAMEXP_LANG_STATUS_SHORTCUTS)"
590 CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
592 SetShellVarContext current
594 Delete "$SMPROGRAMS\$StartMenuFolder\*.lnk"
595 Delete "$SMPROGRAMS\$StartMenuFolder\*.pif"
596 Delete "$SMPROGRAMS\$StartMenuFolder\*.url"
598 SetShellVarContext all
600 Delete "$SMPROGRAMS\$StartMenuFolder\*.lnk"
601 Delete "$SMPROGRAMS\$StartMenuFolder\*.pif"
602 Delete "$SMPROGRAMS\$StartMenuFolder\*.url"
604 !insertmacro GetExecutableName
$R0
606 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\LameXP.lnk" "$INSTDIR\$R0" "" "$INSTDIR\$R0" 0
607 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(LAMEXP_LANG_LINK_LICENSE).lnk" "$INSTDIR\License.txt"
608 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(LAMEXP_LANG_LINK_CHANGELOG).lnk" "$INSTDIR\Changelog.html"
609 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(LAMEXP_LANG_LINK_TRANSLATE).lnk" "$INSTDIR\Translate.html"
610 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(LAMEXP_LANG_LINK_MANUAL).lnk" "$INSTDIR\Manual.html"
611 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(LAMEXP_LANG_LINK_UNINSTALL).lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0
613 !insertmacro CreateWebLink
"$SMPROGRAMS\$StartMenuFolder\Official LameXP Homepage.url" "${MyWebSite}"
614 !insertmacro CreateWebLink
"$SMPROGRAMS\$StartMenuFolder\Doom9's Forum.url" "http://forum.doom9.org/"
615 !insertmacro CreateWebLink
"$SMPROGRAMS\$StartMenuFolder\Bug Tracker.url" "https://github.com/lordmulder/LameXP/issues"
616 !insertmacro CreateWebLink
"$SMPROGRAMS\$StartMenuFolder\RareWares.org.url" "http://rarewares.org/"
617 !insertmacro CreateWebLink
"$SMPROGRAMS\$StartMenuFolder\Hydrogenaudio Forums.url" "http://www.hydrogenaudio.org/"
619 ${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\LameXP.lnk"
620 ${StdUtils
.InvokeShellVerb
} $R1 "$SMPROGRAMS\$StartMenuFolder" "LameXP.lnk" ${StdUtils
.Const
.ShellVerb
.PinToTaskbar
}
621 DetailPrint 'Pin: "$SMPROGRAMS\$StartMenuFolder\LameXP.lnk" -> $R1'
623 !insertmacro MUI_STARTMENU_WRITE_END
626 Section "-Update Registry"
627 !insertmacro PrintProgress
"$(LAMEXP_LANG_STATUS_REGISTRY)"
629 !insertmacro GetExecutableName
$R0
630 WriteRegStr HKLM "${MyRegPath}" "InstallLocation" "$INSTDIR"
631 WriteRegStr HKLM "${MyRegPath}" "ExecutableName" "$R0"
632 WriteRegStr HKLM "${MyRegPath}" "DisplayIcon" "$INSTDIR\$R0,0"
633 WriteRegStr HKLM "${MyRegPath}" "UninstallString" '"$INSTDIR\Uninstall.exe"'
634 WriteRegStr HKLM "${MyRegPath}" "DisplayName" "LameXP v${LAMEXP_VERSION}"
635 WriteRegStr HKLM "${MyRegPath}" "Publisher" "LoRd_MuldeR <mulder2@gmx.de>"
636 WriteRegStr HKLM "${MyRegPath}" "DisplayVersion" "${LAMEXP_VERSION} ${LAMEXP_INSTTYPE}-${LAMEXP_PATCH} [Build #${LAMEXP_BUILD}]"
637 WriteRegStr HKLM "${MyRegPath}" "URLInfoAbout" "${MyWebSite}"
638 WriteRegStr HKLM "${MyRegPath}" "URLUpdateInfo" "${MyWebSite}"
640 DeleteRegKey HKCU "${AppPaths}\LameXP.exe"
641 WriteRegStr HKLM "${AppPaths}\LameXP.exe" "" "$INSTDIR\$R0"
642 WriteRegStr HKLM "${AppPaths}\LameXP.exe" "Path" "$INSTDIR"
646 !insertmacro PrintProgress
"$(MUI_TEXT_FINISH_TITLE)."
648 !ifdef LAMEXP_IS_PRERELEASE
649 ${If} ${FileExists} "$INSTDIR\PRE_RELEASE_INFO.txt"
650 ${StdUtils
.ExecShellAsUser
} $R1 "$INSTDIR\PRE_RELEASE_INFO.txt" "open" ""
654 ${IfThen} ${UnattendedMode} ${|
} SetAutoClose true
${|
}
658 ;--------------------------------
660 ;--------------------------------
664 !insertmacro PrintProgress
"$(LAMEXP_LANG_STATUS_UNINSTALL)"
670 !insertmacro MUI_STARTMENU_GETFOLDER Application
$StartMenuFolder
671 ${IfNot} "$StartMenuFolder" ==
""
672 SetShellVarContext current
673 ${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\LameXP.lnk"
674 ${StdUtils
.InvokeShellVerb
} $R1 "$SMPROGRAMS\$StartMenuFolder" "LameXP.lnk" ${StdUtils
.Const
.ShellVerb
.UnpinFromTaskbar
}
675 DetailPrint 'Unpin: "$SMPROGRAMS\$StartMenuFolder\LameXP.lnk" -> $R1'
677 ${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\*.*"
678 Delete /REBOOTOK
"$SMPROGRAMS\$StartMenuFolder\*.lnk"
679 Delete /REBOOTOK
"$SMPROGRAMS\$StartMenuFolder\*.url"
680 RMDir "$SMPROGRAMS\$StartMenuFolder"
683 SetShellVarContext all
684 ${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\LameXP.lnk"
685 ${StdUtils
.InvokeShellVerb
} $R1 "$SMPROGRAMS\$StartMenuFolder" "LameXP.lnk" ${StdUtils
.Const
.ShellVerb
.UnpinFromTaskbar
}
686 DetailPrint 'Unpin: "$SMPROGRAMS\$StartMenuFolder\LameXP.lnk" -> $R1'
688 ${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\*.*"
689 Delete /REBOOTOK
"$SMPROGRAMS\$StartMenuFolder\*.lnk"
690 Delete /REBOOTOK
"$SMPROGRAMS\$StartMenuFolder\*.url"
691 RMDir "$SMPROGRAMS\$StartMenuFolder"
699 ReadRegStr $R0 HKLM "${MyRegPath}" "ExecutableName"
700 ${IfThen} "$R0" ==
"" ${|
} StrCpy $R0 "LameXP.exe" ${|
}
701 ExecWait '"$INSTDIR\$R0" --uninstall'
703 Delete /REBOOTOK
"$INSTDIR\$R0"
704 !insertmacro CleanUpFiles
/REBOOTOK
711 DeleteRegKey HKLM "${MyRegPath}"
712 DeleteRegKey HKCU "${MyRegPath}"
714 DeleteRegKey HKLM "SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{54dcbccb-c905-46dc-b6e6-48563d0e9e55}"
715 DeleteRegKey HKCU "SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{54dcbccb-c905-46dc-b6e6-48563d0e9e55}"
717 DeleteRegKey HKLM "${AppPaths}\LameXP.exe"
718 DeleteRegKey HKCU "${AppPaths}\LameXP.exe"
720 MessageBox MB_YESNO|
MB_TOPMOST "$(LAMEXP_LANG_UNINST_PERSONAL)" IDNO +3
721 Delete "$LOCALAPPDATA\LoRd_MuldeR\LameXP - Audio Encoder Front-End\config.ini"
722 Delete "$INSTDIR\*.ini"
724 !insertmacro PrintProgress
"$(MUI_UNTEXT_FINISH_TITLE)."
728 ;--------------------------------
729 ;Check For Update Mode
730 ;--------------------------------
732 Function SkipIfUnattended
733 ${IfThen} ${UnattendedMode} ${|
} Abort ${|
}
736 Function CheckForUpdate
737 ${If} "$INSTDIR" ==
""
738 ${OrIf} "$INSTDIR" ==
"$EXEDIR"
739 ${OrIfNot} ${FileExists} "$INSTDIR\LameXP.exe"
743 FindWindow $R0 "#32770" "" $HWNDPARENT
744 GetDlgItem
$R1 $R0 1019
747 FindWindow $R0 "#32770" "" $HWNDPARENT
748 GetDlgItem
$R1 $R0 1001
752 Function un
.CheckForcedUninstall
753 ${IfThen} ${ForcedMode} ${|
} Abort ${|
}
757 ;--------------------------------
758 ;Check For Pre-Release
759 ;--------------------------------
761 Function CheckForPreRelease
762 !ifdef LAMEXP_IS_PRERELEASE
763 ${IfNot} ${UnattendedMode}
764 MessageBox MB_TOPMOST|
MB_ICONEXCLAMATION|
MB_OKCANCEL "$(LAMEXP_LANG_PRERELEASE_WARNING)" /SD
IDOK IDOK +2
771 ;--------------------------------
773 ;--------------------------------
775 !macro _LockedListShow uinst
776 !insertmacro MUI_HEADER_TEXT
"$(LAMEXP_LANG_LOCKEDLIST_HEADER)" "$(LAMEXP_LANG_LOCKEDLIST_TEXT)"
777 ${If} ${UnattendedMode}
778 !insertmacro DisableBackButton
$R0
782 File /oname=
$PLUGINSDIR\LockedList64
.dll
`${NSISDIR}\Plugins\LockedList64.dll`
784 !insertmacro GetExecutableName
$R0
785 LockedList::AddModule
"\$R0"
786 ${If} "$R0" !=
"LameXP.exe"
787 LockedList::AddModule
"\LameXP.exe"
789 LockedList::AddModule
"\Uninstall.exe"
791 LockedList::AddModule
"\Au_.exe"
793 #LockedList::AddFolder "$INSTDIR"
794 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)"
798 Function LockedListShow
799 !insertmacro _LockedListShow
0
802 Function un
.LockedListShow
803 !insertmacro _LockedListShow
1
807 ;--------------------------------
809 ;--------------------------------
811 Function RunAppFunction
812 !insertmacro DisableNextButton
$R0
813 !insertmacro GetExecutableName
$R0
814 ${StdUtils
.ExecShellAsUser
} $R1 "$INSTDIR" "explore" ""
815 ${StdUtils
.ExecShellAsUser
} $R1 "$INSTDIR\$R0" "open" "--first-run"
818 Function ShowReadmeFunction
819 !insertmacro DisableNextButton
$R0
820 ${StdUtils
.ExecShellAsUser
} $R1 "$INSTDIR\Manual.html" "open" ""
823 Function .onInstSuccess
824 ${If} ${UnattendedMode}
825 !insertmacro GetExecutableName
$R0
826 ${StdUtils
.ExecShellAsUser
} $R1 "$INSTDIR\$R0" "open" "--first-run"