简体   繁体   中英

nsis delete doesn't work

I am trying to delete files from a directory.

The Delete commands appear to work but the files are not being deleted.

    Delete $fn

    IfErrors fail continue

    DetailPrint "Delete failed, file=$fn"
fail:
    MessageBox MB_ICONSTOP "Could not delete $fn"

    Abort
continue:
    DetailPrint "Deleted $fn"

I check the log after the run and it lists all files are deleted but when I check the folders, all the files are still there.

Is there any way to get a reason or message text after a delete executes?

Could you double check that the path is correct. Things like InstallDirRegKey might set $instdir to something other than your expected folder.

Make sure that you have the RequestExecutionLevel attribute in your script.

If it still is unable to delete, try running Process Monitor to see which file is failing and why...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM