|
![]() |
|
Thread Tools | Search this Thread | Display Modes |
![]() |
#1 |
Junior Member
Join Date: Jul 2019
Posts: 30
|
Cancel button click not deleting the installation folder
Hi,
I have a custom cancel function which should delete all the files copied in installation folder. In my case, all the files are not copied in the "Install" section. Instead I have some custom pages which copies few files in each pages according to our requirement . My requirement is whenever I click "Cancel" button from any pages, it should delete all the files and folder copied till that point. Though the files are deleted, not the parent folder. I am not able to figure out the reason. Please suggest Function OnUserAbort MessageBox MB_YESNO "Do you want to abort the installation?" IDYES NoCancelAbort ; Delete the installation folder. Abort ; causes installer to not quit. NoCancelAbort: !insertmacro stopAndUninstallService "Service" ; Delete the installation folder. SetOutPath $INSTDIR RMDIR /r $INSTDIR RMDIR $INSTDIR FunctionEnd |
![]() |
![]() |
![]() |
#2 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
|
"SetOutPath $INSTDIR" keeps a lock on the folder, do "SetOutPath $WinDir" before RMDir.
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#3 |
Junior Member
Join Date: Jul 2019
Posts: 30
|
|
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|