OSDN Git Service

Updated copyright year.
[x264-launcher/x264-launcher.git] / etc / setup / setup.nsi
index 6e15644..4244e6e 100644 (file)
@@ -1,6 +1,6 @@
 ; ///////////////////////////////////////////////////////////////////////////////
 ; // 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
@@ -40,9 +40,6 @@
 !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}"'
 
 
 ;--------------------------------
@@ -90,8 +90,6 @@ InstallDirRegKey HKLM "${MyRegPath}" "InstallLocation"
 SetCompressor /SOLID LZMA
 SetCompressorDictSize 64
 
-#!packhdr "$%TEMP%\exehead.tmp" '"${X264_UPX_PATH}\upx.exe" --brute "$%TEMP%\exehead.tmp"'
-
 
 ;--------------------------------
 ;Reserved Files
@@ -129,7 +127,7 @@ VIAddVersionKey "Comments" "This program is free software; you can redistribute
 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"
@@ -319,35 +317,21 @@ Function .onInit
                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}
 
        ; --------
@@ -569,7 +553,7 @@ Section "-Create Shortcuts"
                !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
@@ -589,6 +573,7 @@ Section "-Update Registry"
        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
@@ -615,7 +600,7 @@ Section "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\*.*"
@@ -626,7 +611,7 @@ Section "Uninstall"
                
                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\*.*"
@@ -658,7 +643,7 @@ Section "Uninstall"
        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"