filebot/installer/nsis/filebot.nsi

127 lines
3.9 KiB
Plaintext
Raw Normal View History

2013-08-04 13:18:07 +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
; Show installation details
2013-08-04 13:18:07 +00:00
ShowInstDetails show
ShowUnInstDetails show
;--------------------------------
; Includes
;--------------------------------
!include "MUI2.nsh"
!include "x64.nsh"
2013-08-04 13:18:07 +00:00
;--------------------------------
; Modern UI Configuration
;--------------------------------
; MUI Settings
!define MUI_ABORTWARNING
; 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"
; 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"
; 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-08-04 13:18:07 +00:00
; Welcome page
!insertmacro MUI_PAGE_WELCOME
2013-08-04 13:18:07 +00:00
; End user license agreement
!insertmacro MUI_PAGE_LICENSE "FileBot_EULA.txt"
; Perform installation
!insertmacro MUI_PAGE_INSTFILES
2013-08-04 13:18:07 +00:00
; Finish page
!insertmacro MUI_PAGE_FINISH
;--------------------------------
; Language support
;--------------------------------
!insertmacro MUI_LANGUAGE "English"
2013-08-04 13:18:07 +00:00
LangString Section_Name_MainProduct ${LANG_ENGLISH} "${PRODUCT_PROPER_NAME}"
2013-08-04 13:18:07 +00:00
;---------------------------
; Install sections
;---------------------------
Var MSI_STATUS
Section MAIN
DetailPrint "Uninstalling previous versions..."
2016-04-08 23:50:29 +00:00
nsExec::Exec `start "wmic" /b cmd.exe /c wmic.exe product where name="FileBot" call 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}
2013-08-04 13:18:07 +00:00
DetailPrint "Installing latest version..."
2016-04-09 08:33:48 +00:00
nsExec::Exec `msiexec.exe /passive /norestart /i "$PLUGINSDIR\FileBot.msi"`
2013-08-04 13:18:07 +00:00
Pop $MSI_STATUS # grab return value
2013-08-04 13:18:07 +00:00
${if} $MSI_STATUS == "0"
DetailPrint "Optimizing..."
2016-03-08 16:40:44 +00:00
nsExec::ExecToLog `"C:\Program Files\FileBot\filebot.exe" -script "g:println net.filebot.Settings.getApplicationIdentifier(); println 'JRE: ' + Settings.getJavaRuntimeIdentifier(); println String.format('JVM: %d-bit %s', com.sun.jna.Platform.is64Bit() ? 64 : 32, System.getProperty('java.vm.name')); java.util.prefs.Preferences.userRoot(); net.filebot.CacheManager.getInstance().clearAll(); net.filebot.media.MediaDetection.warmupCachedResources();" --log OFF`
2016-04-09 08:33:48 +00:00
DetailPrint "Done. Before you get started, please have a look at the FAQ."
2016-04-09 11:35:12 +00:00
ExecShell open `https://app.filebot.net/getting-started/index.html`
ExecShell open `https://app.filebot.net/manual.html`
2013-08-04 13:18:07 +00:00
${else}
DetailPrint "msiexec error $MSI_STATUS"
DetailPrint "Installation failed. Please download the .msi package manually."
2016-04-09 08:33:48 +00:00
ExecShell open `https://app.filebot.net/download.php`
Abort
2013-08-04 13:18:07 +00:00
${endif}
SectionEnd