1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 02:36:34 +01:00

Installer script improved:

-Ask for terminate running instance.
-Prevent multiple installer instances
-Register more info within uninstaller section
This commit is contained in:
S. Razi Alavizadeh 2012-11-19 20:36:39 +03:30
parent 2a2beaa2ae
commit 3482a7f875
4 changed files with 86 additions and 5 deletions

BIN
windows/FindProcDLL.dll Normal file

Binary file not shown.

BIN
windows/KillProcDLL.dll Normal file

Binary file not shown.

View File

@ -1,4 +1,7 @@
RequestExecutionLevel admin RequestExecutionLevel admin
!addplugindir "wininstall\"
!include "FileFunc.nsh"
!include "wininstall\FileAssociation.nsh" !include "wininstall\FileAssociation.nsh"
SetCompressor /SOLID /FINAL lzma SetCompressor /SOLID /FINAL lzma
@ -66,8 +69,16 @@ ShowUnInstDetails show
Section !$(TITLE_SecMain) SecMain Section !$(TITLE_SecMain) SecMain
SectionIn RO SectionIn RO
KillProcDLL::KillProc "qupzilla.exe" FindProcDLL::FindProc "qupzilla.exe"
Sleep 100 IntCmp $R0 1 0 notRunning
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "$(MSG_RunningInstance)" /SD IDOK IDCANCEL AbortInstallation
KillProcDLL::KillProc "qupzilla.exe"
Sleep 100
Goto notRunning
AbortInstallation:
Abort "$(MSG_InstallationCanceled)"
notRunning:
SetOverwrite on SetOverwrite on
SetOutPath "$INSTDIR" SetOutPath "$INSTDIR"
@ -318,6 +329,14 @@ Section -Uninstaller
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\Uninstall.exe" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\Uninstall.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\qupzilla.exe" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\qupzilla.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "QupZilla Team"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "HelpLink" "https://github.com/QupZilla/qupzilla/wiki"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "InstallLocation" "$INSTDIR"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "InstallSource" "$EXEDIR"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "http://www.qupzilla.com"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLUpdateInfo" "http://blog.qupzilla.com/"
${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2
WriteRegDWORD ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "EstimatedSize" "$0"
SectionEnd SectionEnd
Section -MSVC Section -MSVC
@ -329,9 +348,16 @@ Section -MSVC
SectionEnd SectionEnd
Section Uninstall Section Uninstall
KillProcDLL::KillProc "qupzilla.exe" FindProcDLL::FindProc "qupzilla.exe"
Sleep 100 IntCmp $R0 1 0 notRunning
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "$(MSG_RunningInstance)" /SD IDOK IDCANCEL AbortInstallation
KillProcDLL::KillProc "qupzilla.exe"
Sleep 100
Goto notRunning
AbortInstallation:
Abort "$(MSG_InstallationCanceled)"
notRunning:
SetShellVarContext all SetShellVarContext all
Delete "$DESKTOP\QupZilla.lnk" Delete "$DESKTOP\QupZilla.lnk"
RMDir /r "$INSTDIR" RMDir /r "$INSTDIR"
@ -345,6 +371,13 @@ SectionEnd
BrandingText "${PRODUCT_NAME} ${PRODUCT_VERSION} Installer" BrandingText "${PRODUCT_NAME} ${PRODUCT_VERSION} Installer"
Function .onInit Function .onInit
;Prevent Multiple Instances
System::Call 'kernel32::CreateMutexA(i 0, i 0, t "QupZillaInstaller-4ECB4694-2C39-4f93-9122-A986344C4E7B") i .r1 ?e'
Pop $R0
StrCmp $R0 0 +3
MessageBox MB_OK|MB_ICONEXCLAMATION "QupZilla installer is already running!" /SD IDOK
Abort
;Language selection dialog¨ ;Language selection dialog¨
;Return when running silent instalation ;Return when running silent instalation

View File

@ -15,6 +15,9 @@ LangString DESC_SecPlugins ${LANG_ENGLISH} "Other plugins available to install."
LangString DESC_SecDesktop ${LANG_ENGLISH} "Add launcher to desktop." LangString DESC_SecDesktop ${LANG_ENGLISH} "Add launcher to desktop."
LangString DESC_SecExtensions ${LANG_ENGLISH} "Associate QupZilla with .htm and .html files" LangString DESC_SecExtensions ${LANG_ENGLISH} "Associate QupZilla with .htm and .html files"
LangString DESC_SecThemes ${LANG_ENGLISH} "Additional themes for QupZilla" LangString DESC_SecThemes ${LANG_ENGLISH} "Additional themes for QupZilla"
;
LangString MSG_RunningInstance ${LANG_ENGLISH} "QupZilla is already running! Do you want the installer try to terminate it?"
LangString MSG_InstallationCanceled ${LANG_ENGLISH} "Process canceled by user."
;;;;Czech ;;;;Czech
LangString TITLE_SecMain ${LANG_CZECH} "Hlavní komponenty" LangString TITLE_SecMain ${LANG_CZECH} "Hlavní komponenty"
@ -325,7 +328,7 @@ LangString TITLE_SecMain ${LANG_FARSI} "بخش اصلی"
LangString TITLE_SecTranslations ${LANG_FARSI} "برگردان‌ها" LangString TITLE_SecTranslations ${LANG_FARSI} "برگردان‌ها"
LangString TITLE_SecPlugins ${LANG_FARSI} "افزونه‌ها" LangString TITLE_SecPlugins ${LANG_FARSI} "افزونه‌ها"
LangString TITLE_SecDesktop ${LANG_FARSI} "آیکون میزکار" LangString TITLE_SecDesktop ${LANG_FARSI} "آیکون میزکار"
LangString TITLE_SecExtensions ${LANG_FARSI} "اختصاص برای بازکردن فایل‌ها" LangString TITLE_SecExtensions ${LANG_FARSI} "تخصیص فایل"
LangString TITLE_SecThemes ${LANG_FARSI} "فرهشت‌ها" LangString TITLE_SecThemes ${LANG_FARSI} "فرهشت‌ها"
; ;
LangString DESC_SecMain ${LANG_FARSI} "بخش اصلی نرم‌افزار." LangString DESC_SecMain ${LANG_FARSI} "بخش اصلی نرم‌افزار."
@ -334,6 +337,9 @@ LangString DESC_SecPlugins ${LANG_FARSI} "افزونه‌های دیگر که ب
LangString DESC_SecDesktop ${LANG_FARSI} "افزودن میان‌برِ آغازگر به میزکار" LangString DESC_SecDesktop ${LANG_FARSI} "افزودن میان‌برِ آغازگر به میزکار"
LangString DESC_SecExtensions ${LANG_FARSI} "کوپزیلا را برای بازکردن فایل‌های .htm و .html اختصاص می‌دهد." LangString DESC_SecExtensions ${LANG_FARSI} "کوپزیلا را برای بازکردن فایل‌های .htm و .html اختصاص می‌دهد."
LangString DESC_SecThemes ${LANG_FARSI} "فرهشت‌های اضافی برای کوپزیلا" LangString DESC_SecThemes ${LANG_FARSI} "فرهشت‌های اضافی برای کوپزیلا"
;
LangString MSG_RunningInstance ${LANG_FARSI} "کوپزیلا هم‌اکنون در حال اجراست! آیا می‌خواهید برنامه نصب تلاش کند به اجرای آن خاتمه دهد؟"
LangString MSG_InstallationCanceled ${LANG_FARSI} "فرایند توسط کاربر لغو گردید."
;;;;;;;;; ;;;;;;;;;
;;;;;;;;; ;;;;;;;;;
; Unfinished translations ; Unfinished translations
@ -389,3 +395,45 @@ LangString TITLE_SecThemes ${LANG_SPANISH} "Themes"
LangString DESC_SecThemes ${LANG_KOREAN} "Additional themes for QupZilla" LangString DESC_SecThemes ${LANG_KOREAN} "Additional themes for QupZilla"
LangString DESC_SecThemes ${LANG_RUSSIAN} "Additional themes for QupZilla" LangString DESC_SecThemes ${LANG_RUSSIAN} "Additional themes for QupZilla"
LangString DESC_SecThemes ${LANG_SPANISH} "Additional themes for QupZilla" LangString DESC_SecThemes ${LANG_SPANISH} "Additional themes for QupZilla"
LangString MSG_RunningInstance ${LANG_CZECH} "QupZilla is already running! Do you want the installer try to terminate it?"
LangString MSG_RunningInstance ${LANG_SLOVAK} "QupZilla is already running! Do you want the installer try to terminate it?"
LangString MSG_RunningInstance ${LANG_GERMAN} "QupZilla is already running! Do you want the installer try to terminate it?"
LangString MSG_RunningInstance ${LANG_DUTCH} "QupZilla is already running! Do you want the installer try to terminate it?"
LangString MSG_RunningInstance ${LANG_PORTUGUESE} "QupZilla is already running! Do you want the installer try to terminate it?"
LangString MSG_RunningInstance ${LANG_GREEK} "QupZilla is already running! Do you want the installer try to terminate it?"
LangString MSG_RunningInstance ${LANG_FRENCH} "QupZilla is already running! Do you want the installer try to terminate it?"
LangString MSG_RunningInstance ${LANG_ITALIAN} "QupZilla is already running! Do you want the installer try to terminate it?"
LangString MSG_RunningInstance ${LANG_ROMANIAN} "QupZilla is already running! Do you want the installer try to terminate it?"
LangString MSG_RunningInstance ${LANG_TRADCHINESE} "QupZilla is already running! Do you want the installer try to terminate it?"
LangString MSG_RunningInstance ${LANG_SIMPCHINESE} "QupZilla is already running! Do you want the installer try to terminate it?"
LangString MSG_RunningInstance ${LANG_INDONESIAN} "QupZilla is already running! Do you want the installer try to terminate it?"
LangString MSG_RunningInstance ${LANG_GEORGIAN} "QupZilla is already running! Do you want the installer try to terminate it?"
LangString MSG_RunningInstance ${LANG_JAPANESE} "QupZilla is already running! Do you want the installer try to terminate it?"
LangString MSG_RunningInstance ${LANG_SWEDISH} "QupZilla is already running! Do you want the installer try to terminate it?"
LangString MSG_RunningInstance ${LANG_POLISH} "QupZilla is already running! Do you want the installer try to terminate it?"
LangString MSG_RunningInstance ${LANG_UKRAINIAN} "QupZilla is already running! Do you want the installer try to terminate it?"
LangString MSG_RunningInstance ${LANG_KOREAN} "QupZilla is already running! Do you want the installer try to terminate it?"
LangString MSG_RunningInstance ${LANG_RUSSIAN} "QupZilla is already running! Do you want the installer try to terminate it?"
LangString MSG_RunningInstance ${LANG_SPANISH} "QupZilla is already running! Do you want the installer try to terminate it?"
LangString MSG_InstallationCanceled ${LANG_CZECH} "Process canceled by user."
LangString MSG_InstallationCanceled ${LANG_SLOVAK} "Process canceled by user."
LangString MSG_InstallationCanceled ${LANG_GERMAN} "Process canceled by user."
LangString MSG_InstallationCanceled ${LANG_DUTCH} "Process canceled by user."
LangString MSG_InstallationCanceled ${LANG_PORTUGUESE} "Process canceled by user."
LangString MSG_InstallationCanceled ${LANG_GREEK} "Process canceled by user."
LangString MSG_InstallationCanceled ${LANG_FRENCH} "Process canceled by user."
LangString MSG_InstallationCanceled ${LANG_ITALIAN} "Process canceled by user."
LangString MSG_InstallationCanceled ${LANG_ROMANIAN} "Process canceled by user."
LangString MSG_InstallationCanceled ${LANG_TRADCHINESE} "Process canceled by user."
LangString MSG_InstallationCanceled ${LANG_SIMPCHINESE} "Process canceled by user."
LangString MSG_InstallationCanceled ${LANG_INDONESIAN} "Process canceled by user."
LangString MSG_InstallationCanceled ${LANG_GEORGIAN} "Process canceled by user."
LangString MSG_InstallationCanceled ${LANG_JAPANESE} "Process canceled by user."
LangString MSG_InstallationCanceled ${LANG_SWEDISH} "Process canceled by user."
LangString MSG_InstallationCanceled ${LANG_POLISH} "Process canceled by user."
LangString MSG_InstallationCanceled ${LANG_UKRAINIAN} "Process canceled by user."
LangString MSG_InstallationCanceled ${LANG_KOREAN} "Process canceled by user."
LangString MSG_InstallationCanceled ${LANG_RUSSIAN} "Process canceled by user."
LangString MSG_InstallationCanceled ${LANG_SPANISH} "Process canceled by user."