1 ; ///////////////////////////////////////////////////////////////////////////////
2 ; // LameXP - Audio Encoder Front-End
3 ; // Copyright (C) 2004-2015 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 !!!"
56 !error "LAMEXP_REDIST is not defined !!!"
60 !define MyRegPath
"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{FBD7A67D-D700-4043-B54F-DD106D00F308}"
63 !define AppPaths
"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths"
66 !define MyWebSite
"http://muldersoft.com/"
69 ;--------------------------------
70 ;Check for Pre-Release
71 ;--------------------------------
73 !define LAMEXP_IS_PRERELEASE
75 !if '${LAMEXP_INSTTYPE}' ==
'Final'
76 !undef LAMEXP_IS_PRERELEASE
78 !if '${LAMEXP_INSTTYPE}' ==
'Hotfix'
79 !undef LAMEXP_IS_PRERELEASE
83 ;--------------------------------
85 ;--------------------------------
87 !packhdr "$%TEMP%\~exehead.tmp" `"..\Utilities\ResHacker.exe" -addoverwrite "$%TEMP%\~exehead.tmp", "$%TEMP%\~exehead.tmp", "setup.manifest", 24,1,1033`
89 !delfile "..\Utilities\ResHacker.log"
90 !delfile "..\Utilities\ResHacker.ini"
93 ;--------------------------------
95 ;--------------------------------
100 !include `StdUtils.nsh`
103 ;--------------------------------
104 ;Installer Attributes
105 ;--------------------------------
107 RequestExecutionLevel admin
109 ShowUninstDetails show
110 Name "LameXP v${LAMEXP_VERSION} ${LAMEXP_INSTTYPE}-${LAMEXP_PATCH} [Build #${LAMEXP_BUILD}]"
111 OutFile "${LAMEXP_OUTPUT_FILE}"
112 BrandingText "Date created: ${LAMEXP_DATE} [Build #${LAMEXP_BUILD}]"
113 InstallDir "$PROGRAMFILES\MuldeR\LameXP v${LAMEXP_VERSION}"
114 InstallDirRegKey HKLM "${MyRegPath}" "InstallLocation"
117 ;--------------------------------
119 ;--------------------------------
121 SetCompressor
/SOLID LZMA
122 SetCompressorDictSize
64
124 #!packhdr "$%TEMP%\exehead.tmp" '"${LAMEXP_UPX_PATH}\upx.exe" --brute "$%TEMP%\exehead.tmp"'
127 ;--------------------------------
129 ;--------------------------------
131 ReserveFile
"${NSISDIR}\Plugins\Aero.dll"
132 ReserveFile
"${NSISDIR}\Plugins\LangDLL.dll"
133 ReserveFile
"${NSISDIR}\Plugins\LockedList.dll"
134 ReserveFile
"${NSISDIR}\Plugins\LockedList64.dll"
135 ReserveFile
"${NSISDIR}\Plugins\nsDialogs.dll"
136 ReserveFile
"${NSISDIR}\Plugins\nsExec.dll"
137 ReserveFile
"${NSISDIR}\Plugins\StartMenu.dll"
138 ReserveFile
"${NSISDIR}\Plugins\StdUtils.dll"
139 ReserveFile
"${NSISDIR}\Plugins\System.dll"
140 ReserveFile
"${NSISDIR}\Plugins\UserInfo.dll"
143 ;--------------------------------
145 ;--------------------------------
150 ;--------------------------------
152 ;--------------------------------
154 !searchreplace PRODUCT_VERSION_DATE
"${LAMEXP_DATE}" "-" "."
155 VIProductVersion
"${PRODUCT_VERSION_DATE}.${LAMEXP_BUILD}"
157 VIAddVersionKey
"Author" "LoRd_MuldeR <mulder2@gmx.de>"
158 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."
159 VIAddVersionKey
"CompanyName" "Free Software Foundation"
160 VIAddVersionKey
"FileDescription" "LameXP v${LAMEXP_VERSION} ${LAMEXP_INSTTYPE}-${LAMEXP_PATCH} [Build #${LAMEXP_BUILD}]"
161 VIAddVersionKey
"FileVersion" "${PRODUCT_VERSION_DATE}.${LAMEXP_BUILD} (${LAMEXP_VERSION})"
162 VIAddVersionKey
"LegalCopyright" "Copyright 2004-2015 LoRd_MuldeR"
163 VIAddVersionKey
"LegalTrademarks" "GNU"
164 VIAddVersionKey
"OriginalFilename" "LameXP.${LAMEXP_DATE}.exe"
165 VIAddVersionKey
"ProductName" "LameXP - Audio Encoder Frontend"
166 VIAddVersionKey
"ProductVersion" "${LAMEXP_VERSION}, Build #${LAMEXP_BUILD} (${LAMEXP_DATE})"
167 VIAddVersionKey
"Website" "${MyWebSite}"
170 ;--------------------------------
171 ;MUI2 Interface Settings
172 ;--------------------------------
174 !define MUI_ABORTWARNING
175 !define MUI_STARTMENUPAGE_REGISTRY_ROOT
HKLM
176 !define MUI_STARTMENUPAGE_REGISTRY_KEY
"${MyRegPath}"
177 !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME
"StartmenuFolder"
178 !define MUI_LANGDLL_REGISTRY_ROOT
HKLM
179 !define MUI_LANGDLL_REGISTRY_KEY
"${MyRegPath}"
180 !define MUI_LANGDLL_REGISTRY_VALUENAME
"SetupLanguage"
181 !define MUI_STARTMENUPAGE_DEFAULTFOLDER
"LameXP v${LAMEXP_VERSION}"
182 !define MUI_FINISHPAGE_NOAUTOCLOSE
183 !define MUI_UNFINISHPAGE_NOAUTOCLOSE
184 !define MUI_FINISHPAGE_RUN
185 !define MUI_FINISHPAGE_RUN_FUNCTION RunAppFunction
186 !define MUI_FINISHPAGE_SHOWREADME
187 !define MUI_FINISHPAGE_SHOWREADME_FUNCTION ShowReadmeFunction
188 !define MUI_FINISHPAGE_LINK
${MyWebSite}
189 !define MUI_FINISHPAGE_LINK_LOCATION
${MyWebSite}
190 !define MUI_ICON
"${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico"
191 !define MUI_UNICON
"${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall.ico"
192 !define MUI_WELCOMEFINISHPAGE_BITMAP
"wizard.bmp"
193 !define MUI_UNWELCOMEFINISHPAGE_BITMAP
"wizard-un.bmp"
194 !define MUI_HEADERIMAGE
195 !define MUI_HEADERIMAGE_BITMAP
"header.bmp"
196 !define MUI_HEADERIMAGE_UNBITMAP
"header-un.bmp"
197 !define MUI_LANGDLL_ALLLANGUAGES
198 !define MUI_CUSTOMFUNCTION_GUIINIT MyGuiInit
199 !define MUI_CUSTOMFUNCTION_UNGUIINIT un
.MyGuiInit
200 !define MUI_LANGDLL_ALWAYSSHOW
203 ;--------------------------------
204 ;MUI2 Pages (Installer)
205 ;--------------------------------
208 !define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfUnattended
209 !define MUI_PAGE_CUSTOMFUNCTION_LEAVE CheckForPreRelease
210 !define MUI_WELCOMEPAGE_TITLE_3LINES
211 !define MUI_FINISHPAGE_TITLE_3LINES
212 !insertmacro MUI_PAGE_WELCOME
215 !define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfUnattended
216 !insertmacro MUI_PAGE_LICENSE
"license.rtf"
219 !define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfUnattended
220 !define MUI_PAGE_CUSTOMFUNCTION_SHOW CheckForUpdate
221 !insertmacro MUI_PAGE_DIRECTORY
224 !define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfUnattended
225 !insertmacro MUI_PAGE_STARTMENU Application
$StartMenuFolder
228 Page Custom LockedListShow
231 !insertmacro MUI_PAGE_INSTFILES
234 !define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfUnattended
235 !insertmacro MUI_PAGE_FINISH
238 ;--------------------------------
239 ;MUI2 Pages (Uninstaller)
240 ;--------------------------------
243 !define MUI_WELCOMEPAGE_TITLE_3LINES
244 !define MUI_FINISHPAGE_TITLE_3LINES
245 !define MUI_PAGE_CUSTOMFUNCTION_PRE un
.CheckForcedUninstall
246 !insertmacro MUI_UNPAGE_WELCOME
249 !define MUI_PAGE_CUSTOMFUNCTION_PRE un
.CheckForcedUninstall
250 !insertmacro MUI_UNPAGE_CONFIRM
253 UninstPage Custom un
.LockedListShow
256 !insertmacro MUI_UNPAGE_INSTFILES
259 !define MUI_PAGE_CUSTOMFUNCTION_PRE un
.CheckForcedUninstall
260 !insertmacro MUI_UNPAGE_FINISH
263 ;--------------------------------
265 ;--------------------------------
267 !insertmacro MUI_LANGUAGE
"English" ;first language is the default language
268 !insertmacro MUI_LANGUAGE
"German"
269 !insertmacro MUI_LANGUAGE
"Spanish"
270 !insertmacro MUI_LANGUAGE
"Russian"
271 !insertmacro MUI_LANGUAGE
"Ukrainian"
272 !insertmacro MUI_LANGUAGE
"Polish"
273 !insertmacro MUI_LANGUAGE
"Hungarian"
275 ; !insertmacro MUI_LANGUAGE "French"
276 ; !insertmacro MUI_LANGUAGE "SpanishInternational"
277 ; !insertmacro MUI_LANGUAGE "SimpChinese"
278 ; !insertmacro MUI_LANGUAGE "TradChinese"
279 ; !insertmacro MUI_LANGUAGE "Japanese"
280 ; !insertmacro MUI_LANGUAGE "Italian"
281 ; !insertmacro MUI_LANGUAGE "Dutch"
282 ; !insertmacro MUI_LANGUAGE "Greek"
283 ; !insertmacro MUI_LANGUAGE "Romanian"
284 ; !insertmacro MUI_LANGUAGE "Serbian"
285 ; !insertmacro MUI_LANGUAGE "SerbianLatin"
286 ; !insertmacro MUI_LANGUAGE "Arabic"
287 ; !insertmacro MUI_LANGUAGE "Portuguese"
288 ; !insertmacro MUI_LANGUAGE "Afrikaans"
289 ; !insertmacro MUI_LANGUAGE "Malay"
290 ; !insertmacro MUI_LANGUAGE "Indonesian"
293 ;--------------------------------
295 ;--------------------------------
298 !include "..\Translation\Blank.nsh"
301 !include "..\Translation\LameXP_DE.nsh"
304 !include "..\Translation\LameXP_ES.nsh"
307 !include "..\Translation\LameXP_RU.nsh"
310 !include "..\Translation\LameXP_UK.nsh"
313 !include "..\Translation\LameXP_PL.nsh"
316 !include "..\Translation\LameXP_HU.nsh"
319 ;--------------------------------
321 ;--------------------------------
323 !macro _UnattendedMode _a _b _t _f
324 !insertmacro _LOGICLIB_TEMP
325 ${StdUtils
.TestParameter
} $_LOGICLIB_TEMP "Update"
326 StrCmp "$_LOGICLIB_TEMP" "true" `${_t}` `${_f}`
328 !define UnattendedMode
`"" UnattendedMode ""`
330 !macro _ForcedMode _a _b _t _f
331 !insertmacro _LOGICLIB_TEMP
332 ${StdUtils
.TestParameter
} $_LOGICLIB_TEMP "Force"
333 StrCmp "$_LOGICLIB_TEMP" "true" `${_t}` `${_f}`
335 !define ForcedMode
`"" ForcedMode ""`
337 !macro _ValidFileName _a _b _t _f
338 !insertmacro _LOGICLIB_TEMP
339 ${StdUtils
.ValidFileName
} $_LOGICLIB_TEMP `${_b}`
340 StrCmp "$_LOGICLIB_TEMP" "ok" `${_t}` `${_f}`
342 !define ValidFileName
`"" ValidFileName`
345 ;--------------------------------
346 ;Installer initialization
347 ;--------------------------------
354 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "{2B3D1EBF-B3B6-4E93-92B9-6853029A7162}") i .r1 ?e'
357 MessageBox MB_ICONSTOP|
MB_TOPMOST "Sorry, the installer is already running!"
363 # Running on Windows NT family?
365 MessageBox MB_TOPMOST|
MB_ICONSTOP "Sorry, this application does *not* support Windows 9x or Windows ME!"
366 ExecShell "open" "http://windows.microsoft.com/"
370 # Running on Windows XP or later?
371 ${If} ${AtMostWin2000}
372 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)."
373 ExecShell "open" "http://windows.microsoft.com/"
377 # If on Windows XP, is the required Service Pack installed?
379 ${IfNot} ${RunningX64} # Windows XP 32-Bit, requires Service Pack 3
380 ${AndIf} ${AtMostServicePack} 2
381 MessageBox MB_TOPMOST|
MB_ICONEXCLAMATION "This application requires Windows XP with Service Pack 3 installed!"
382 ${If} ${Cmd} `MessageBox MB_TOPMOST|MB_ICONQUESTION|MB_YESNO "Do you want to download Service Pack 3 for Windows XP now?" IDYES`
383 ExecShell "open" "http://www.microsoft.com/en-us/download/details.aspx?id=24"
385 ExecShell "open" "http://windowsupdate.microsoft.com/"
389 ${If} ${RunningX64} # Windows XP 64-Bit, requires Service Pack 2
390 ${AndIf} ${AtMostServicePack} 1
391 MessageBox MB_TOPMOST|
MB_ICONEXCLAMATION "This application requires Windows XP x64 Edition with Service Pack 2 installed!"
392 ${If} ${Cmd} `MessageBox MB_TOPMOST|MB_ICONQUESTION|MB_YESNO "Do you want to download Service Pack 2 for Windows XP x64 Edition now?" IDYES`
393 ExecShell "open" "http://www.microsoft.com/en-us/download/details.aspx?id=17791"
395 ExecShell "open" "http://windowsupdate.microsoft.com/"
403 ${IfNot} ${UnattendedMode}
404 !insertmacro MUI_LANGDLL_DISPLAY
409 UserInfo::GetAccountType
412 MessageBox MB_ICONSTOP|
MB_TOPMOST "Your system requires administrative permissions in order to install this software."
413 SetErrorLevel
740 ;ERROR_ELEVATION_REQUIRED
419 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "{2B3D1EBF-B3B6-4E93-92B9-6853029A7162}") i .r1 ?e'
422 MessageBox MB_ICONSTOP|
MB_TOPMOST "Sorry, the un-installer is already running!"
426 ${IfNot} ${ForcedMode}
427 !insertmacro MUI_LANGDLL_DISPLAY
432 UserInfo::GetAccountType
435 MessageBox MB_ICONSTOP|
MB_TOPMOST "Your system requires administrative permissions in order to install this software."
436 SetErrorLevel
740 ;ERROR_ELEVATION_REQUIRED
442 ;--------------------------------
444 ;--------------------------------
447 StrCpy $0 $HWNDPARENT
448 System::Call "user32::SetWindowPos(i r0, i -1, i 0, i 0, i 0, i 0, i 3)"
452 Function un
.MyGuiInit
453 StrCpy $0 $HWNDPARENT
454 System::Call "user32::SetWindowPos(i r0, i -1, i 0, i 0, i 0, i 0, i 3)"
459 ;--------------------------------
460 ;Macros & Auxiliary Functions
461 ;--------------------------------
463 !macro PrintProgress Text
464 SetDetailsPrint textonly
465 DetailPrint '${Text}'
466 SetDetailsPrint listonly
470 !macro CreateWebLink ShortcutFile TargetURL
473 StrCpy $0 "${ShortcutFile}"
474 StrCpy $1 "${TargetURL}"
480 Function _CreateWebLink
482 SetFileAttributes "$0" FILE_ATTRIBUTE_NORMAL
483 DeleteINISec "$0" "DEFAULT"
484 DeleteINISec "$0" "InternetShortcut"
485 WriteINIStr "$0" "DEFAULT" "BASEURL" "$1"
486 WriteINIStr "$0" "InternetShortcut" "ORIGURL" "$1"
487 WriteINIStr "$0" "InternetShortcut" "URL" "$1"
488 WriteINIStr "$0" "InternetShortcut" "IconFile" "$SYSDIR\SHELL32.dll"
489 WriteINIStr "$0" "InternetShortcut" "IconIndex" "150"
491 SetFileAttributes "$0" FILE_ATTRIBUTE_READONLY
494 !macro GetExecutableName OutVar
495 ${StdUtils
.GetParameter
} ${OutVar} "Update" ""
496 ${StdUtils
.TrimStr
} ${OutVar}
497 ${If} "${OutVar}" ==
""
498 ${OrIfNot} ${ValidFileName} "${OutVar}"
499 StrCpy ${OutVar} "LameXP.exe"
503 !macro DisableNextButton TmpVar
504 GetDlgItem
${TmpVar} $HWNDPARENT 1
505 EnableWindow
${TmpVar} 0
508 !macro DisableBackButton TmpVar
509 GetDlgItem
${TmpVar} $HWNDPARENT 3
510 EnableWindow
${TmpVar} 0
513 !macro CleanUpFiles options
514 Delete ${options} "$INSTDIR\Changelog.htm"
515 Delete ${options} "$INSTDIR\Changelog.html"
516 Delete ${options} "$INSTDIR\Contributors.txt"
517 Delete ${options} "$INSTDIR\Copying.txt"
518 Delete ${options} "$INSTDIR\FAQ.html"
519 Delete ${options} "$INSTDIR\Howto.html"
520 Delete ${options} "$INSTDIR\LameEnc.sys"
521 Delete ${options} "$INSTDIR\LameXP.exe"
522 Delete ${options} "$INSTDIR\LameXP.exe.sig"
523 Delete ${options} "$INSTDIR\LameXP-Portable.exe"
524 Delete ${options} "$INSTDIR\License.txt"
525 Delete ${options} "$INSTDIR\Manual.html"
526 Delete ${options} "$INSTDIR\Readme.htm"
527 Delete ${options} "$INSTDIR\ReadMe.txt"
528 Delete ${options} "$INSTDIR\PRE_RELEASE_INFO.txt"
529 Delete ${options} "$INSTDIR\Settings.cfg"
530 Delete ${options} "$INSTDIR\Translate.html"
531 Delete ${options} "$INSTDIR\Uninstall.exe"
532 Delete ${options} "$INSTDIR\Qt*.dll"
533 Delete ${options} "$INSTDIR\msvcr*.dll"
534 Delete ${options} "$INSTDIR\msvcp*.dll"
535 Delete ${options} "$INSTDIR\concrt*.dll"
536 Delete ${options} "$INSTDIR\vcruntime*.dll"
537 Delete ${options} "$INSTDIR\vccorlib*.dll"
539 RMDir /r
${options} "$INSTDIR\cache"
540 RMDir /r
${options} "$INSTDIR\img"
541 RMDir /r
${options} "$INSTDIR\imageformats"
542 RMDir /r
${options} "$INSTDIR\redist"
545 ;--------------------------------
547 ;--------------------------------
550 SetShellVarContext all
551 SetOutPath "$INSTDIR"
554 Section "!Clean Up Old Cruft"
555 !insertmacro PrintProgress
"$(LAMEXP_LANG_STATUS_CLEANUP)"
556 !insertmacro CleanUpFiles
""
559 Section "!Install Files"
560 !insertmacro PrintProgress
"$(LAMEXP_LANG_STATUS_INSTFILES)"
563 !insertmacro GetExecutableName
$R0
565 Delete "$INSTDIR\$R0"
568 MessageBox MB_TOPMOST|
MB_ICONSTOP|
MB_RETRYCANCEL 'Could not delete old "$R0" file. Is LameXP still running?' IDRETRY DeleteOldBinary
569 Abort "Could not delete old binary!"
572 File /a
`/oname=$R0` `${LAMEXP_SOURCE_PATH}\LameXP.exe`
573 File /nonfatal
/a
/r
`${LAMEXP_SOURCE_PATH}\*.dll`
575 File /a
/r
`${LAMEXP_SOURCE_PATH}\*.txt`
576 File /a
/r
`${LAMEXP_SOURCE_PATH}\*.html`
577 File /a
/r
`${LAMEXP_SOURCE_PATH}\*.png`
580 !if ${LAMEXP_REDIST} !=
0
581 Section "-Install VCRedist"
582 !insertmacro PrintProgress
"$(LAMEXP_LANG_STATUS_VCREDIST)"
583 File /a
`/oname=$PLUGINSDIR\vcredist_x86.exe` `${LAMEXP_SOURCE_PATH}\redist\vcredist_x86.exe`
584 ExecWait '"$PLUGINSDIR\vcredist_x86.exe" /install /passive /norestart'
588 Section "-Write Uninstaller"
589 !insertmacro PrintProgress
"$(LAMEXP_LANG_STATUS_MAKEUNINST)"
590 WriteUninstaller "$INSTDIR\Uninstall.exe"
593 Section "-Create Shortcuts"
594 !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
595 !insertmacro PrintProgress
"$(LAMEXP_LANG_STATUS_SHORTCUTS)"
596 CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
598 SetShellVarContext current
600 Delete "$SMPROGRAMS\$StartMenuFolder\*.lnk"
601 Delete "$SMPROGRAMS\$StartMenuFolder\*.pif"
602 Delete "$SMPROGRAMS\$StartMenuFolder\*.url"
604 SetShellVarContext all
606 Delete "$SMPROGRAMS\$StartMenuFolder\*.lnk"
607 Delete "$SMPROGRAMS\$StartMenuFolder\*.pif"
608 Delete "$SMPROGRAMS\$StartMenuFolder\*.url"
610 !insertmacro GetExecutableName
$R0
612 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\LameXP.lnk" "$INSTDIR\$R0" "" "$INSTDIR\$R0" 0
613 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(LAMEXP_LANG_LINK_LICENSE).lnk" "$INSTDIR\License.txt"
614 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(LAMEXP_LANG_LINK_CHANGELOG).lnk" "$INSTDIR\Changelog.html"
615 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(LAMEXP_LANG_LINK_TRANSLATE).lnk" "$INSTDIR\Translate.html"
616 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(LAMEXP_LANG_LINK_MANUAL).lnk" "$INSTDIR\Manual.html"
617 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(LAMEXP_LANG_LINK_UNINSTALL).lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0
619 !insertmacro CreateWebLink
"$SMPROGRAMS\$StartMenuFolder\Official LameXP Homepage.url" "${MyWebSite}"
620 !insertmacro CreateWebLink
"$SMPROGRAMS\$StartMenuFolder\Doom9's Forum.url" "http://forum.doom9.org/"
621 !insertmacro CreateWebLink
"$SMPROGRAMS\$StartMenuFolder\Bug Tracker.url" "https://github.com/lordmulder/LameXP/issues"
622 !insertmacro CreateWebLink
"$SMPROGRAMS\$StartMenuFolder\RareWares.org.url" "http://rarewares.org/"
623 !insertmacro CreateWebLink
"$SMPROGRAMS\$StartMenuFolder\Hydrogenaudio Forums.url" "http://www.hydrogenaudio.org/"
625 ${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\LameXP.lnk"
626 ${StdUtils
.InvokeShellVerb
} $R1 "$SMPROGRAMS\$StartMenuFolder" "LameXP.lnk" ${StdUtils
.Const
.ISV_PinToTaskbar
}
627 DetailPrint 'Pin: "$SMPROGRAMS\$StartMenuFolder\LameXP.lnk" -> $R1'
629 !insertmacro MUI_STARTMENU_WRITE_END
632 Section "-Update Registry"
633 !insertmacro PrintProgress
"$(LAMEXP_LANG_STATUS_REGISTRY)"
635 !insertmacro GetExecutableName
$R0
636 WriteRegStr HKLM "${MyRegPath}" "InstallLocation" "$INSTDIR"
637 WriteRegStr HKLM "${MyRegPath}" "ExecutableName" "$R0"
638 WriteRegStr HKLM "${MyRegPath}" "DisplayIcon" "$INSTDIR\$R0,0"
639 WriteRegStr HKLM "${MyRegPath}" "UninstallString" '"$INSTDIR\Uninstall.exe"'
640 WriteRegStr HKLM "${MyRegPath}" "DisplayName" "LameXP v${LAMEXP_VERSION}"
641 WriteRegStr HKLM "${MyRegPath}" "Publisher" "LoRd_MuldeR <mulder2@gmx.de>"
642 WriteRegStr HKLM "${MyRegPath}" "DisplayVersion" "${LAMEXP_VERSION} ${LAMEXP_INSTTYPE}-${LAMEXP_PATCH} [Build #${LAMEXP_BUILD}]"
643 WriteRegStr HKLM "${MyRegPath}" "URLInfoAbout" "${MyWebSite}"
644 WriteRegStr HKLM "${MyRegPath}" "URLUpdateInfo" "${MyWebSite}"
646 WriteRegStr HKLM "${AppPaths}\LameXP.exe" "" "$INSTDIR\$R0"
647 WriteRegStr HKLM "${AppPaths}\LameXP.exe" "Path" "$INSTDIR"
651 !insertmacro PrintProgress
"$(MUI_TEXT_FINISH_TITLE)."
653 !ifdef LAMEXP_IS_PRERELEASE
654 ${If} ${FileExists} "$INSTDIR\PRE_RELEASE_INFO.txt"
655 ${StdUtils
.ExecShellAsUser
} $R1 "$INSTDIR\PRE_RELEASE_INFO.txt" "open" ""
659 ${IfThen} ${UnattendedMode} ${|
} SetAutoClose true
${|
}
663 ;--------------------------------
665 ;--------------------------------
669 !insertmacro PrintProgress
"$(LAMEXP_LANG_STATUS_UNINSTALL)"
675 !insertmacro MUI_STARTMENU_GETFOLDER Application
$StartMenuFolder
676 ${IfNot} "$StartMenuFolder" ==
""
677 SetShellVarContext current
678 ${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\LameXP.lnk"
679 ${StdUtils
.InvokeShellVerb
} $R1 "$SMPROGRAMS\$StartMenuFolder" "LameXP.lnk" ${StdUtils
.Const
.ISV_UnpinFromTaskbar
}
680 DetailPrint 'Unpin: "$SMPROGRAMS\$StartMenuFolder\LameXP.lnk" -> $R1'
682 ${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\*.*"
683 Delete /REBOOTOK
"$SMPROGRAMS\$StartMenuFolder\*.lnk"
684 Delete /REBOOTOK
"$SMPROGRAMS\$StartMenuFolder\*.url"
685 RMDir "$SMPROGRAMS\$StartMenuFolder"
688 SetShellVarContext all
689 ${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\LameXP.lnk"
690 ${StdUtils
.InvokeShellVerb
} $R1 "$SMPROGRAMS\$StartMenuFolder" "LameXP.lnk" ${StdUtils
.Const
.ISV_UnpinFromTaskbar
}
691 DetailPrint 'Unpin: "$SMPROGRAMS\$StartMenuFolder\LameXP.lnk" -> $R1'
693 ${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\*.*"
694 Delete /REBOOTOK
"$SMPROGRAMS\$StartMenuFolder\*.lnk"
695 Delete /REBOOTOK
"$SMPROGRAMS\$StartMenuFolder\*.url"
696 RMDir "$SMPROGRAMS\$StartMenuFolder"
704 ReadRegStr $R0 HKLM "${MyRegPath}" "ExecutableName"
705 ${IfThen} "$R0" ==
"" ${|
} StrCpy $R0 "LameXP.exe" ${|
}
707 Delete /REBOOTOK
"$INSTDIR\$R0"
708 !insertmacro CleanUpFiles
/REBOOTOK
715 DeleteRegKey HKLM "${MyRegPath}"
716 DeleteRegKey HKCU "${MyRegPath}"
718 DeleteRegKey HKLM "SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{54dcbccb-c905-46dc-b6e6-48563d0e9e55}"
719 DeleteRegKey HKCU "SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{54dcbccb-c905-46dc-b6e6-48563d0e9e55}"
721 DeleteRegKey HKLM "${AppPaths}\LameXP.exe"
722 DeleteRegKey HKCU "${AppPaths}\LameXP.exe"
724 MessageBox MB_YESNO|
MB_TOPMOST "$(LAMEXP_LANG_UNINST_PERSONAL)" IDNO +3
725 Delete "$LOCALAPPDATA\LoRd_MuldeR\LameXP - Audio Encoder Front-End\config.ini"
726 Delete "$INSTDIR\*.ini"
728 !insertmacro PrintProgress
"$(MUI_UNTEXT_FINISH_TITLE)."
732 ;--------------------------------
733 ;Check For Update Mode
734 ;--------------------------------
736 Function SkipIfUnattended
737 ${IfThen} ${UnattendedMode} ${|
} Abort ${|
}
740 Function CheckForUpdate
741 ${If} "$INSTDIR" ==
""
742 ${OrIf} "$INSTDIR" ==
"$EXEDIR"
743 ${OrIfNot} ${FileExists} "$INSTDIR\LameXP.exe"
747 FindWindow $R0 "#32770" "" $HWNDPARENT
748 GetDlgItem
$R1 $R0 1019
751 FindWindow $R0 "#32770" "" $HWNDPARENT
752 GetDlgItem
$R1 $R0 1001
756 Function un
.CheckForcedUninstall
757 ${IfThen} ${ForcedMode} ${|
} Abort ${|
}
761 ;--------------------------------
762 ;Check For Pre-Release
763 ;--------------------------------
765 Function CheckForPreRelease
766 !ifdef LAMEXP_IS_PRERELEASE
767 ${IfNot} ${UnattendedMode}
768 MessageBox MB_TOPMOST|
MB_ICONEXCLAMATION|
MB_OKCANCEL "$(LAMEXP_LANG_PRERELEASE_WARNING)" /SD
IDOK IDOK +2
775 ;--------------------------------
777 ;--------------------------------
779 !macro _LockedListShow uinst
780 !insertmacro MUI_HEADER_TEXT
"$(LAMEXP_LANG_LOCKEDLIST_HEADER)" "$(LAMEXP_LANG_LOCKEDLIST_TEXT)"
781 ${If} ${UnattendedMode}
782 !insertmacro DisableBackButton
$R0
786 File /oname=
$PLUGINSDIR\LockedList64
.dll
`${NSISDIR}\Plugins\LockedList64.dll`
788 !insertmacro GetExecutableName
$R0
789 LockedList::AddModule
"\$R0"
790 ${If} "$R0" !=
"LameXP.exe"
791 LockedList::AddModule
"\LameXP.exe"
793 LockedList::AddModule
"\Uninstall.exe"
795 LockedList::AddModule
"\Au_.exe"
797 LockedList::AddFolder
"$INSTDIR"
798 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)"
802 Function LockedListShow
803 !insertmacro _LockedListShow
0
806 Function un
.LockedListShow
807 !insertmacro _LockedListShow
1
811 ;--------------------------------
813 ;--------------------------------
815 Function RunAppFunction
816 !insertmacro DisableNextButton
$R0
817 !insertmacro GetExecutableName
$R0
818 ${StdUtils
.ExecShellAsUser
} $R1 "$INSTDIR" "explore" ""
819 ${StdUtils
.ExecShellAsUser
} $R1 "$INSTDIR\$R0" "open" "--first-run"
822 Function ShowReadmeFunction
823 !insertmacro DisableNextButton
$R0
824 ${StdUtils
.ExecShellAsUser
} $R1 "$INSTDIR\Manual.html" "open" ""
827 Function .onInstSuccess
828 ${If} ${UnattendedMode}
829 !insertmacro GetExecutableName
$R0
830 ${StdUtils
.ExecShellAsUser
} $R1 "$INSTDIR\$R0" "open" "--first-run"