; ///////////////////////////////////////////////////////////////////////////////
; // Simple x264 Launcher
-; // Copyright (C) 2004-2016 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}" '"..\mt.exe" -manifest "setup.manifest" -outputresource:"${PACKHDRTEMP};1"'
+!packhdr "${PACKHDRTEMP}" '"..\..\..\Prerequisites\MSVC\redist\bin\mt.exe" -manifest "setup.manifest" -outputresource:"${PACKHDRTEMP};1" && "..\..\..\Prerequisites\UPX\upx.exe" --brute "${PACKHDRTEMP}"'
;--------------------------------
SetCompressor /SOLID LZMA
SetCompressorDictSize 64
-#!packhdr "$%TEMP%\exehead.tmp" '"${X264_UPX_PATH}\upx.exe" --brute "$%TEMP%\exehead.tmp"'
-
;--------------------------------
;Reserved Files
;--------------------------------
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-2016 LoRd_MuldeR"
+VIAddVersionKey "LegalCopyright" "Copyright 2004-2019 LoRd_MuldeR"
VIAddVersionKey "LegalTrademarks" "GNU"
VIAddVersionKey "OriginalFilename" "x264_x64.${X264_DATE}.exe"
VIAddVersionKey "ProductName" "Simple x264 Launcher"
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}
; --------
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
!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}" "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
${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\*.*"
DeleteRegKey HKCU "SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{54dcbccb-c905-46dc-b6e6-48563d0e9e55}"
DeleteRegKey HKLM "${AppPaths}\x264_launcher.exe"
- DeleteRegKey HKCU "${AppPaths}\x264_launcherexe"
+ 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"
${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}
-
- FindWindow $R0 "#32770" "" $HWNDPARENT
- GetDlgItem $R1 $R0 1019
- EnableWindow $R1 0
-
- FindWindow $R0 "#32770" "" $HWNDPARENT
- GetDlgItem $R1 $R0 1001
- EnableWindow $R1 0
FunctionEnd
Function un.CheckForcedUninstall
!if ${uinst} < 1
LockedList::AddModule "\Au_.exe"
!endif
- LockedList::AddFolder "$INSTDIR"
+ #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