Skip to content
Merged
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
8 changes: 6 additions & 2 deletions src/installers/ShimloaderInstaller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,14 @@ export class ShimloaderInstaller implements PackageInstaller {
const fs = FsProvider.instance;
const fileRelocations = new Map<string, string>();

const entries = await fs.readdir(path.join(packagePath, "UE4SS"));
const findUE4SS = (name: string) =>
entries.find(f => f.toLowerCase() === name.toLowerCase()) ?? name;

const targets = [
["dwmapi.dll", "dwmapi.dll"],
["UE4SS/ue4ss.dll", "ue4ss.dll"],
["UE4SS/UE4SS-settings.ini", "UE4SS-settings.ini"],
[`UE4SS/${findUE4SS("ue4ss.dll")}`, "ue4ss.dll"],
[`UE4SS/${findUE4SS("UE4SS-settings.ini")}`, "UE4SS-settings.ini"],
];

const ue4ssTree = await FileTree.buildFromLocation(path.join(packagePath, "UE4SS/Mods"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ import {
} from '../../../../utils/InstallLogicUtils';
import { PluginInstallers } from '../../../../../../src/installers/registry';
import { InstallRulePluginInstaller } from '../../../../../../src/installers/InstallRulePluginInstaller';
import { ShimloaderInstaller } from '../../../../../../src/installers/ShimloaderInstaller';
import { getInstallArgs } from '../../../../../../src/installers/PackageInstaller';
import { PackageLoader } from '../../../../../../src/model/schema/ThunderstoreSchema';
import Profile from '../../../../../../src/model/Profile';
import R2Error from '../../../../../../src/model/errors/R2Error';
import InMemoryFsProvider from '../../../../stubs/providers/InMemory.FsProvider';
import ProfileInstallerProvider from '../../../../../../src/providers/ror2/installing/ProfileInstallerProvider';
import GenericProfileInstaller from '../../../../../../src/r2mm/installing/profile_installers/GenericProfileInstaller';
import { RuleSubtype } from '../../../../../../src/r2mm/installing/InstallationRules';
Expand Down Expand Up @@ -137,4 +140,45 @@ describe('Shimloader Installer Tests', () => {
await expectFilesToBeCopied(sourceToExpectedDestination);
});
});

describe('Mod loader installation (case-sensitive FS)', () => {

// Test https://github.com/ebkr/r2modmanPlus/issues/2079
beforeEach(async () => {
await installLogicBeforeEach("Palworld");
InMemoryFsProvider.setMatchMode("CASE_SENSITIVE");
});

test("Installs new UE4SS.dll", async () => {
const pkg = createManifest("unreal_shimloader", "Thunderstore");
const sourceToExpectedDestination = {
"dwmapi.dll": "dwmapi.dll",
"UE4SS/UE4SS.dll": "ue4ss.dll",
"UE4SS/UE4SS-settings.ini": "UE4SS-settings.ini",
"UE4SS/Mods/shared/Types.lua": "shimloader/mod/shared/Types.lua",
};
await createPackageFilesIntoCache(pkg, Object.keys(sourceToExpectedDestination));

const profile = Profile.getActiveProfile().asImmutableProfile();
await new ShimloaderInstaller().install(getInstallArgs(pkg, profile));

await expectFilesToBeCopied(sourceToExpectedDestination);
});

test("Installs old ue4ss.dll", async () => {
const pkg = createManifest("unreal_shimloader", "Thunderstore");
const sourceToExpectedDestination = {
"dwmapi.dll": "dwmapi.dll",
"UE4SS/ue4ss.dll": "ue4ss.dll",
"UE4SS/UE4SS-settings.ini": "UE4SS-settings.ini",
"UE4SS/Mods/shared/Types.lua": "shimloader/mod/shared/Types.lua",
};
await createPackageFilesIntoCache(pkg, Object.keys(sourceToExpectedDestination));

const profile = Profile.getActiveProfile().asImmutableProfile();
await new ShimloaderInstaller().install(getInstallArgs(pkg, profile));

await expectFilesToBeCopied(sourceToExpectedDestination);
});
});
});
Loading