2013-08-04 13:18:07 +00:00
|
|
|
;--------------------------------
|
2014-01-19 15:29:27 +00:00
|
|
|
; FileBot NSIS installer script
|
2013-08-04 13:18:07 +00:00
|
|
|
;--------------------------------
|
|
|
|
|
|
|
|
!define PRODUCT_PROPER_NAME "FileBot"
|
|
|
|
!define INSTALLER_EXE_NAME "FileBot-setup.exe"
|
|
|
|
|
|
|
|
!define OPTION_USE_MUI_2
|
|
|
|
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
; Installer Configuration
|
|
|
|
;--------------------------------
|
|
|
|
|
|
|
|
; Request admin privileges for Windows Vista, 7.
|
|
|
|
RequestExecutionLevel admin
|
|
|
|
|
|
|
|
; Name (shown in various places in the installer UI)
|
|
|
|
Name "${PRODUCT_PROPER_NAME}"
|
|
|
|
|
|
|
|
; Output file generated by NSIS compiler
|
|
|
|
OutFile "${INSTALLER_EXE_NAME}"
|
|
|
|
|
|
|
|
; Use lzma compression
|
|
|
|
SetCompressor lzma
|
|
|
|
|
|
|
|
; Optimize Data Block
|
|
|
|
SetDatablockOptimize on
|
|
|
|
|
|
|
|
; Restore last write datestamp of files
|
|
|
|
; SetDateSave on
|
|
|
|
|
2014-01-19 15:29:27 +00:00
|
|
|
; Show installation details
|
2013-08-04 13:18:07 +00:00
|
|
|
ShowInstDetails show
|
|
|
|
ShowUnInstDetails show
|
|
|
|
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
; Includes
|
|
|
|
;--------------------------------
|
|
|
|
!include "MUI2.nsh"
|
2014-01-19 15:29:27 +00:00
|
|
|
!include "x64.nsh"
|
2013-08-04 13:18:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
; Modern UI Configuration
|
|
|
|
;--------------------------------
|
|
|
|
|
|
|
|
; MUI Settings
|
|
|
|
!define MUI_ABORTWARNING
|
|
|
|
|
2013-06-15 10:01:31 +00:00
|
|
|
; MUI Settings / Icons
|
2013-08-04 13:18:07 +00:00
|
|
|
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico"
|
|
|
|
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall.ico"
|
2013-06-15 10:01:31 +00:00
|
|
|
|
|
|
|
; MUI Settings / Header
|
|
|
|
!define MUI_HEADERIMAGE
|
|
|
|
!define MUI_HEADERIMAGE_RIGHT
|
2013-08-04 13:18:07 +00:00
|
|
|
!define MUI_HEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\orange-r.bmp"
|
|
|
|
!define MUI_HEADERIMAGE_UNBITMAP "${NSISDIR}\Contrib\Graphics\Header\orange-uninstall-r.bmp"
|
|
|
|
|
2013-06-15 10:01:31 +00:00
|
|
|
; MUI Settings / Wizard
|
2013-08-04 13:18:07 +00:00
|
|
|
!define MUI_WELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\orange.bmp"
|
|
|
|
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\orange-uninstall.bmp"
|
|
|
|
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
; Installer pages
|
|
|
|
;--------------------------------
|
2013-06-15 10:01:31 +00:00
|
|
|
|
2013-08-04 13:18:07 +00:00
|
|
|
; Welcome page
|
2013-06-15 10:01:31 +00:00
|
|
|
!insertmacro MUI_PAGE_WELCOME
|
2013-08-04 13:18:07 +00:00
|
|
|
|
|
|
|
; End user license agreement
|
2014-01-19 15:29:27 +00:00
|
|
|
!insertmacro MUI_PAGE_LICENSE "FileBot_EULA.txt"
|
|
|
|
|
|
|
|
; Perform installation
|
2013-06-15 10:01:31 +00:00
|
|
|
!insertmacro MUI_PAGE_INSTFILES
|
2013-08-04 13:18:07 +00:00
|
|
|
|
|
|
|
; Finish page
|
|
|
|
!insertmacro MUI_PAGE_FINISH
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
; Language support
|
|
|
|
;--------------------------------
|
|
|
|
|
2013-06-15 10:01:31 +00:00
|
|
|
!insertmacro MUI_LANGUAGE "English"
|
2013-08-04 13:18:07 +00:00
|
|
|
LangString Section_Name_MainProduct ${LANG_ENGLISH} "${PRODUCT_PROPER_NAME}"
|
2013-06-15 10:01:31 +00:00
|
|
|
|
2013-08-04 13:18:07 +00:00
|
|
|
|
|
|
|
;---------------------------
|
|
|
|
; Install sections
|
|
|
|
;---------------------------
|
|
|
|
Var MSI_STATUS
|
|
|
|
|
|
|
|
|
2014-01-19 15:29:27 +00:00
|
|
|
Section MAIN
|
2013-12-26 05:29:39 +00:00
|
|
|
DetailPrint "Uninstalling previous versions..."
|
|
|
|
nsExec::Exec `Powershell.exe -inputformat none -noprofile -windowstyle hidden -Command "(Get-WmiObject -Class Win32_Product -Filter \"Name = 'FileBot'\").uninstall()"`
|
2013-08-04 13:18:07 +00:00
|
|
|
|
|
|
|
DetailPrint "Downloading latest version..."
|
|
|
|
${if} ${RunningX64}
|
2015-06-03 13:24:13 +00:00
|
|
|
inetc::get /USERAGENT "nsis" /caption "Downloading FileBot (64-bit)" "https://app.filebot.net/download.php?type=msi&arch=x64" "$PLUGINSDIR\FileBot.msi" /end
|
2013-08-04 13:18:07 +00:00
|
|
|
${else}
|
2015-06-03 13:24:13 +00:00
|
|
|
inetc::get /USERAGENT "nsis" /caption "Downloading FileBot (32-bit)" "https://app.filebot.net/download.php?type=msi&arch=x86" "$PLUGINSDIR\FileBot.msi" /end
|
2013-08-04 13:18:07 +00:00
|
|
|
${endif}
|
|
|
|
|
|
|
|
DetailPrint "Installing latest version..."
|
2014-03-05 05:30:54 +00:00
|
|
|
nsExec::Exec `msiexec /passive /norestart /i "$PLUGINSDIR\FileBot.msi"`
|
2013-08-04 13:18:07 +00:00
|
|
|
Pop $MSI_STATUS # grab return value
|
|
|
|
|
|
|
|
${if} $MSI_STATUS == "0"
|
2015-10-18 19:18:25 +00:00
|
|
|
DetailPrint "Optimizing..."
|
|
|
|
nsExec::Exec `"C:\Program Files\FileBot\filebot.exe" -script "g:java.util.prefs.Preferences.userRoot(); net.sf.ehcache.CacheManager.getInstance().clearAll(); net.filebot.media.MediaDetection.warmupCachedResources();"`
|
2014-11-07 09:20:38 +00:00
|
|
|
DetailPrint "Done."
|
2013-08-04 13:18:07 +00:00
|
|
|
${else}
|
2013-08-07 18:36:28 +00:00
|
|
|
DetailPrint "msiexec error $MSI_STATUS"
|
2014-01-13 04:11:05 +00:00
|
|
|
DetailPrint "Install failed. Please download the .msi package manually."
|
2013-06-15 10:01:31 +00:00
|
|
|
Abort
|
2013-08-04 13:18:07 +00:00
|
|
|
${endif}
|
2013-06-15 10:01:31 +00:00
|
|
|
SectionEnd
|