Repository: spyder-ide/spyder

Issue:
5.5.3 Updater doesn't work
When i start spyder i get a message that a new version (5.5.3) is available, if i try to do the update a message appear 

it was something about "16 bit" not working on a 64 bit machine

i cannot see the message anymore, i only get a windows 10 warning "this exe cannot be run on this machine" after i tried to fiddle with the compatibility menu


Discussion:
Updater does also not work for me, but without any errors. Clicking yes to proceed and nothing happens. Seems like some other dialog quickly opening and closing after clicking yes.

The "After closing" option is also not working

![spyder_5_2_2_update](https://github.com/spyder-ide/spyder/assets/2330659/1804719d-4583-43e9-ac86-cdf1ddf8ebfa)

```
* Spyder version: 5.5.2  (standalone)
* Python version: 3.8.10 64-bit
* Qt version: 5.15.2
* PyQt5 version: 5.15.10
* Operating System: Windows-10-10.0.19045-SP0
```


I have the same issue when trying to use the native installer from 5.5.2 to 5.5.3. The corresponding error message is "The program or feature "...\AppData\Local\Temp\spyder\updates\5.5.3\Spyder-Windows-x86_64.exe" cannot be started or executed by Windows because of an incompatibility issue with 64 bit-versions. Please contact the software developer to find out whether a 64 bit-Windows compatible version is available.". As the message suggests I am using Windows.
Hey folks, thanks for reporting. It seems we're not downloading the right 5.5.3 artifact for the update or that it's not named correctly. We'll take a look at this one in our next version (5.5.4), to be released asap.

@dalthviz, could you take care of this issue? Thanks!

Resolving patch:
diff --git a/spyder/workers/updates.py b/spyder/workers/updates.py
--- a/spyder/workers/updates.py
+++ b/spyder/workers/updates.py
@@ -9,6 +9,7 @@
 import os
 import os.path as osp
 import platform
+import shutil
 import tempfile
 import traceback
 
@@ -236,7 +237,7 @@ def _download_installer(self):
         # platforms will be x86_64.
         mach = "arm64" if "ARM64" in platform.version() else "x86_64"
 
-        if parse(self.latest_release_version) > parse("5"):
+        if parse(self.latest_release_version) >= parse("6.0.0"):
             # conda-based installer name
             if os.name == 'nt':
                 plat, ext = 'Windows', 'exe'
@@ -265,12 +266,17 @@ def _download_installer(self):
         dir_path = osp.join(tmpdir, 'spyder', 'updates')
         os.makedirs(dir_path, exist_ok=True)
         installer_dir_path = osp.join(
-            dir_path, self.latest_release_version)
+            dir_path, self.latest_release_version
+        )
         os.makedirs(installer_dir_path, exist_ok=True)
-        for file in os.listdir(dir_path):
-            if file not in [__version__, self.latest_release_version]:
-                remove = osp.join(dir_path, file)
-                os.remove(remove)
+
+        for dir_version in os.listdir(dir_path):
+            if dir_version not in [__version__, self.latest_release_version]:
+                remove_dir = osp.join(dir_path, dir_version)
+                try:
+                    shutil.rmtree(remove_dir)
+                except OSError as err:
+                    logger.debug(err, stack_info=True)
 
         installer_path = osp.join(installer_dir_path, name)
         self.installer_path = installer_path


Test patch: