Skip to content

Commit

Permalink
todo entries for buildpad
Browse files Browse the repository at this point in the history
since buildpad handles updating itself, this manager should only deal with install/delete and enable/disable operations
  • Loading branch information
fmmmlee committed Apr 19, 2020
1 parent 20479e9 commit 15c289d
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions application/GW2 Addon Manager/Backend/Updating/GenericUpdater.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Microsoft.VisualBasic.FileIO;
using System;
using System.ComponentModel;
using System.IO;
using System.IO.Compression;
Expand Down Expand Up @@ -71,13 +70,10 @@ private async Task StandaloneCheckUpdate()

if (addon_info.version_url != null)
latestVersion = client.DownloadString(addon_info.version_url);
else //for buildpad
else
{
HttpWebRequest getRedir = (HttpWebRequest)WebRequest.Create(addon_info.host_url);
getRedir.AllowAutoRedirect = false;
HttpWebResponse redirResponse = (HttpWebResponse)getRedir.GetResponse();
downloadURL = redirResponse.Headers.Get("Location");
latestVersion = Path.GetFileName(downloadURL);
//BuildPad is the only addon that should have a blank version url since it updates itself
return;
}

if (userConfig.version.ContainsKey(addon_name) && userConfig.version[addon_name] != null && latestVersion == userConfig.version[addon_name])
Expand Down Expand Up @@ -182,10 +178,6 @@ private void Install()
if (!userConfig.disabled.ContainsKey(addon_info.folder_name))
userConfig.disabled.Add(addon_info.folder_name, false);

//deleting old buildpad dll (other plugins get overwritten instead so deletion not necessary)
if (addon_name == "buildPad" && Configuration.getConfigAsYAML().version.ContainsKey(addon_name))
File.Delete(Path.Combine(Path.Combine(addon_install_path, "arcdps"), Configuration.getConfigAsYAML().version[addon_name]));

//set config.yaml
Configuration.setConfigAsYAML(userConfig);
}
Expand Down Expand Up @@ -214,6 +206,7 @@ public static void Disable(AddonInfoFromYaml addon_info)

if (addon_info.addon_name == "BuildPad (Installed)")
{
//TODO: Change this to scan for .dll in buildpad folder and use that for file operations (not config file entry)
File.Move(
Path.Combine(Path.Combine(Path.Combine(info.game_path, "addons"), "arcdps"), Configuration.getConfigAsYAML().version["buildPad"]),
Path.Combine(Path.Combine("Disabled Plugins", addon_info.folder_name), Configuration.getConfigAsYAML().version["buildPad"])
Expand Down

0 comments on commit 15c289d

Please sign in to comment.