Closed Wolfmyths closed 1 year ago
Nice, bump the version to 1.2.0 and I will test it.
Should the auto-updater value be true in version.json? And if yes, I should probably add in an if statement checking it.
Should the auto-updater value be true in version.json?
Yes
Just noticed security concerns, if it bothers you I'll try my best to look into it. I'm not too keen on code security yet as I'm self-taught, but I'll see what I can do.
Just noticed security concerns, if it bothers you I'll try my best to look into it.
Yeah, this is indeed a security issue just to import suprocess due greatly to command injection attacks. But we don't need to solve it for now. A good aproach to solve it is just avoiding use or using preconditions and postconditions (A good code quality). But this issue is an especial case, the only main problem I see is when you call
subprocess.Popen([installerPath, "-update"], start_new_session=True)
But I think that installerPath came from the other module and is treated there. No worries, I will merge bypassing and we can treat/refactor this later.
I'm not too keen on code security yet as I'm self-taught, but I'll see what I can do.
Don't worry, the best programmers are self-taught.
For issue #11
Implemented an auto updater.
Each time
hoi4-presence
starts it will check for an update like normal, if an update is found, download in user's%TEMP%
and runsetup.exe
to install. There is a new argument to pass intosetup.exe
to signal that there is an update. When this new argument is passed,setup.exe
will re-openhoi4-presence
when it's finished installing.I did some testing everything should work. If you don't want the
requests
module being used I can replace it withurllib.request