Skip to content

Commit

Permalink
Uninstall previous version when installing to same directory (#664)
Browse files Browse the repository at this point in the history
Fixes #662
  • Loading branch information
grulja committed Oct 31, 2023
1 parent f649ef4 commit cafa6fd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion dist/win/mediawriter.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ function .onInit
functionEnd

section "install"
; Uninstall previous version when installing to same directory
ExecWait '"$INSTDIR\uninstall.exe" /S _?=$INSTDIR'

# Files for the install directory - to build the installer, these should be in the same directory as the install script (this file)
SetOutPath $INSTDIR
SetOverwrite on
Expand Down Expand Up @@ -209,7 +212,7 @@ sectionEnd
SetShellVarContext all

#Verify the uninstaller - last chance to back out
MessageBox MB_OKCANCEL "Permanently remove ${APPNAME}?" IDOK next
MessageBox MB_OKCANCEL "Do you want to uninstall ${APPNAME}?" IDOK next
Abort
next:
!insertmacro VerifyUserIsAdmin
Expand Down
5 changes: 4 additions & 1 deletion dist/win/mediawriter_native.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ function .onInit
functionEnd

section "install"
; Uninstall previous version when installing to same directory
ExecWait '"$INSTDIR\uninstall.exe" /S _?=$INSTDIR'

# Files for the install directory - to build the installer, these should be in the same directory as the install script (this file)
SetOutPath $INSTDIR
SetOverwrite on
Expand Down Expand Up @@ -209,7 +212,7 @@ sectionEnd
SetShellVarContext all

#Verify the uninstaller - last chance to back out
MessageBox MB_OKCANCEL "Permanently remove ${APPNAME}?" IDOK next
MessageBox MB_OKCANCEL "Do you want to uninstall ${APPNAME}?" IDOK next
Abort
next:
!insertmacro VerifyUserIsAdmin
Expand Down

0 comments on commit cafa6fd

Please sign in to comment.