Windows: check if there is already a previous install of Clementine and if so, ask the user if he wants to run the uninstaller. Running the installer will kill any running instance of Clementine, preventing installation issues because the files are used by this process and thus cannot be overwritten.
This commit is contained in:
parent
ccf5bffd99
commit
8bd97a1d38
20
dist/windows/clementine.nsi.in
vendored
20
dist/windows/clementine.nsi.in
vendored
@ -111,10 +111,30 @@ ShowUnInstDetails show
|
|||||||
@NORMAL@RequestExecutionLevel admin
|
@NORMAL@RequestExecutionLevel admin
|
||||||
@PORTABLE@RequestExecutionLevel user
|
@PORTABLE@RequestExecutionLevel user
|
||||||
|
|
||||||
|
; Check for previous installation, and call the uninstaller if any
|
||||||
|
Function CheckPreviousInstall
|
||||||
|
|
||||||
|
ReadRegStr $R0 ${PRODUCT_UNINST_ROOT_KEY} ${PRODUCT_UNINST_KEY} "UninstallString"
|
||||||
|
StrCmp $R0 "" done
|
||||||
|
|
||||||
|
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \
|
||||||
|
"${PRODUCT_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
|
||||||
|
ExecWait '$R0 _?=$INSTDIR' ; Do not copy the uninstaller to a temp file
|
||||||
|
|
||||||
|
FunctionEnd
|
||||||
|
|
||||||
Function .onInit
|
Function .onInit
|
||||||
|
|
||||||
!insertmacro MUI_LANGDLL_DISPLAY
|
!insertmacro MUI_LANGDLL_DISPLAY
|
||||||
|
|
||||||
|
Call CheckPreviousInstall
|
||||||
|
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
Function RunClementine
|
Function RunClementine
|
||||||
|
Loading…
x
Reference in New Issue
Block a user