The installer now checks if qbt is running before proceeding.

This commit is contained in:
sledgehammer999 2013-01-28 00:44:51 +02:00
parent 653d49ab3c
commit 78ee01b03c
4 changed files with 35 additions and 1 deletions

View file

@ -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."

View file

@ -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

View file

@ -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

View file

@ -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