Commit 811197c7 authored by Martin Höher's avatar Martin Höher

Uninstall previous installation on install

When installing a new version of the App, the user is now asked to
remove the previous installation first.
parent c2791c5c
Pipeline #14168562 passed with stages
in 13 minutes and 35 seconds
......@@ -26,6 +26,7 @@ OTHER_FILES += \
templates/installer/packages/net.rpdev.OpenTodoList/meta/script.js \
templates/installer/packages/net.rpdev.OpenTodoList/meta/package.xml \
templates/appimage/default.desktop \
$$files(templates/nsis/*,true) \
$$files(ci/docker/fedora/*) \
$$files(ci/docker/fedora_system/*) \
$$files(ci/docker/ubuntu/*) \
......
......@@ -62,6 +62,8 @@ Section "Uninstall"
RMDir /r "$INSTDIR\.\"
RMDir "$INSTDIR"
DeleteRegKey HKLM "${PROJECT_REG_UNINSTALL_KEY}"
SectionEnd
Section -post
......@@ -69,3 +71,22 @@ Section -post
WriteRegStr HKLM "${PROJECT_REG_UNINSTALL_KEY}" "UninstallString" '"$INSTDIR\${PROJECT_UNINSTALL_EXE}" _?=$INSTDIR'
WriteRegStr HKLM "${PROJECT_REG_UNINSTALL_KEY}" "QuietUninstallString" '"$INSTDIR\${PROJECT_UNINSTALL_EXE}" /S _?=$INSTDIR'
SectionEnd
Function .onInit
ReadRegStr $R0 HKLM "${PROJECT_REG_UNINSTALL_KEY}" "UninstallString"
StrCmp $R0 "" done
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \
"${PROGRAM_NAME} is already installed. $\n$\nClick `OK` to remove the \
previous version or `Cancel` to cancel this upgrade." \
IDOK uninst
Abort
;Run the uninstaller
uninst:
ClearErrors
Exec $R0
done:
FunctionEnd
......@@ -62,6 +62,8 @@ Section "Uninstall"
RMDir /r "$INSTDIR\.\"
RMDir "$INSTDIR"
DeleteRegKey HKLM "${PROJECT_REG_UNINSTALL_KEY}"
SectionEnd
Section -post
......@@ -69,3 +71,22 @@ Section -post
WriteRegStr HKLM "${PROJECT_REG_UNINSTALL_KEY}" "UninstallString" '"$INSTDIR\${PROJECT_UNINSTALL_EXE}" _?=$INSTDIR'
WriteRegStr HKLM "${PROJECT_REG_UNINSTALL_KEY}" "QuietUninstallString" '"$INSTDIR\${PROJECT_UNINSTALL_EXE}" /S _?=$INSTDIR'
SectionEnd
Function .onInit
ReadRegStr $R0 HKLM "${PROJECT_REG_UNINSTALL_KEY}" "UninstallString"
StrCmp $R0 "" done
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \
"${PROGRAM_NAME} is already installed. $\n$\nClick `OK` to remove the \
previous version or `Cancel` to cancel this upgrade." \
IDOK uninst
Abort
;Run the uninstaller
uninst:
ClearErrors
Exec $R0
done:
FunctionEnd
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment