# installer remove file with upgrade specific version

**URL:** https://discourse.cmake.org/t/installer-remove-file-with-upgrade-specific-version/6231
**Category:** Usage
**Tags:** os:windows
**Created:** [August 10, 2022, 8:09am UTC](https://discourse.cmake.org/t/installer-remove-file-with-upgrade-specific-version/6231 "2022-08-10T08:09:35Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![alice](https://discourse.cmake.org/user_avatar/discourse.cmake.org/alice/32/1615_2.png) [@alice](https://discourse.cmake.org/u/alice)
#### Post date: [August 10, 2022, 8:09am UTC](https://discourse.cmake.org/t/installer-remove-file-with-upgrade-specific-version/6231/1 "2022-08-10T08:09:35Z")

</div>

I use cmake to generate the installer.  
Assume the installer version:  
cmake-3.24.0-windows-x86\_64.msi  
cmake-3.23.3-windows-x86\_64.msi  
cmake-3.21.3-windows-x86\_64.msi

My computer cmake current version is cmake-3.23.3 .  
I want to upgrade it to cmake-3.24.0.  
I hope to the installer do check current cmake version and remove some file. Only 3.23.3 → 3.24.0 do remove some file.

How to do check current version and installing version?  
How to remove file?

If it has the command sample, it will be good  
Thanks a lot.

---

<div class="post-metadata">

### Author: ![alice](https://discourse.cmake.org/user_avatar/discourse.cmake.org/alice/32/1615_2.png) [@alice](https://discourse.cmake.org/u/alice)
#### Post date: [August 12, 2022, 1:01am UTC](https://discourse.cmake.org/t/installer-remove-file-with-upgrade-specific-version/6231/2 "2022-08-12T01:01:17Z")

</div>

PS

> <https://stackoverflow.com/questions/53515353/why-cmakes-fileremove-recurse-file1-does-not-remove-file-having-xx>
