Some work about adaptive color scheme for Web UI (PR #19901)
http://[316:c51a:62a3:8b9::4]/d4708/qBittorrent/src/branch/adaptive-webui
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
153 lines
4.6 KiB
153 lines
4.6 KiB
2 years ago
|
; Uncomment when packaging 64bit qbittorrent
|
||
|
;!define QBT_IS_X64
|
||
|
|
||
|
; Uncomment when packaging qt6 qbittorrent
|
||
|
; It will also define QBT_IS_X64
|
||
|
;!define QBT_USES_QT6
|
||
|
|
||
|
!ifdef QBT_USES_QT6
|
||
|
!define /redef QBT_IS_X64
|
||
|
!endif
|
||
|
|
||
|
; qBittorrent version
|
||
|
!define /ifndef QBT_VERSION "4.5.0"
|
||
|
|
||
4 years ago
|
Unicode true
|
||
8 years ago
|
ManifestDPIAware true
|
||
12 years ago
|
;Compress the header too
|
||
|
!packhdr "$%TEMP%\exehead.tmp" 'upx.exe -9 --best --ultra-brute "$%TEMP%\exehead.tmp"'
|
||
|
|
||
|
;Setting the compression
|
||
|
SetCompressor /SOLID LZMA
|
||
|
SetCompressorDictSize 64
|
||
|
XPStyle on
|
||
|
|
||
10 years ago
|
!include "MUI.nsh"
|
||
|
!include "UAC.nsh"
|
||
12 years ago
|
!include "FileFunc.nsh"
|
||
5 years ago
|
!include "WinVer.nsh"
|
||
2 years ago
|
!ifdef QBT_IS_X64
|
||
8 years ago
|
!include "x64.nsh"
|
||
|
!endif
|
||
12 years ago
|
|
||
|
;For the file association
|
||
|
!define SHCNE_ASSOCCHANGED 0x8000000
|
||
|
!define SHCNF_IDLIST 0
|
||
|
|
||
|
;For special folder detection
|
||
|
!define CSIDL_APPDATA '0x1A' ;Application Data path
|
||
|
!define CSIDL_LOCALAPPDATA '0x1C' ;Local Application Data path
|
||
|
|
||
10 years ago
|
!define MUI_FINISHPAGE_RUN
|
||
|
!define MUI_FINISHPAGE_RUN_FUNCTION PageFinishRun
|
||
12 years ago
|
!define MUI_FINISHPAGE_RUN_TEXT $(launch_qbt)
|
||
12 years ago
|
|
||
2 years ago
|
!ifndef QBT_IS_X64
|
||
8 years ago
|
; The name of the installer
|
||
2 years ago
|
Name "qBittorrent ${QBT_VERSION}"
|
||
12 years ago
|
|
||
8 years ago
|
; The file to write
|
||
2 years ago
|
OutFile "qbittorrent_${QBT_VERSION}_setup.exe"
|
||
|
!else ; QBT_IS_X64
|
||
|
!ifndef QBT_USES_QT6
|
||
|
; The name of the installer
|
||
|
Name "qBittorrent ${QBT_VERSION} x64"
|
||
|
|
||
|
; The file to write
|
||
|
OutFile "qbittorrent_${QBT_VERSION}_x64_setup.exe"
|
||
|
!else ; QBT_USES_QT6
|
||
|
; The name of the installer
|
||
|
Name "qBittorrent ${QBT_VERSION} (qt6) x64"
|
||
|
|
||
|
; The file to write
|
||
|
OutFile "qbittorrent_${QBT_VERSION}_qt6_x64_setup.exe"
|
||
|
!endif ; QBT_USES_QT6
|
||
|
!endif ; QBT_IS_X64
|
||
12 years ago
|
|
||
12 years ago
|
;Installer Version Information
|
||
|
VIAddVersionKey "ProductName" "qBittorrent"
|
||
12 years ago
|
VIAddVersionKey "CompanyName" "The qBittorrent project"
|
||
3 years ago
|
VIAddVersionKey "LegalCopyright" "Copyright ©2006-2022 The qBittorrent project"
|
||
12 years ago
|
VIAddVersionKey "FileDescription" "qBittorrent - A Bittorrent Client"
|
||
2 years ago
|
VIAddVersionKey "FileVersion" "${QBT_VERSION}"
|
||
12 years ago
|
|
||
2 years ago
|
VIProductVersion "${QBT_VERSION}.0"
|
||
12 years ago
|
|
||
8 years ago
|
; The default installation directory. It changes depending if we install in the 64bit dir or not.
|
||
|
; A caveat of this is if a user has installed a 32bit version and then runs the 64bit installer
|
||
|
; (which in turn launches the 32bit uninstaller first) the value will still point to the 32bit location.
|
||
|
; The user has to manually uninstall the old version and THEN run the 64bit installer
|
||
2 years ago
|
!ifndef QBT_IS_X64
|
||
8 years ago
|
InstallDir $PROGRAMFILES32\qBittorrent
|
||
|
!else
|
||
|
InstallDir $PROGRAMFILES64\qBittorrent
|
||
|
!endif
|
||
12 years ago
|
|
||
5 years ago
|
; Registry key to check for directory (so if you install again, it will
|
||
12 years ago
|
; overwrite the old one automatically)
|
||
|
InstallDirRegKey HKLM Software\qbittorrent InstallLocation
|
||
|
|
||
|
; Request application privileges for Windows Vista
|
||
10 years ago
|
RequestExecutionLevel user
|
||
12 years ago
|
|
||
|
;--------------------------------
|
||
|
;General Settings
|
||
|
!define MUI_ABORTWARNING
|
||
|
!define MUI_HEADERIMAGE
|
||
|
!define MUI_COMPONENTSPAGE_NODESC
|
||
|
;!define MUI_ICON "qbittorrent.ico"
|
||
|
!define MUI_LICENSEPAGE_CHECKBOX
|
||
|
!define MUI_LANGDLL_ALLLANGUAGES
|
||
|
|
||
|
;--------------------------------
|
||
|
;Remember the unistaller/installer language
|
||
5 years ago
|
!define MUI_LANGDLL_REGISTRY_ROOT "HKLM"
|
||
|
!define MUI_LANGDLL_REGISTRY_KEY "Software\qbittorrent"
|
||
12 years ago
|
!define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
|
||
|
|
||
|
;--------------------------------
|
||
|
;Installer Pages
|
||
|
!insertmacro MUI_PAGE_WELCOME
|
||
|
!insertmacro MUI_PAGE_LICENSE "license.txt"
|
||
|
!insertmacro MUI_PAGE_COMPONENTS
|
||
12 years ago
|
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE check_instance
|
||
12 years ago
|
!insertmacro MUI_PAGE_DIRECTORY
|
||
|
!insertmacro MUI_PAGE_INSTFILES
|
||
12 years ago
|
!insertmacro MUI_PAGE_FINISH
|
||
12 years ago
|
|
||
|
;--------------------------------
|
||
|
;Uninstaller Pages
|
||
|
!insertmacro MUI_UNPAGE_CONFIRM
|
||
12 years ago
|
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE un.check_instance
|
||
12 years ago
|
!insertmacro MUI_UNPAGE_COMPONENTS
|
||
|
!insertmacro MUI_UNPAGE_INSTFILES
|
||
|
|
||
|
!insertmacro MUI_RESERVEFILE_LANGDLL
|
||
12 years ago
|
ReserveFile "${NSISDIR}\Plugins\x86-unicode\FindProcDLL.dll"
|
||
10 years ago
|
ReserveFile "${NSISDIR}\Plugins\x86-unicode\UAC.dll"
|
||
|
|
||
|
!macro Init thing
|
||
|
uac_tryagain:
|
||
|
!insertmacro UAC_RunElevated
|
||
|
${Switch} $0
|
||
|
${Case} 0
|
||
|
${IfThen} $1 = 1 ${|} Quit ${|} ;we are the outer process, the inner process has done its work, we are done
|
||
|
${IfThen} $3 <> 0 ${|} ${Break} ${|} ;we are admin, let the show go on
|
||
|
${If} $1 = 3 ;RunAs completed successfully, but with a non-admin user
|
||
|
MessageBox mb_YesNo|mb_IconExclamation|mb_TopMost|mb_SetForeground "This ${thing} requires admin privileges, try again" /SD IDNO IDYES uac_tryagain IDNO 0
|
||
|
${EndIf}
|
||
|
;fall-through and die
|
||
|
${Case} 1223
|
||
|
MessageBox mb_IconStop|mb_TopMost|mb_SetForeground "This ${thing} requires admin privileges, aborting!"
|
||
|
Quit
|
||
|
${Case} 1062
|
||
|
MessageBox mb_IconStop|mb_TopMost|mb_SetForeground "Logon service not running, aborting!"
|
||
|
Quit
|
||
|
${Default}
|
||
|
MessageBox mb_IconStop|mb_TopMost|mb_SetForeground "Unable to elevate , error $0"
|
||
|
Quit
|
||
|
${EndSwitch}
|
||
|
|
||
|
SetShellVarContext all
|
||
|
!macroend
|