Skip to content

Commit

Permalink
21.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
tablacus committed Jan 6, 2021
1 parent 8cdb0d3 commit ad9258a
Show file tree
Hide file tree
Showing 32 changed files with 390 additions and 385 deletions.
14 changes: 9 additions & 5 deletions addonsupdater/config.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<TablacusExplorer>
<General>
<Version>1.06</Version>
<MinVersion>2019.9.1</MinVersion>
<pubDate>Sun, 01 Sep 2019 00:00:00 GMT</pubDate>
<Version>1.07</Version>
<MinVersion>2021.1.5</MinVersion>
<pubDate>Wed, 06 Jan 2021 00:00:00 GMT</pubDate>
<Level>2</Level>
<Creator>Gaku</Creator>
<URL>http://tablacus.github.io/TablacusExplorerAddons/</URL>
<URL>https://tablacus.github.io/TablacusExplorerAddons/</URL>
<License>MIT License</License>
</General>
<en>
Expand All @@ -16,4 +17,7 @@
<Name>アドオンの更新</Name>
<Description>Tablacus Explorerの更新確認時にアドオンを更新します</Description>
</ja>
<zh>
<Name>更新附加元件</Name>
</zh>
</TablacusExplorer>
124 changes: 60 additions & 64 deletions addonsupdater/script.js
Original file line number Diff line number Diff line change
@@ -1,102 +1,98 @@
var Addon_Id = "addonsupdater";
const Addon_Id = "addonsupdater";

if (window.Addon == 1) {
Addons.AddonsUpdater =
{
Addons.AddonsUpdater = {
url: "https://tablacus.github.io/TablacusExplorerAddons/",

Exec: function (Ctrl, pt)
{
var arg = {
pcRef: [0],
Updated: api.CreateObject("FolderItems"),
addons: fso.BuildPath(wsh.ExpandEnvironmentStrings("%TEMP%"), "tablacus\\addons"),

fn: function (arg)
{
while (arg.pcRef[0]) {
api.Sleep(500);
api.DoEvents();
}
if (arg.Updated.Count) {
sha.NameSpace(fso.BuildPath(fso.GetParentFolderName(api.GetModuleFileName(null)), "addons")).MoveHere(arg.Updated, FOF_NOCONFIRMATION | FOF_NOCONFIRMMKDIR);
te.Reload();
}
}
};
DeleteItem(arg.addons);
OpenHttpRequest(Addons.AddonsUpdater.url + "index.xml", "http", Addons.AddonsUpdater.List, arg);
Exec: async function (Ctrl, pt) {
const arg = await api.CreateObject("Object");
arg.pcRef = await api.CreateObject("Array");
arg.pcRef[0] = 0;
arg.Updated = await api.CreateObject("FolderItems");
arg.addons = BuildPath(await te.Data.TempFolder, "addons"),
arg.bReload = true;
DeleteItem(await arg.addons);
OpenHttpRequest(Addons.AddonsUpdater.url + "index.xml", "http", "Addons.AddonsUpdater.List", arg);
return S_OK;
},

List: function (xhr, url, arg)
{
var xml = xhr.get_responseXML ? xhr.get_responseXML() : xhr.responseXML;
List: async function (xhr, url, arg) {
const xml = await xhr.get_responseXML ? await xhr.get_responseXML() : xhr.responseXML;
if (xml) {
var items = xml.getElementsByTagName("Item");
for (var i = 0; i < items.length; i++) {
var item = items[i];
var info = [];
var Id = item.getAttribute("Id");
var installed = GetAddonInfo(Id);
if (installed) {
const items = await xml.getElementsByTagName("Item");
const TEVer = await AboutTE(0);
const bAll = GetNum(await arg.all);
const nLen = await GetLength(items);
for (let i = 0; i < nLen; i++) {
const item = await items[i];
const info = {};
const Id = await item.getAttribute("Id");
const installed = await GetAddonInfo(Id);
if (installed && await installed.Version) {
GetAddonInfo2(item, info, "General");
if (installed.Version < info.Version) {
if (arg.all || AboutTE(0) >= CalcVersion(info.MinVersion)) {
MainWindow.AddonDisabled(Id);
if (AddonBeforeRemove(Id) < 0) {
if (await installed.Version < info.Version) {
if (bAll || TEVer >= CalcVersion(info.MinVersion)) {
await MainWindow.AddonDisabled(Id);
if (await AddonBeforeRemove(Id) < 0) {
return;
}
OpenHttpRequest(Addons.AddonsUpdater.url + Id + '/' + Id + '_' + (info.Version.replace(/\./, "")) + '.zip', "http", Addons.AddonsUpdater.Save, arg);
OpenHttpRequest(Addons.AddonsUpdater.url + Id + '/' + Id + '_' + ((info.Version).replace(/\./, "")) + '.zip', "http", "Addons.AddonsUpdater.Save", arg);
}
}
}
}
if (arg.fn) {
arg.fn(arg);
if (GetNum(await arg.bReload)) {
Addons.AddonsUpdater.Reload(arg);
}
}
},

Save: function (xhr, url, arg)
{
var res = /([^\/]+)\/([^\/]+)$/.exec(url);
Save: async function (xhr, url, arg) {
debugger;
const res = /([^\/]+)\/([^\/]+)$/.exec(url);
if (res) {
var Id = res[1];
var file = res[2];
var temp = arg.addons;
CreateFolder2(fso.GetParentFolderName(temp));
const Id = res[1];
const file = res[2];
const temp = await arg.addons;
CreateFolder2(GetParentFolderName(temp));
CreateFolder2(temp);
var dest = fso.BuildPath(temp, Id);
var hr = Extract(fso.BuildPath(wsh.ExpandEnvironmentStrings("%TEMP%"), "tablacus\\" + file), temp, xhr);
const dest = BuildPath(temp, Id);
const hr = await Extract(BuildPath(await te.Data.TempFolder, file), temp, xhr);
if (hr) {
MessageBox([api.LoadString(hShell32, 4228).replace(/^\t/, "").replace("%d", api.sprintf(99, "0x%08x", hr)), GetText("Extract"), file].join("\n\n"), TITLE, MB_OK | MB_ICONSTOP);
MessageBox([(await api.LoadString(hShell32, 4228)).replace(/^\t/, "").replace("%d", await api.sprintf(99, "0x%08x", hr)), await GetText("Extract"), file].join("\n\n"), TITLE, MB_OK | MB_ICONSTOP);
return;
}
var configxml = dest + "\\config.xml";
for (var nDog = 300; !fso.FileExists(configxml);) {
if (wsh.Popup(GetText("Please wait."), 1, TITLE, MB_ICONINFORMATION | MB_OKCANCEL) == IDCANCEL || nDog-- == 0) {
const configxml = dest + "\\config.xml";
for (let nDog = 300; !await $.fso.FileExists(configxml);) {
if ($.wsh.Popup(await GetText("Please wait."), 1, TITLE, MB_ICONINFORMATION | MB_OKCANCEL) == IDCANCEL || nDog-- == 0) {
return;
}
}
arg.Updated.AddItem(dest);
}
},

Reload: async function (arg) {
if (await arg.pcRef && await arg.pcRef[0]) {
setTimeout(Addons.AddonsUpdater.Reload, 500, arg);
return;
}
if (await arg.Updated.Count) {
await sha.NameSpace(BuildPath(ui_.Installed, "addons")).MoveHere(await arg.Updated, FOF_NOCONFIRMATION | FOF_NOCONFIRMMKDIR);
te.Reload();
}
}
};

AddEvent("CheckUpdate", Addons.AddonsUpdater.Exec);

AddEvent("CreateUpdater", function (arg)
{
arg.pcRef = [0];
arg.Updated = api.CreateObject("FolderItems");
arg.addons = fso.BuildPath(arg.temp, "addons");
AddEvent("CreateUpdater", async function (arg) {
arg.all = true;
OpenHttpRequest(Addons.AddonsUpdater.url + "index.xml", "http", Addons.AddonsUpdater.List, arg);
while (arg.pcRef[0]) {
api.Sleep(500);
api.DoEvents();
}
arg.pcRef = await api.CreateObject("Array");
arg.pcRef[0] = 0;
arg.Updated = await api.CreateObject("FolderItems");
arg.addons = BuildPath(await arg.temp, "addons");
OpenHttpRequest("https://tablacus.github.io/TablacusExplorerAddons/index.xml", "http", "Addons.AddonsUpdater.List", arg);
}, true);

AddTypeEx("Add-ons", "Addons updater", Addons.AddonsUpdater.Exec);
Expand Down
Binary file added docs/addonsupdater/addonsupdater_107.zip
Binary file not shown.
Binary file added docs/execfilter/execfilter_101.zip
Binary file not shown.
Binary file not shown.
Binary file added docs/foldermenufilter/foldermenufilter_102.zip
Binary file not shown.
Loading

0 comments on commit ad9258a

Please sign in to comment.