fix: dll detection for linux64 & win64

This commit is contained in:
Linventif 2025-07-28 13:50:50 +00:00
parent 4fdf91c8b4
commit 949fd85e3e
2 changed files with 19 additions and 11 deletions

View File

@ -1,7 +1,24 @@
if game.SinglePlayer() then return print("Gmod Integration is not supported in Singleplayer!") end
local alreadyLoadGMI = gmInte
local function detectOS()
if system.IsWindows() then
return "win" .. (jit && jit.arch == "x64" && "64" || "")
elseif system.IsLinux() then
return "linux" .. (jit && jit.arch == "x64" && "64" || "")
else
return "unknown"
end
end
local function dllInstalled()
return file.Exists("lua/bin/gmsv_gmod_integration_loader_linux.dll", "GAME") || file.Exists("gmsv_gmod_integration_loader_linux64.dll", "GAME") || file.Exists("lua/bin/gmsv_gmod_integration_loader_win32.dll", "GAME") || file.Exists("gmsv_gmod_integration_loader_win64.dll", "GAME")
local fileName = "gmsv_gmod_integration_loader_" .. detectOS() .. ".dll"
if detectOS() == "unknown" then
gmInte.logError("Unknown OS detected, cannot check for DLL installation.")
return false
end
return file.Exists("lua/bin/" .. fileName, "GAME")
end
local isLatest = debug.getinfo(1, "S").source == "@addons/_gmod_integration_latest/lua/autorun/_gmod_integration_latest.lua"
@ -35,6 +52,7 @@ gmInte.version = "5.0.28" // This will be automatically updated by GitHub Action
gmInte.config = {}
gmInte.useDataConfig = true
gmInte.dllInstalled = dllInstalled
gmInte.detectOS = detectOS
function gmInte.log(msg, onlyOndebug)
if onlyOndebug && !gmInte.config.debug then return end
print(" | " .. os.date(gmInte.config.logTimestamp || "%Y-%m-%d %H:%M:%S") .. " | Gmod Integration | " .. msg)

View File

@ -1,13 +1,3 @@
function gmInte.detectOS()
if system.IsWindows() then
return "win" .. (jit && jit.arch == "x64" && "64" || "")
elseif system.IsLinux() then
return "linux" .. (jit && jit.arch == "x64" && "64" || "")
else
return "unknown"
end
end
timer.Create("gmInte:CheckDLL", 30, 0, function()
if gmInte.dllInstalled() || gmInte.config.debug then return end
print(" ")