LocalizeLimbusCompany / LLC_MOD_Toolbox

模组安装程序
https://www.zeroasso.top/docs/install/autoinstall
MIT License
122 stars 26 forks source link

被误导了,真正的寻址方式 #77

Closed ProjektMing closed 1 week ago

ProjektMing commented 1 week ago

可以轻易注意到,HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 1973530 中的 InstallLocation 即为所需,此事在 Add/Remove Package 中亦有记载

22:09:10 Ming> winget list limbus
Name           Id                                Version
--------------------------------------------------------
Limbus Company ARP\Machine\X64\Steam App 1973530 Unknown

本机验证结果:

Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 1973530", "InstallLocation", string.Empty).Dump();
//output:
//E:\SteamLibrary\steamapps\common\Limbus Company
ZengXiaoPi commented 1 week ago

懂了,通过steam会把边狱公司添加到软件列表的原理寻址?

ProjektMing commented 1 week ago

懂了,通过steam会把边狱公司添加到软件列表的原理寻址?

差不多,每个非绿色安装的应用都会有这项,这也是微软包管理/卸载程序的工作原理。

ZengXiaoPi commented 1 week ago

既然这样,我有一计: https://partner.steamgames.com/doc/api/ISteamApps 直接用BIsAppInstalled判断是否安装,然后用GetAppInstallDir获取安装路径

ZengXiaoPi commented 1 week ago

既然这样,我有一计: https://partner.steamgames.com/doc/api/ISteamApps 直接用BIsAppInstalled判断是否安装,然后用GetAppInstallDir获取安装路径

祝注册表好运.jpg

ProjektMing commented 1 week ago

很遗憾,其实我试过,有权限的限制(说白了没钱),Steam没启动和没有访问权限都不会工作。 注册表就是神

ZengXiaoPi commented 1 week ago

很遗憾,其实我试过,有权限的限制(说白了没钱),Steam没启动和没有访问权限都不会工作。 ~注册表就是神~

我没看到有访问权限这一回事啊?倒是需要开启steam

ProjektMing commented 1 week ago

emm, 要不你自己再试下,我记得我原来做了两个版本的代码,但很遗憾用来描述的这个情况的那个被我丢了,现在我手上只有一个有问题的代码要不试试修一下?

class Program
{
        //需要dll文件,从游戏那里拷过来就行
        [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)]
        extern static uint GetAppInstallDir(uint appID, out string pchFolder, uint cchFolderBufferSize);

        static void Main(string[] args)
        {

            uint result = GetAppInstallDir((uint)1973530, out string limbusCompanyDir, uint.MaxValue);
            Console.WriteLine(limbusCompanyDir);

        }
}
ZengXiaoPi commented 1 week ago

steam api需要init的()

ProjektMing commented 1 week ago

看来目前我是解决不了,init过后还是提示找不到函数,另外想起来还有32位和64位的区别尚待解决,起码从dll取api是这样的

Setting breakpad minidump AppID = 1973530 Steam_SetMinidumpSteamID: Caching Steam ID: 76561198963769300 [API loaded no] Unhandled exception. System.EntryPointNotFoundException: Unable to find an entry point named 'GetAppInstallDir' in DLL 'steam_api64.dll'. at Program.GetAppInstallDir(UInt32 appID, StringBuilder pchFolder, UInt32 cchFolderBufferSize)

ZengXiaoPi commented 1 week ago

不挣扎了