使用 Locate in C:/ 会导致问题吗?

Can using Locate in C:/ cause issues?

我正在为 GTA 修改制作安装程序。当用户执行 .exe 时,它​​在显示任何 GUI 之前做的第一件事就是搜索 GTA-SA.exe 所在的位置。

我写了常见的安装位置:

# Most common directories where GTA SA can be found

# Default installation directory from GTA SA setup
!define DEFAULT_DIR "$PROGRAMFILES\Rockstar Games\GTA San Andreas\"

# Default installation directory from Steam version
!define STEAM_DIR "$PROGRAMFILES\Steam\steamapps\common\Grand Theft Auto San Andreas"
!define OTHER_DIR_STEAM "D:\SteamLibrary\steamapps\common\Grand Theft Auto San Andrea"

# MixMods recommend users to install their GTA SA folder into Documents
!define MIXMODS_DIR "$DOCUMENTS"

这是我在 .onInit 代码中的定位函数:

# Makes a search into the most common GTA installation folders to
# check where the GTA_SA.exe (or gta-sa.exe) is located
${locate::Open} "${STEAM_DIR}|${MIXMODS_DIR}|C:\|$PROGRAMFILES|${OTHER_DIR_STEAM}|D:\" `\
                /F=1 \
                /D=0 \
                /M=gta?sa.exe \
                /A=-HIDDEN|-SYSTEM \
                /-PN=Temp|WINDOWS` [=11=]

通过 C:\ 驱动器搜索是否会给用户带来问题(特别是在慢速 HDD 中)?如果是这样,进行此搜索的最佳做法是什么?

我想我明白你想要做什么了。

您想首先检查是否安装了 GTA,然后您想获取安装它的确切目录。

虽然检查 Steam 注册表项对您不起作用,因为它也可以从其他平台安装。

如果我是你,我会检查这个注册表目录: “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall”。

所有可以卸载的程序都在这里,其中应该包括 GTA,即使它是使用 Steam 以外的其他平台安装的。

然后您可以在GTA注册表中找到游戏的安装路径。

有关更多信息,我建议您查看此 post here

如果我能帮助您解决问题,请告诉我。