Skip to content
Snippets Groups Projects
Commit 523d7e80 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Change the "md5" key to an array of sections [md5:<sum>]

... instead of a comma-separated list. .ini lines are limited in length,
MD5sums are kind of long and would limit the number of .exe versions we
could support. Also, no we now have a way to correlate and report version
numbers/strings and URLs with each exe version. The "ver" and "url" keys
are not yet displayed or used for anything and are thus optional.
parent b0f3585e
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
......@@ -9,7 +9,12 @@
// The additional install-xtrn.ini keys are:
// exe = filename of door's executable
// md5 = comma-separated list of md5-sums (in lowercase hexadecimal)
// The additional install-xtrn.ini sections are:
// [md5:<md5-sum>] where <md5-sum> is a hex md5-sum of a version of the exe file
// ver = <optional version information, don't start with "v" or "version">
// url = <optional location to find corresponding distribution/install archive>
"use strict";
......@@ -32,22 +37,24 @@ function scan(options)
return;
}
const ini = f.iniGetObject(/* lowercase: */true);
const md5 = f.iniGetAllObjects("sum", "md5:", /* lowercase: */true);
f.close();
if (!ini.exe) {
out.push("!No executable filename specified in " + f.name);
return;
}
if (!ini.md5) {
if (!md5) {
out.push("!No md5 list specified in " + f.name);
return;
}
if (!exe_list[ini.exe])
exe_list[ini.exe] = {};
var md5_list = ini.md5.split(',');
for(var i in md5_list)
exe_list[ini.exe][md5_list[i]] = f.name;
for(var i in md5) {
exe_list[ini.exe][md5[i].sum] = md5;
exe_list[ini.exe][md5[i].sum].ini_fname = f.name;
}
});
for(var i in exe_list) {
directory(options.xtrn_dir + '*').forEach(function (e) {
const f = new File(e + i);
......@@ -57,8 +64,10 @@ function scan(options)
var md5 = f.md5_hex;
f.close();
if(!exe_list[i][md5]) {
if(options.debug)
if(options.debug) {
out.push("!MD5 sum of " + f.name + " (" + md5 + ") not found.");
out.push(JSON.stringify(exe_list, null, 4));
}
return;
}
var startup_dir = f.name.substr(0, Math.max(f.name.lastIndexOf("/"), f.name.lastIndexOf("\\"), 0));
......@@ -68,11 +77,12 @@ function scan(options)
out.push(ini_fname + " already exists");
return;
}
if (!file_copy(exe_list[i][md5], ini_fname)) {
out.push("!Error copying " + exe_list[i][md5] + " to " + ini_fname);
var src = exe_list[i][md5].ini_fname;
if (!file_copy(src, ini_fname)) {
out.push("!Error copying " + src + " to " + ini_fname);
return;
}
out.push(exe_list[i][md5] + " copied to " + ini_fname);
out.push(src + " copied to " + ini_fname);
});
}
return out;
......
......@@ -4,10 +4,13 @@ The `.ini` files in this directory are in the Synchronet `install-xtrn.ini`
format with base filenames reflecting the door they are intended to help
install into a Synchronet system.
The additional keys expected are:
The additional keys/sections expected are:
~~~
exe = name of the executable file
md5 = comma-separated list of MD5-sums for supported executable file versions
exe = name of the executable file (in the root/unnamed section) [one]
[md5:<sum>] Hex MD5-sum for a supported executable file version [multiple]
ver = <optional version information - start with a number, not 'v')
url = <optional distribution/install package location - start with scheme://>
~~~
MD5-sums are presented in lowercase hexadecimal (e.g. same format returned by
*nix `md5sum` utility).
......@@ -5,7 +5,7 @@ By: RhythmNp (Evan Elias)
Cats: Games
Subs: Multiplayer, Adventure, MUD, Native
exe: dmud32.exe
md5: b92fe52e1883ad8502cb2ea9de75173f
[md5:b92fe52e1883ad8502cb2ea9de75173f]
[prog:DOORMUD]
cmd = dmud32
......
......@@ -6,17 +6,26 @@ By: Mike Wilson
Cats: Games
Subs: Multiplayer, RPG
exe: FOODFITE.EXE
; 591c73daff36feb8ba36ebb8b322307e 4.61
; 591c73daff36feb8ba36ebb8b322307e 4.6
; b42ed4a7d5cb0689d835def10a86b67b 4.5
; bde3e380329a902c5fcf1391ec06f440 4.4
; b8a9e177e208df0b496cad7f7c77aec2 4.0
; 939bb5189d4535f6388e6c35b96cc45f 3.3
; 33cd35708a5cf17ce2415636f715f196 3.2
; 36be50db6c3ef653ff1024bdd4e8f0dc 3.0
; fe15a026d4fd10db3f67997c2ac146d2 2.5
; 94ba5e82ab234124ddad72eaa7dc4658 2.0
md5: 591c73daff36feb8ba36ebb8b322307e,bde3e380329a902c5fcf1391ec06f440,b42ed4a7d5cb0689d835def10a86b67b,591c73daff36feb8ba36ebb8b322307e,b8a9e177e208df0b496cad7f7c77aec2,939bb5189d4535f6388e6c35b96cc45f,33cd35708a5cf17ce2415636f715f196,36be50db6c3ef653ff1024bdd4e8f0dc,fe15a026d4fd10db3f67997c2ac146d2,94ba5e82ab234124ddad72eaa7dc4658
[md5:591c73daff36feb8ba36ebb8b322307e]
ver = 4.61
[md5:591c73daff36feb8ba36ebb8b322307e]
ver = 4.6
[md5:b42ed4a7d5cb0689d835def10a86b67b]
ver = 4.5
[md5:bde3e380329a902c5fcf1391ec06f440]
ver = 4.4
[md5:b8a9e177e208df0b496cad7f7c77aec2]
ver = 4.0
[md5:939bb5189d4535f6388e6c35b96cc45f]
ver = 3.3
[md5:33cd35708a5cf17ce2415636f715f196]
ver = 3.2
[md5:36be50db6c3ef653ff1024bdd4e8f0dc]
ver = 3.0
[md5:fe15a026d4fd10db3f67997c2ac146d2]
ver = 2.5
[md5:94ba5e82ab234124ddad72eaa7dc4658]
ver = 2.0
[prog:FOODFITE]
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment