Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

UpdateManager.IsInstalledApp returning true for non-installed version when a different Update.exe is present in nearby folder #63

Closed
RandomEngy opened this issue Apr 1, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@RandomEngy
Copy link

I have a portable version of VidCoder built as a WinRAR self-extracting EXE. It extracts all the program files to %localappdata%\Temp\RarSFX0 , then runs the EXE there. Inside VidCoder I call UpdateManager.IsInstalledApp to see if it was installed via Squirrel and it was returning true if there happened to be an Update.exe in the %temp% folder. Which I guess can happen because all kinds of programs write there.

RandomEngy/VidCoder#1003

I can reorder the checks to fix this for VidCoder, but thought you might want to know.

@caesay
Copy link
Member

caesay commented Apr 1, 2022

Thanks for this report, I'll have a look. UpdateManager.IsInstalledApp only returns true if the current exe is in the expected directory (eg. %localappdata%\{appId}) and Update.exe exists in the directory above. Presumably that first check should be false in your case?

@caesay caesay added the bug Something isn't working label Apr 1, 2022
@caesay
Copy link
Member

caesay commented Apr 1, 2022

Can you provide me with the value of UpdateManager.AppDirectory and UpdateManager.AppId?

@RandomEngy
Copy link
Author

In this case UpdateManager.IsInstalledApp returns true, and it thinks that UpdateManager.AppDirectory is C:\Users\david\AppData\Local\Temp and that UpdateManager.AppId is Temp.

@caesay
Copy link
Member

caesay commented Apr 7, 2022

This is closed by fc07728, essentially more strict checking for the expected directory structure (eg. app-). It's not an amazing fix, but a carry over from the original Squirrel architecture. After #24 we'll have better ways to detect for installed apps.

@caesay caesay closed this as completed Apr 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants