|
![]() |
|
Thread Tools | Search this Thread | Display Modes |
![]() |
#1 |
Junior Member
Join Date: Mar 2016
Posts: 12
|
Delete command not deleting files in Windows directories
I am having a problem where my uninstaller is not deleting files properly from Windows folders.
The commands are (I've put some placeholders in for confidentiality): Delete $WINDIR\system32\[filename].dll Delete $WINDIR\sysWOW64\[filename].dll Delete $WINDIR\system32\drivers\[filename].sys My current suspicion is that the DLL files are in use by a different driver not just mine, since they are API DLLs. The sys file is only for my driver, however, and I know the driver is being removed from Windows. It doesn't get deleted either. However, the uninstaller gives no error when it tries to delete the files. I am going to run the installer and uninstaller on a clean boot machine to see if I get different behavior. I was hoping however that someone would have ideas to make the files delete properly |
![]() |
![]() |
![]() |
#2 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,356
|
Make sure you have the RequestExecutionLevel attribute in your script.
Are you using the macros in x64.nsh to disable redirection? Monitor the uninstaller with Process Monitor to see why the delete fails. IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#3 |
Junior Member
Join Date: Mar 2016
Posts: 12
|
I have the RequestExecutionLevel attribute at the beginning of the script. I also tried adding it to the uninstall portion of the script, but that gave an error. The only macro I am using currently is the InstallLib DLL to install the 64 bit API dll into the system32 folder. On my clean boot PC, the file in syswow64 is deleted properly, but the other two files are not deleted.
|
![]() |
![]() |
![]() |
#4 | |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,356
|
And what does Process Monitor say?
And it is hard to say what is going on without any code. Should probably look something like this: Quote:
IntOp $PostCount $PostCount + 1 |
|
![]() |
![]() |
![]() |
#5 |
Junior Member
Join Date: Mar 2016
Posts: 12
|
Process Monitor shows that Windows is indeed redirecting. I can see where the first file is deleted, and it tries to delete the other two files, but in the wrong place. I will try using the UnInstallLib macro instead of the simple Delete command.
|
![]() |
![]() |
![]() |
#6 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,356
|
You can use Delete if the .dll is not registered but you have to use the macros in x64.nsh to deal with the redirection.
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
|
Tags |
delete, system32, windows |
Thread Tools | Search this Thread |
Display Modes | |
|
|