I have a custom action "xxxx" which deletes directory by executing rmdir through command prompt. ExeCommand="[SystemFolder]cmd.exe /C rmdir /Q /S "[DIR]"" and Execute="deferred"
It is added in InstallExecuteSequence as below
Custom Action="xxxx" After="InstallInitialize"
(NOT UPGRADINGPRODUCTCODE) AND REMOVE
Custom
If the directory is opened by some other application such as command line, then it throws error.
I read many similar issues. But couldn't figure out on
1) prompt user to close applications - I read adding
UI
DialogRef Id="FilesInUse"
DialogRef Id="MsiRMFilesInUse"
/UI
and using custom action Before="InstallValidate"
shows prompt to close applications.
2) How to run custom action after services are stopped and prompt user to close applications? It should run in deferred mode.
3) If I want to run in Execute = deferred
, then I can't use InstallValidate. Therefore I can't use FilesInUse.
4) Is there any other good approach? I don't want to reference a dll because I want the installer to delete entire directory on uninstall.