inf ServiceBinary - 带空格的引用路径

inf ServiceBinary - quote path with spaces

我有一个用于安装服务的 .inf 文件。 安装路径包含空格。 我想引用它们,以避免 security issues.

目前,inf 有这些行:

ServiceBinary  = %10%\path\with sub folder that contains spaces\myservice.exe

[DestinationDirs]
DefaultDestDir = 10,path\with sub folder that contains spaces

因此,为了使服务在此处出现并带有引号: HKLM\SYSTEM\CurrentControlSet\Services\myservice\ImagePath

我已更改 ServiceBinary,如前所述 here

我已经尝试了所有这些但没有成功:

ServiceBinary  = "%10%\path\with sub folder that contains spaces\myservice.exe"
ServiceBinary  = ""%10%\path\with sub folder that contains spaces\myservice.exe""
ServiceBinary  = %10%""\path\with sub folder that contains spaces\myservice.exe""

您知道我应该在我的 .inf 文件中更改什么,以便在注册表中引用服务的 exe 路径(以及服务的可执行路径 属性)吗?

谢谢!

所以我找到了答案...

[DestinationDirs]
DefaultDestDir = 10,""path\with sub folder that contains spaces""

ServiceBinary  = """%10%\path\with sub folder that contains spaces\myservice.exe"""

注意 ServiceBinary 的三个(!)引号。

您可以查看 Microsoft docs 了解更多信息。