; ///////////////////////////////////////////////////////////////////////////////
; // Simple x264 Launcher
-; // Copyright (C) 2004-2013 LoRd_MuldeR <MuldeR2@GMX.de>
+; // Copyright (C) 2004-2019 LoRd_MuldeR <MuldeR2@GMX.de>
; //
; // 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
!ifndef X264_SOURCE_PATH
!error "X264_SOURCE_PATH is not defined !!!"
!endif
-!ifndef X264_UPX_PATH
- !error "X264_UPX_PATH is not defined !!!"
-!endif
;UUID
!define MyRegPath "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{986E454F-DACA-4326-A9C7-3E46C0BFFDCE}"
;Web-Site
!define MyWebSite "http://muldersoft.com/"
+;App Paths
+!define AppPaths "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths"
+
+
+;--------------------------------
+;Manifest
+;--------------------------------
+
+!tempfile PACKHDRTEMP
+!packhdr "${PACKHDRTEMP}" '"..\..\..\Prerequisites\MSVC\redist\bin\mt.exe" -manifest "setup.manifest" -outputresource:"${PACKHDRTEMP};1" && "..\..\..\Prerequisites\UPX\upx.exe" --brute "${PACKHDRTEMP}"'
+
;--------------------------------
;Includes
RequestExecutionLevel admin
ShowInstDetails show
ShowUninstDetails show
-Name "Simple x264 Launcher [Build #${X264_BUILD}]"
+Name "Simple x264/x265 Launcher [Build #${X264_BUILD}]"
OutFile "${X264_OUTPUT_FILE}"
BrandingText "Date created: ${X264_DATE} [Build #${X264_BUILD}]"
InstallDir "$PROGRAMFILES\MuldeR\Simple x264 Launcher v2"
SetCompressor /SOLID LZMA
SetCompressorDictSize 64
-!packhdr "$%TEMP%\exehead.tmp" '"${X264_UPX_PATH}\upx.exe" --brute "$%TEMP%\exehead.tmp"'
-
;--------------------------------
;Reserved Files
ReserveFile "${NSISDIR}\Plugins\Aero.dll"
ReserveFile "${NSISDIR}\Plugins\LangDLL.dll"
ReserveFile "${NSISDIR}\Plugins\LockedList.dll"
+ReserveFile "${NSISDIR}\Plugins\LockedList64.dll"
ReserveFile "${NSISDIR}\Plugins\nsDialogs.dll"
ReserveFile "${NSISDIR}\Plugins\nsExec.dll"
ReserveFile "${NSISDIR}\Plugins\StartMenu.dll"
ReserveFile "${NSISDIR}\Plugins\StdUtils.dll"
ReserveFile "${NSISDIR}\Plugins\System.dll"
ReserveFile "${NSISDIR}\Plugins\UserInfo.dll"
-ReserveFile "checkproc.exe"
;--------------------------------
;--------------------------------
Var StartMenuFolder
+Var UpdateNotificationShown
;--------------------------------
VIAddVersionKey "CompanyName" "Free Software Foundation"
VIAddVersionKey "FileDescription" "Simple x264 Launcher [Build #${X264_BUILD}]"
VIAddVersionKey "FileVersion" "${PRODUCT_VERSION_DATE}.${X264_BUILD}"
-VIAddVersionKey "LegalCopyright" "Copyright 2004-2013 LoRd_MuldeR"
+VIAddVersionKey "LegalCopyright" "Copyright 2004-2019 LoRd_MuldeR"
VIAddVersionKey "LegalTrademarks" "GNU"
VIAddVersionKey "OriginalFilename" "x264_x64.${X264_DATE}.exe"
VIAddVersionKey "ProductName" "Simple x264 Launcher"
!define MUI_CUSTOMFUNCTION_UNGUIINIT un.MyGuiInit
!define MUI_LANGDLL_ALWAYSSHOW
+
;--------------------------------
-;MUI2 Pages
+;MUI2 Pages (Installer)
;--------------------------------
-;Installer
+;Welcome
+!define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfUnattended
!define MUI_WELCOMEPAGE_TITLE_3LINES
!define MUI_FINISHPAGE_TITLE_3LINES
!insertmacro MUI_PAGE_WELCOME
+
+;License
+!define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfUnattended
!insertmacro MUI_PAGE_LICENSE "license.rtf"
+
+;Directory
+!define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfUnattended
!define MUI_PAGE_CUSTOMFUNCTION_SHOW CheckForUpdate
!insertmacro MUI_PAGE_DIRECTORY
+
+;Startmenu
+!define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfUnattended
!insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder
+
+;LockedList
Page Custom LockedListShow
+
+;Install Files
!insertmacro MUI_PAGE_INSTFILES
+
+;Finish
+!define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfUnattended
!insertmacro MUI_PAGE_FINISH
-;Uninstaller
+
+;--------------------------------
+;MUI2 Pages (Uninstaller)
+;--------------------------------
+
+;Welcome
!define MUI_WELCOMEPAGE_TITLE_3LINES
!define MUI_FINISHPAGE_TITLE_3LINES
!define MUI_PAGE_CUSTOMFUNCTION_PRE un.CheckForcedUninstall
!insertmacro MUI_UNPAGE_WELCOME
+
+;Confirm
!define MUI_PAGE_CUSTOMFUNCTION_PRE un.CheckForcedUninstall
!insertmacro MUI_UNPAGE_CONFIRM
+
+;LockedList
UninstPage Custom un.LockedListShow
+
+;Uninstall
!insertmacro MUI_UNPAGE_INSTFILES
+
+;Finish
+!define MUI_PAGE_CUSTOMFUNCTION_PRE un.CheckForcedUninstall
!insertmacro MUI_UNPAGE_FINISH
;--------------------------------
+;LogicLib Extensions
+;--------------------------------
+
+!macro _UnattendedMode _a _b _t _f
+ !insertmacro _LOGICLIB_TEMP
+ ${StdUtils.TestParameter} $_LOGICLIB_TEMP "Update"
+ StrCmp "$_LOGICLIB_TEMP" "true" `${_t}` `${_f}`
+!macroend
+!define UnattendedMode `"" UnattendedMode ""`
+
+!macro _ForcedMode _a _b _t _f
+ !insertmacro _LOGICLIB_TEMP
+ ${StdUtils.TestParameter} $_LOGICLIB_TEMP "Force"
+ StrCmp "$_LOGICLIB_TEMP" "true" `${_t}` `${_f}`
+!macroend
+!define ForcedMode `"" ForcedMode ""`
+
+!macro _ValidFileName _a _b _t _f
+ !insertmacro _LOGICLIB_TEMP
+ ${StdUtils.ValidFileName} $_LOGICLIB_TEMP `${_b}`
+ StrCmp "$_LOGICLIB_TEMP" "ok" `${_t}` `${_f}`
+!macroend
+!define ValidFileName `"" ValidFileName`
+
+
+;--------------------------------
;Installer initialization
;--------------------------------
Function .onInit
+ InitPluginsDir
+
+ ; --------
+
System::Call 'kernel32::CreateMutexA(i 0, i 0, t "{2B3D1EBF-B3B6-4E93-92B9-6853029A7162}") i .r1 ?e'
Pop $0
${If} $0 <> 0
Quit
${EndIf}
- # Running on Windows XP or later?
- ${If} ${AtMostWin2000}
- 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)."
+ # Running on Windows Vista or later?
+ ${If} ${AtMostWinXP}
+ MessageBox MB_TOPMOST|MB_ICONSTOP "Sorry, but your operating system is *not* supported anymore.$\nInstallation will be aborted!$\n$\nThe minimum supported platform is Windows Vista (Service Pack 2)."
ExecShell "open" "http://windows.microsoft.com/"
Quit
${EndIf}
- # If on Windows XP, is the required Service Pack installed?
- ${If} ${IsWinXP}
- ${IfNot} ${RunningX64} # Windows XP 32-Bit, requires Service Pack 3
- ${AndIf} ${AtMostServicePack} 2
- MessageBox MB_TOPMOST|MB_ICONEXCLAMATION "This application requires Windows XP with Service Pack 3 installed.$\nWindows XP *without* Service Pack 3 reached end-of-life on 2010-07-13.$\nCurrent Windows XP (Service Pack 3) will be supported until 2014-04-08.$\n$\nPlease install Service Pack 3 now or just run Windows Update!"
- ${If} ${Cmd} `MessageBox MB_TOPMOST|MB_ICONQUESTION|MB_YESNO "Do you want to download Service Pack 3 for Windows XP now?" IDYES`
- ExecShell "open" "http://www.microsoft.com/en-us/download/details.aspx?id=24"
- ${Else}
- ExecShell "open" "http://windowsupdate.microsoft.com/"
- ${EndIf}
- Quit
- ${EndIf}
- ${If} ${RunningX64} # Windows XP 64-Bit, requires Service Pack 2
- ${AndIf} ${AtMostServicePack} 1
- MessageBox MB_TOPMOST|MB_ICONEXCLAMATION "This application requires Windows XP x64 Edition with Service Pack 2 installed.$\nWindows XP x64 Edition *without* Service Pack 2 reached end-of-life on 2009-04-14.$\nCurrent Windows XP x64 Edition (Service Pack 2) will be supported until 2014-04-08.$\n$\nPlease install Service Pack 2 now or just run Windows Update!"
- ${If} ${Cmd} `MessageBox MB_TOPMOST|MB_ICONQUESTION|MB_YESNO "Do you want to download Service Pack 2 for Windows XP x64 Edition now?" IDYES`
- ExecShell "open" "http://www.microsoft.com/en-us/download/details.aspx?id=17791"
- ${Else}
- ExecShell "open" "http://windowsupdate.microsoft.com/"
- ${EndIf}
- Quit
+ # If on Windows Vista, is the required Service Pack installed?
+ ${If} ${IsWinVista}
+ ${AndIf} ${AtMostServicePack} 1
+ MessageBox MB_TOPMOST|MB_ICONEXCLAMATION "This application requires Windows Vista with Service Pack 2 installed."
+ ${If} ${Cmd} `MessageBox MB_TOPMOST|MB_ICONQUESTION|MB_YESNO "Do you want to download Service Pack 2 for Windows Vista now?" IDYES`
+ ExecShell "open" "https://www.microsoft.com/en-us/download/details.aspx?id=16468"
${EndIf}
+ Quit
${EndIf}
; --------
- ${StdUtils.GetParameter} $R0 "Update" "?"
- ${If} "$R0" == "?"
+ ${IfNot} ${UnattendedMode}
!insertmacro MUI_LANGDLL_DISPLAY
${EndIf}
SetErrorLevel 740 ;ERROR_ELEVATION_REQUIRED
Quit
${EndIf}
-
- ; --------
-
- InitPluginsDir
-
- File "/oname=$PLUGINSDIR\checkproc.exe" "checkproc.exe"
- nsExec::Exec /TIMEOUT=5000 '"$PLUGINSDIR\checkproc.exe" Softonic Brothersoft Afreecodec'
- Pop $0
FunctionEnd
Function un.onInit
Quit
${EndIf}
- ${StdUtils.GetParameter} $R0 "Force" "?"
- ${If} "$R0" == "?"
+ ${IfNot} ${ForcedMode}
!insertmacro MUI_LANGDLL_DISPLAY
${EndIf}
!macro GetExecutableName OutVar
${StdUtils.GetParameter} ${OutVar} "Update" ""
${StdUtils.TrimStr} ${OutVar}
- ${IfThen} "${OutVar}" == "" ${|} StrCpy ${OutVar} "x264_launcher.exe" ${|}
+ ${If} "${OutVar}" == ""
+ ${OrIfNot} ${ValidFileName} "${OutVar}"
+ StrCpy ${OutVar} "x264_launcher.exe"
+ ${EndIf}
!macroend
!macro DisableNextButton TmpVar
EnableWindow ${TmpVar} 0
!macroend
+!macro DisableBackButton TmpVar
+ GetDlgItem ${TmpVar} $HWNDPARENT 3
+ EnableWindow ${TmpVar} 0
+!macroend
+
+!macro CleanUpFiles options
+ Delete ${options} `$INSTDIR\*.exe`
+ Delete ${options} `$INSTDIR\*.dll`
+ Delete ${options} `$INSTDIR\*.txt`
+ Delete ${options} `$INSTDIR\*.htm`
+ Delete ${options} `$INSTDIR\*.html`
+
+ RMDir /r ${options} `$INSTDIR\toolset`
+ RMDir /r ${options} `$INSTDIR\imageformats`
+ RMDir /r ${options} `$INSTDIR\sources`
+!macroend
+
+!macro SetControlEnabled item_id enable
+ FindWindow $R0 "#32770" "" $HWNDPARENT
+ ${IfNot} $R0 == 0
+ GetDlgItem $R1 $R0 ${item_id}
+ EnableWindow $R1 ${enable}
+ ${EndIf}
+!macroend
+
+!macro SkipToNextPage
+ GetDlgItem $R0 $HWNDPARENT 1
+ System::Call "User32::PostMessage(i $HWNDPARENT, i ${WM_COMMAND}, i 1, i $R0)"
+!macroend
+
;--------------------------------
;Install Files
SetOutPath "$INSTDIR"
SectionEnd
+Section "-Clean Up Old Cruft"
+ !insertmacro PrintProgress "$(X264_LANG_STATUS_CLEANUP)"
+ !insertmacro CleanUpFiles ""
+SectionEnd
+
Section "!Install Files"
!insertmacro PrintProgress "$(X264_LANG_STATUS_INSTFILES)"
-
- Delete `$INSTDIR\*.exe`
- Delete `$INSTDIR\*.dll`
- Delete `$INSTDIR\*.txt`
- Delete `$INSTDIR\toolset\*.exe`
- Delete `$INSTDIR\toolset\*.dll`
- Delete `$INSTDIR\toolset\x86\*.exe`
- Delete `$INSTDIR\toolset\x86\*.dll`
- Delete `$INSTDIR\toolset\x64\*.exe`
- Delete `$INSTDIR\toolset\x64\*.dll`
- Delete `$INSTDIR\toolset\common\*.exe`
- Delete `$INSTDIR\toolset\common\*.dll`
- Delete `$INSTDIR\toolset\common\*.gpg`
- Delete `$INSTDIR\imageformats\*.dll`
-
- !insertmacro GetExecutableName $R0
-
+
DeleteOldBinary:
+ !insertmacro GetExecutableName $R0
ClearErrors
Delete "$INSTDIR\$R0"
MessageBox MB_TOPMOST|MB_ICONSTOP|MB_RETRYCANCEL 'Could not delete old "$R0" file. Is program still running?' IDRETRY DeleteOldBinary
Abort "Could not delete old binary!"
${EndIf}
-
- SetOutPath "$INSTDIR"
- File /a `/oname=$R0` `${X264_SOURCE_PATH}\x264_launcher.exe`
- SetOutPath "$INSTDIR\imageformats"
- File /a `${X264_SOURCE_PATH}\imageformats\*.dll`
+ File /a `/oname=$R0` `${X264_SOURCE_PATH}\x264_launcher.exe`
- SetOutPath "$INSTDIR\toolset\x86"
- File /a `${X264_SOURCE_PATH}\toolset\x86\*.exe`
- File /nonfatal /a `${X264_SOURCE_PATH}\toolset\x86\*.dll`
+ File /a `${X264_SOURCE_PATH}\*.dll`
+ File /a `${X264_SOURCE_PATH}\*.txt`
+ File /a `${X264_SOURCE_PATH}\*.html`
- SetOutPath "$INSTDIR\toolset\x64"
- File /a `${X264_SOURCE_PATH}\toolset\x64\*.exe`
- File /nonfatal /a `${X264_SOURCE_PATH}\toolset\x64\*.dll`
+ SetOutPath "$INSTDIR\imageformats"
+ File /a /r `${X264_SOURCE_PATH}\imageformats\*.*`
- SetOutPath "$INSTDIR\toolset\common"
- File /a `${X264_SOURCE_PATH}\toolset\common\*.exe`
- File /a `${X264_SOURCE_PATH}\toolset\common\*.gpg`
- File /nonfatal /a `${X264_SOURCE_PATH}\toolset\common\*.dll`
+ SetOutPath "$INSTDIR\toolset"
+ File /a /r `${X264_SOURCE_PATH}\toolset\*.*`
- SetOutPath "$INSTDIR"
- File /a `${X264_SOURCE_PATH}\*.dll`
- File /a `${X264_SOURCE_PATH}\*.txt`
+ SetOutPath "$INSTDIR\sources"
+ File /a /r `${X264_SOURCE_PATH}\sources\*.*`
SectionEnd
Section "-Write Uinstaller"
!insertmacro GetExecutableName $R0
- CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Simple x264 Launcher.lnk" "$INSTDIR\$R0" "" "$INSTDIR\$R0" 0
- CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(X264_LANG_LINK_LICENSE).lnk" "$INSTDIR\License.txt"
- CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(X264_LANG_LINK_CHANGELOG).lnk" "$INSTDIR\History.txt"
- CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(X264_LANG_LINK_MANUAL).lnk" "$INSTDIR\ReadMe.txt"
+ CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Simple x264 Launcher.lnk" "$INSTDIR\$R0" "" "$INSTDIR\$R0" 0
+ CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(X264_LANG_LINK_LICENSE).lnk" "$INSTDIR\LICENSE.html"
+ CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(X264_LANG_LINK_MANUAL).lnk" "$INSTDIR\README.html"
+ CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(X264_LANG_LINK_CHANGELOG).lnk" "$INSTDIR\HISTORY.txt"
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(X264_LANG_LINK_UNINSTALL).lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0
!insertmacro CreateWebLink "$SMPROGRAMS\$StartMenuFolder\MuldeR's Homepage.url" "${MyWebSite}"
- !insertmacro CreateWebLink "$SMPROGRAMS\$StartMenuFolder\Doom9's Forum.url" "http://forum.doom9.org/"
- !insertmacro CreateWebLink "$SMPROGRAMS\$StartMenuFolder\x264.com.url" "http://www.x264.com/"
- !insertmacro CreateWebLink "$SMPROGRAMS\$StartMenuFolder\Avisynth Wiki.url" "http://avisynth.nl/"
- !insertmacro CreateWebLink "$SMPROGRAMS\$StartMenuFolder\VapourSynth.com.url" "http://www.vapoursynth.com/"
+ !insertmacro CreateWebLink "$SMPROGRAMS\$StartMenuFolder\Doom9's Forum.url" "http://forum.doom9.org/"
+ !insertmacro CreateWebLink "$SMPROGRAMS\$StartMenuFolder\x264.com.url" "http://x264.com/"
+ !insertmacro CreateWebLink "$SMPROGRAMS\$StartMenuFolder\x265.com.url" "http://x265.org/"
+ !insertmacro CreateWebLink "$SMPROGRAMS\$StartMenuFolder\Avisynth Wiki.url" "http://avisynth.nl/"
+ !insertmacro CreateWebLink "$SMPROGRAMS\$StartMenuFolder\VapourSynth.com.url" "http://www.vapoursynth.com/"
${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\Simple x264 Launcher.lnk"
- ${StdUtils.InvokeShellVerb} $R1 "$SMPROGRAMS\$StartMenuFolder" "Simple x264 Launcher.lnk" ${StdUtils.Const.ISV_PinToTaskbar}
+ ${StdUtils.InvokeShellVerb} $R1 "$SMPROGRAMS\$StartMenuFolder" "Simple x264 Launcher.lnk" ${StdUtils.Const.ShellVerb.PinToTaskbar}
DetailPrint 'Pin: "$SMPROGRAMS\$StartMenuFolder\Simple x264 Launcher.lnk" -> $R1'
${EndIf}
!insertmacro MUI_STARTMENU_WRITE_END
WriteRegStr HKLM "${MyRegPath}" "DisplayVersion" "Build #${X264_BUILD} (${X264_DATE})"
WriteRegStr HKLM "${MyRegPath}" "URLInfoAbout" "${MyWebSite}"
WriteRegStr HKLM "${MyRegPath}" "URLUpdateInfo" "${MyWebSite}"
+
+ DeleteRegKey HKCU "${AppPaths}\x264_launcher.exe"
+ WriteRegStr HKLM "${AppPaths}\x264_launcher.exe" "" "$INSTDIR\$R0"
+ WriteRegStr HKLM "${AppPaths}\x264_launcher.exe" "Path" "$INSTDIR"
SectionEnd
Section "-Finished"
!insertmacro PrintProgress "$(MUI_TEXT_FINISH_TITLE)."
+ ${IfThen} ${UnattendedMode} ${|} SetAutoClose true ${|}
SectionEnd
;--------------------------------
Section "Uninstall"
- SetOutPath "$INSTDIR"
+ SetOutPath "$EXEDIR"
!insertmacro PrintProgress "$(X264_LANG_STATUS_UNINSTALL)"
; --------------
${IfNot} "$StartMenuFolder" == ""
SetShellVarContext current
${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\Simple x264 Launcher.lnk"
- ${StdUtils.InvokeShellVerb} $R1 "$SMPROGRAMS\$StartMenuFolder" "Simple x264 Launcher.lnk" ${StdUtils.Const.ISV_UnpinFromTaskbar}
+ ${StdUtils.InvokeShellVerb} $R1 "$SMPROGRAMS\$StartMenuFolder" "Simple x264 Launcher.lnk" ${StdUtils.Const.ShellVerb.UnpinFromTaskbar}
DetailPrint 'Unpin: "$SMPROGRAMS\$StartMenuFolder\Simple x264 Launcher.lnk" -> $R1'
${EndIf}
${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\*.*"
SetShellVarContext all
${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\Simple x264 Launcher.lnk"
- ${StdUtils.InvokeShellVerb} $R1 "$SMPROGRAMS\$StartMenuFolder" "Simple x264 Launcher.lnk" ${StdUtils.Const.ISV_UnpinFromTaskbar}
+ ${StdUtils.InvokeShellVerb} $R1 "$SMPROGRAMS\$StartMenuFolder" "Simple x264 Launcher.lnk" ${StdUtils.Const.ShellVerb.UnpinFromTaskbar}
DetailPrint 'Unpin: "$SMPROGRAMS\$StartMenuFolder\Simple x264 Launcher.lnk" -> $R1'
${EndIf}
${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\*.*"
ReadRegStr $R0 HKLM "${MyRegPath}" "ExecutableName"
${IfThen} "$R0" == "" ${|} StrCpy $R0 "x264_launcher.exe" ${|}
- DeleteAppBinary:
- ClearErrors
- Delete `$INSTDIR\$R0`
-
- ${If} ${Errors}
- MessageBox MB_TOPMOST|MB_ICONSTOP|MB_RETRYCANCEL 'Could not delete the "$R0" file. Is program still running?' IDRETRY DeleteAppBinary
- Abort "Could not delete application binary!"
- ${EndIf}
-
- Delete /REBOOTOK `$INSTDIR\*.exe`
- Delete /REBOOTOK `$INSTDIR\*.dll`
- Delete /REBOOTOK `$INSTDIR\*.txt`
- Delete /REBOOTOK `$INSTDIR\toolset\*.exe`
- Delete /REBOOTOK `$INSTDIR\toolset\*.dll`
- Delete /REBOOTOK `$INSTDIR\toolset\x86\*.exe`
- Delete /REBOOTOK `$INSTDIR\toolset\x86\*.dll`
- Delete /REBOOTOK `$INSTDIR\toolset\x64\*.exe`
- Delete /REBOOTOK `$INSTDIR\toolset\x64\*.dll`
- Delete /REBOOTOK `$INSTDIR\toolset\common\*.exe`
- Delete /REBOOTOK `$INSTDIR\toolset\common\*.dll`
- Delete /REBOOTOK `$INSTDIR\toolset\common\*.gpg`
- Delete /REBOOTOK `$INSTDIR\imageformats\*.dll`
-
- RMDir /r /REBOOTOK "$INSTDIR"
+ Delete /REBOOTOK "$INSTDIR\$R0"
+ !insertmacro CleanUpFiles /REBOOTOK
+ RMDir "$INSTDIR"
; --------------
; Registry
DeleteRegKey HKLM "SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{54dcbccb-c905-46dc-b6e6-48563d0e9e55}"
DeleteRegKey HKCU "SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{54dcbccb-c905-46dc-b6e6-48563d0e9e55}"
+ DeleteRegKey HKLM "${AppPaths}\x264_launcher.exe"
+ DeleteRegKey HKCU "${AppPaths}\x264_launcher.exe"
+
MessageBox MB_YESNO|MB_TOPMOST "$(X264_LANG_UNINST_PERSONAL)" IDNO +3
Delete "$LOCALAPPDATA\LoRd_MuldeR\Simple x264 Launcher\*.ini"
RMDir "$LOCALAPPDATA\LoRd_MuldeR\Simple x264 Launcher"
;Check For Update Mode
;--------------------------------
-Function CheckForUpdate
- ${StdUtils.GetParameter} $R0 "Update" "?"
- ${IfNotThen} "$R0" == "?" ${|} Goto EnableUpdateMode ${|}
-
- ${IfThen} "$INSTDIR" == "" ${|} Return ${|}
- ${IfThen} "$INSTDIR" == "$EXEDIR" ${|} Return ${|}
- ${IfNotThen} ${FileExists} "$INSTDIR\x264_launcher.exe" ${|} Return ${|}
-
- EnableUpdateMode:
-
- FindWindow $R0 "#32770" "" $HWNDPARENT
- GetDlgItem $R1 $R0 1019
- EnableWindow $R1 0
+Function SkipIfUnattended
+ ${IfThen} ${UnattendedMode} ${|} Abort ${|}
+FunctionEnd
- FindWindow $R0 "#32770" "" $HWNDPARENT
- GetDlgItem $R1 $R0 1001
- EnableWindow $R1 0
+Function CheckForUpdate
+ ${If} "$INSTDIR" == ""
+ ${OrIf} "$INSTDIR" == "$EXEDIR"
+ ${OrIfNot} ${FileExists} "$INSTDIR\x264_launcher.exe"
+ StrCpy $UpdateNotificationShown FALSE
+ !insertmacro SetControlEnabled 1019 1
+ !insertmacro SetControlEnabled 1001 1
+ Return
+ ${Else}
+ !insertmacro SetControlEnabled 1019 0
+ !insertmacro SetControlEnabled 1001 0
+ ${If} "$UpdateNotificationShown" != TRUE
+ StrCpy $UpdateNotificationShown TRUE
+ MessageBox MB_ICONINFORMATION|MB_TOPMOST "$(X264_LANG_UNINST_UPDATE_MODE)"
+ !insertmacro SkipToNextPage
+ ${EndIf}
+ ${EndIf}
FunctionEnd
Function un.CheckForcedUninstall
- ${StdUtils.GetParameter} $R0 "Force" "?"
- ${IfNotThen} "$R0" == "?" ${|} Abort ${|}
+ ${IfThen} ${ForcedMode} ${|} Abort ${|}
FunctionEnd
;Locked List
;--------------------------------
-Function LockedListShow
+!macro _LockedListShow uinst
!insertmacro MUI_HEADER_TEXT "$(X264_LANG_LOCKEDLIST_HEADER)" "$(X264_LANG_LOCKEDLIST_TEXT)"
+ ${If} ${UnattendedMode}
+ !insertmacro DisableBackButton $R0
+ ${EndIf}
+ ${If} ${RunningX64}
+ InitPluginsDir
+ File /oname=$PLUGINSDIR\LockedList64.dll `${NSISDIR}\Plugins\LockedList64.dll`
+ ${EndIf}
!insertmacro GetExecutableName $R0
LockedList::AddModule "\$R0"
+ ${If} "$R0" != "x264_launcher.exe"
+ LockedList::AddModule "\x264_launcher.exe"
+ ${EndIf}
LockedList::AddModule "\Uninstall.exe"
- LockedList::AddModule "\Au_.exe"
+ !if ${uinst} < 1
+ LockedList::AddModule "\Au_.exe"
+ !endif
+ #LockedList::AddFolder "$INSTDIR"
LockedList::Dialog /autonext /heading "$(X264_LANG_LOCKEDLIST_HEADING)" /noprograms "$(X264_LANG_LOCKEDLIST_NOPROG)" /searching "$(X264_LANG_LOCKEDLIST_SEARCH)" /colheadings "$(X264_LANG_LOCKEDLIST_COLHDR1)" "$(X264_LANG_LOCKEDLIST_COLHDR2)"
Pop $R0
+!macroend
+
+Function LockedListShow
+ !insertmacro _LockedListShow 0
FunctionEnd
Function un.LockedListShow
- !insertmacro MUI_HEADER_TEXT "$(X264_LANG_LOCKEDLIST_HEADER)" "$(X264_LANG_LOCKEDLIST_TEXT)"
- LockedList::AddModule "\x264_launcher.exe"
- LockedList::AddModule "\Uninstall.exe"
- LockedList::Dialog /autonext /heading "$(X264_LANG_LOCKEDLIST_HEADING)" /noprograms "$(X264_LANG_LOCKEDLIST_NOPROG)" /searching "$(X264_LANG_LOCKEDLIST_SEARCH)" /colheadings "$(X264_LANG_LOCKEDLIST_COLHDR1)" "$(X264_LANG_LOCKEDLIST_COLHDR2)"
- Pop $R0
+ !insertmacro _LockedListShow 1
FunctionEnd
Function ShowReadmeFunction
!insertmacro DisableNextButton $R0
- ${StdUtils.ExecShellAsUser} $R1 "$INSTDIR\ReadMe.txt" "open" ""
+ ${StdUtils.ExecShellAsUser} $R1 "$INSTDIR\README.html" "open" ""
+FunctionEnd
+
+Function .onInstSuccess
+ ${If} ${UnattendedMode}
+ !insertmacro GetExecutableName $R0
+ ${StdUtils.ExecShellAsUser} $R1 "$INSTDIR" "explore" ""
+ ${StdUtils.ExecShellAsUser} $R1 "$INSTDIR\$R0" "open" "--first-run"
+ ${EndIf}
FunctionEnd