CG8516 / PvZA11y

An accessibility mod for Plants VS Zombies
MIT License
32 stars 11 forks source link

correct updates #42

Closed azurejoga closed 10 months ago

azurejoga commented 10 months ago

I changed it as per your desired requests.

  1. first, I removed the .ps1 script and the .exe file.
  2. I added a github script where it does the following. captures, verifies, downloads and extracts the latest version for the user without the need to change the URL manually, it already does this automatically. and finally I converted the script.ps1 to exe with powershell converter.
CG8516 commented 10 months ago

That seems a lot better now, much appreciated!
However, there's still no source code for the exe file.
This is an open source project, so all the code for any included exe files needs to be here.

What does it use administrator privileges for?
For directory selection, it might be best to use the current directory by default, rather than asking every time it's launched.

And finally, one potential issue.
If future release zips have this updater in it, what happens when it tries to overwrite itself while extracting the zip?

Sorry for all the extra questions and work, I just want to make sure we get it right before including this.

azurejoga commented 10 months ago

I will answer your questions one by one.

  1. First, administrator privilege is necessary so that when saving, download and extract it to a directory on the c: disk, where depending on the directory it does not allow you to save the mod.
  2. When overwrite/replace, it will overwrite forcefully/forcibly.
  3. I was thinking about putting the steam directory
  4. "C:\Program Files (x86)\Steam\steamapps\common\Plants Vs Zombies"
  5. I asked the user to choose the directory because he can decide where to place the mod, I myself place the mod elsewhere, and I imagine that many users do the same, so he can decide where to place it. whether in Program Files, or elsewhere
  6. I will send the .ps1 source code to you
azurejoga commented 10 months ago

Okay, I believe everything is ok now... I sent the ps1 in the commit

azurejoga commented 10 months ago

@CG8516 and now? Ok, ALL right?

CG8516 commented 10 months ago

Yep, all good!
I made a few adjustments to handle some more edge-cases, and run without administrator privileges by default.
I was a bit wary of including an exe file without a way to build it in a reproducble way, so I've built a small program that will automatically extract and run the script, instead of requiring a 3rd-party tool like ps2exe.
That way anyone with the project files can build a perfect 1:1 copy of the exe file.
It's been moved to this repo, and will be included in the next release.

CG8516 commented 10 months ago

The updater is now included in Beta 1.16.
Thank you very much for your contribution!