wow-addon-updater icon indicating copy to clipboard operation
wow-addon-updater copied to clipboard

Idea: Option to update updater itself

Open crborga opened this issue 6 years ago • 6 comments

I love this updater and I was wondering if there were any plans to possibly update the updater itself. Instead of just saying there is a update. Maybe give us a option of downloading and applying the update. I understand if you don't want to do this but it was a idea that allot of us would benefit from.

crborga avatar Oct 07 '19 00:10 crborga

I don't see why not. I will work on this next.

PeachIceTea avatar Oct 07 '19 06:10 PeachIceTea

Yeah this is a great idea, been meaning to start thinking about it. Especially since the updates have been a little more frequent lately.

grrttedwards avatar Oct 07 '19 11:10 grrttedwards

I hacked up this script to handle updating the updater in the meantime for Powershell. Just put create put the two files in the folder with updater and run updater.bat. You will need Powershell v5 and .Net4 (exe version) installed. Notice: Backup your launcher commands if using custom configs. updater.zip or you can use this exe version without console output updaterexeversion.zip Both versions work the same way for the most part.

updater.bat

@Echo Off
PowerShell.exe -ExecutionPolicy Bypass -Command "& '%~dpn0.ps1'"
pipenv install
exit

updater.ps1

[Net.ServicePointManager]::SecurityProtocol = "tls12, tls11, tls"
Invoke-WebRequest -Uri https://github.com/grrttedwards/wow-addon-updater/archive/master.zip -OutFile master.zip
Expand-Archive master.zip -DestinationPath . -Force
rename-item config.ini configini.bak -Force -Verbose
copy-item wow-addon-updater-master/* . -Recurse -Force -Verbose
remove-item wow-addon-updater-master*.* -Recurse -Force -Verbose
remove-item wow-addon-updater-master -Recurse -Force -Verbose
remove-item master.zip
remove-item config.ini
rename-item configini.bak config.ini

crborga avatar Oct 09 '19 07:10 crborga

I would like to see this done in Python, else it will have to be re-written for each platform.

Some misc things I want to jot down about this:

  1. It should take whichever is the latest GitHub release (https://github.com/grrttedwards/wow-addon-updater/releases/latest)
  2. It should not over-write files in the directory that the user has made themselves (i.e. additional configuration files)
  3. Maybe think of how configuration can be done for "should always auto-update", or "should never even ask" (which is complicated because there is no "global configuration", it's per-file)

grrttedwards avatar Oct 11 '19 21:10 grrttedwards

I would like to see this done in Python, else it will have to be re-written for each platform.

Some misc things I want to jot down about this:

1. It should take whichever is the latest GitHub release (https://github.com/grrttedwards/wow-addon-updater/releases/latest)

2. It should not over-write files in the directory that the user has made themselves (i.e. additional configuration files)

3. Maybe think of how configuration can be done for "should always auto-update", or "should never even ask" (which is complicated because there is no "global configuration", it's per-file)

Yeah, I don't know Python at all really. Just thought I would share what I came up with until something more permanent is made.

crborga avatar Oct 11 '19 21:10 crborga

I think your suggestion is great! :) But at some point in the past another commenter criticized me for wanting to write some "installation scripts" in multiple languages (batch & bash), and then I realized, why not just use Python as much as possible!

grrttedwards avatar Oct 11 '19 21:10 grrttedwards