Browse Source

The installer now checks if qbt is running before proceeding.

adaptive-webui-19844
sledgehammer999 12 years ago
parent
commit
78ee01b03c
  1. 4
      src/windows/installer-translations/english.nsi
  2. 14
      src/windows/installer.nsi
  3. 2
      src/windows/options.nsi
  4. 14
      src/windows/uninstaller.nsi

4
src/windows/installer-translations/english.nsi

@ -12,6 +12,8 @@ LangString inst_torrent ${LANG_ENGLISH} "Open .torrent files with qBittorrent"
LangString inst_magnet ${LANG_ENGLISH} "Open magnet links with qBittorrent" LangString inst_magnet ${LANG_ENGLISH} "Open magnet links with qBittorrent"
;LangString inst_firewall ${LANG_ENGLISH} "Add Windows Firewall rule" ;LangString inst_firewall ${LANG_ENGLISH} "Add Windows Firewall rule"
LangString inst_firewall ${LANG_ENGLISH} "Add Windows Firewall rule" LangString inst_firewall ${LANG_ENGLISH} "Add Windows Firewall rule"
;LangString inst_warning ${LANG_ENGLISH} "qBittorrent is running. Please close the application before installing."
LangString inst_warning ${LANG_ENGLISH} "qBittorrent is running. Please close the application before installing."
;------------------------------------ ;------------------------------------
@ -31,3 +33,5 @@ LangString remove_conf ${LANG_ENGLISH} "Remove configuration files"
LangString remove_firewall ${LANG_ENGLISH} "Remove Windows Firewall rule" LangString remove_firewall ${LANG_ENGLISH} "Remove Windows Firewall rule"
;LangString remove_cache ${LANG_ENGLISH} "Remove torrents and cached data" ;LangString remove_cache ${LANG_ENGLISH} "Remove torrents and cached data"
LangString remove_cache ${LANG_ENGLISH} "Remove torrents and cached data" LangString remove_cache ${LANG_ENGLISH} "Remove torrents and cached data"
;LangString uninst_warning ${LANG_ENGLISH} "qBittorrent is running. Please close the application before uninstalling."
LangString uninst_warning ${LANG_ENGLISH} "qBittorrent is running. Please close the application before uninstalling."

14
src/windows/installer.nsi

@ -128,3 +128,17 @@ Function .onInit
!insertmacro MUI_LANGDLL_DISPLAY !insertmacro MUI_LANGDLL_DISPLAY
FunctionEnd FunctionEnd
Function check_instance
check:
FindProcDLL::FindProc "qbittorrent.exe"
StrCmp $R0 "1" 0 notfound
MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION $(inst_warning) IDRETRY check IDCANCEL done
done:
Abort
notfound:
FunctionEnd

2
src/windows/options.nsi

@ -65,6 +65,7 @@ RequestExecutionLevel admin
;Installer Pages ;Installer Pages
!insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "license.txt" !insertmacro MUI_PAGE_LICENSE "license.txt"
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE check_instance
!insertmacro MUI_PAGE_COMPONENTS !insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_PAGE_INSTFILES
@ -73,6 +74,7 @@ RequestExecutionLevel admin
;-------------------------------- ;--------------------------------
;Uninstaller Pages ;Uninstaller Pages
!insertmacro MUI_UNPAGE_CONFIRM !insertmacro MUI_UNPAGE_CONFIRM
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE un.check_instance
!insertmacro MUI_UNPAGE_COMPONENTS !insertmacro MUI_UNPAGE_COMPONENTS
!insertmacro MUI_UNPAGE_INSTFILES !insertmacro MUI_UNPAGE_INSTFILES

14
src/windows/uninstaller.nsi

@ -90,3 +90,17 @@ Function un.onInit
!insertmacro MUI_UNGETLANGUAGE !insertmacro MUI_UNGETLANGUAGE
FunctionEnd FunctionEnd
Function un.check_instance
check:
FindProcDLL::FindProc "qbittorrent.exe"
StrCmp $R0 "1" 0 notfound
MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION $(uninst_warning) IDRETRY check IDCANCEL done
done:
Abort
notfound:
FunctionEnd

Loading…
Cancel
Save