Is there an option for the installer to clean a directory before it installs over it again? We want to clean-up directories before running new versions of the installer over the top of the existing install.
Hi @brettparkhurst,
Yes it is possible to delete an entire directory using <deleteFile>:
<deleteFile>
<path>/path/to/directory/</path>
</deleteFile>
Regards,
Michiel
Hi @brettparkhurst ,
You can use <deleteFile> with a wildcard to delete files and folders:
<readyToInstallActionList>
<deleteFile> <path>/path/to/directory/*.txt</path> </deleteFile>
<readyToInstallActionList>
Regards,
Michiel
This is good, but I want to clean the entire directory including any subdirectories that may have been created outside of the installation.
Hi @brettparkhurst,
In that case it might be a better idea to run the uninstaller of the existing installation in unattended mode. In that way you can be sure the previous installation is completely removed:
<runProgram>
<program>.\uninstall.exe></program>
<programArguments>--mode unattended</programArguments>
<workingDirectory>${installdir}</workingDirectory>
</runProgram>
You could add the action in a <showProgressDialog> action to show the user what the installer is doing.
<showProgressDialog>
<title>Uninstalling ${value}</title>
<actionList>
<runProgram>
<program>${uninstallCmd}</program>
<programArguments>--mode unattended</programArguments>
</runProgram>
</actionList>
</showProgressDialog>
Best regards,
Michiel
So there is no way to delete a directory and all subdirectories? I am surprised this is not an option as this is something that happens quite a bit. Files and directories created within the install directory that are not part of the original install. We just want them cleaned up before we upgrade.
Hi @brettparkhurst,
Yes it is possible to delete an entire directory using <deleteFile>:
<deleteFile>
<path>/path/to/directory/</path>
</deleteFile>
Regards,
Michiel