Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions src/classisland.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ function classIslandHealthResponse(input: string | URL): Response | undefined {
: undefined;
}

test("ClassIsland versions enforce the 2.1.1.0 minimum", () => {
assert.equal(compareClassIslandVersions("2.1.1.0", "2.1.1.0"), 0);
assert.equal(compareClassIslandVersions("2.1.1.1", "2.1.1.0") > 0, true);
assert.equal(compareClassIslandVersions("2.1.0.9", "2.1.1.0") < 0, true);
assert.equal(isCompatibleClassIslandVersion("2.1.1.0"), true);
assert.equal(isCompatibleClassIslandVersion("2.1.0.9"), false);
test("ClassIsland versions enforce the 2.0.0.0 minimum", () => {
assert.equal(compareClassIslandVersions("2.0.0.0", "2.0.0.0"), 0);
assert.equal(compareClassIslandVersions("2.0.0.1", "2.0.0.0") > 0, true);
assert.equal(compareClassIslandVersions("1.9.0.9", "2.0.0.0") < 0, true);
assert.equal(isCompatibleClassIslandVersion("2.0.0.0"), true);
assert.equal(isCompatibleClassIslandVersion("1.9.0.9"), false);
assert.equal(isCompatibleClassIslandVersion(undefined), false);
});

Expand Down Expand Up @@ -74,8 +74,8 @@ test("discovers multiple ClassIsland versions and marks old versions incompatibl
const paths = ["C:\\Portable\\ClassIsland.exe", "D:\\Old\\ClassIsland.exe", "C:\\Program Files\\ClassIsland\\ClassIsland.exe"];
const versions: Record<string, string> = {
[paths[0]]: "2.1.1.0",
[paths[1]]: "2.0.4.0",
[paths[2]]: "2.1.1.0"
[paths[1]]: "1.9.0.0",
[paths[2]]: "2.0.4.0"
};
const found = await discoverClassIslandInstallations({
platform: "win32",
Expand All @@ -91,7 +91,8 @@ test("discovers multiple ClassIsland versions and marks old versions incompatibl
assert.equal(found.find((item) => item.executablePath === paths[0])?.isRunning, true);
assert.deepEqual(found.find((item) => item.executablePath === paths[0])?.launchArgs, ["--quiet"]);
assert.equal(found.find((item) => item.executablePath === paths[1])?.compatible, false);
assert.match(found.find((item) => item.executablePath === paths[1])?.reason || "", /2\.1\.1\.0/);
assert.match(found.find((item) => item.executablePath === paths[1])?.reason || "", /2\.0\.0\.0/);
assert.equal(found.find((item) => item.executablePath === paths[2])?.compatible, true);
});

test("maps the running ClassIsland.Desktop process back to its launcher and closes the real instance", async () => {
Expand Down Expand Up @@ -289,7 +290,7 @@ test("does not write a package when ClassIsland is too old or the digest is inva
try {
const exe = path.win32.join(root, "ClassIsland.exe");
fs.writeFileSync(exe, "test executable");
const oldInstaller = new ClassIslandInstaller({ platform: "win32", executablePaths: [exe], runningProcesses: [], versionOf: () => "2.1.0.9", exists: (candidate) => fs.existsSync(candidate) });
const oldInstaller = new ClassIslandInstaller({ platform: "win32", executablePaths: [exe], runningProcesses: [], versionOf: () => "1.9.0.0", exists: (candidate) => fs.existsSync(candidate) });
const [oldTarget] = await oldInstaller.detect();
const [oldResult] = await oldInstaller.install([oldTarget.id]);
assert.equal(oldResult.action, "skipped");
Expand Down
2 changes: 1 addition & 1 deletion src/classisland.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { DEFAULT_MARKETPLACE_PROXY_URL, describeDownloadAttempt, marketplaceRequ
export const CLASSISLAND_PLUGIN_REPOSITORY = "SECTL/ClassIsland-SecAgent-Plugin";
export const CLASSISLAND_PLUGIN_ID = "classisland.secagent";
export const CLASSISLAND_PLUGIN_ASSET_NAME = "ClassIsland.SecAgent.Plugin.cipx";
export const MIN_CLASSISLAND_VERSION = "2.1.1.0";
export const MIN_CLASSISLAND_VERSION = "2.0.0.0";
export const CLASSISLAND_RELEASE_API_URL = `https://api.github.com/repos/${CLASSISLAND_PLUGIN_REPOSITORY}/releases/latest`;
const CLASSISLAND_RELEASE_PAGE_URL = `https://github.com/${CLASSISLAND_PLUGIN_REPOSITORY}/releases/latest`;

Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/components/OobeWizard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ export function OobeWizard() {
return false;
}
if (selectedTargets.some((target) => !target.compatible)) {
setError("所选 ClassIsland 版本低于 2.1.1.0,无法安装联动插件");
setError("所选 ClassIsland 版本低于 2.0.0.0,无法安装联动插件");
return false;
}
// Holds land on the 50-100 half of the card when the SecAgent connector
Expand Down
Loading