Inno Setup:无法在 Windows XP 上安装服务
Inno Setup: Installing service doesn't work on Windows XP
我认为我在 Windows XP 计算机中创建服务时出错,因为安装完成后我没有看到任何已安装的服务。
这就是我在安装程序中创建服务的方式:
Filename: {sys}\sc.exe; Check: (IsAdminLoggedOn or IsPowerUserLoggedOn); Parameters: "create Example start= delayed-auto binPath= ""{app}\Example.exe"""; Flags: runhidden
出于某种原因,除 Windows XP 外,此行在所有 Windows 中都有效。
我做错了什么吗?
如果您在 Windows XP 命令行上尝试过您的命令,您会清楚地看到它失败的原因:
C:\>C:\WINDOWS\system32\sc.exe create Example start= delayed-auto binPath="C:\WINDOWS\system32\notepad.exe"
invalid start= field
...
您的 start=
参数无效。您必须使用以下有效值之一:
start= <boot|system|auto|demand|disabled>
delayed-auto
仅在 Windows Vista 及更高版本后才受支持。您必须在 Windows XP 上使用不同的启动选项。
如果您想在 Windows Vista 和更高版本上使用 delayed-auto
以及在 Windows XP 上使用另一个选项,请参阅 How to install a service with the delayed-auto startup type in Windows XP。
我认为我在 Windows XP 计算机中创建服务时出错,因为安装完成后我没有看到任何已安装的服务。
这就是我在安装程序中创建服务的方式:
Filename: {sys}\sc.exe; Check: (IsAdminLoggedOn or IsPowerUserLoggedOn); Parameters: "create Example start= delayed-auto binPath= ""{app}\Example.exe"""; Flags: runhidden
出于某种原因,除 Windows XP 外,此行在所有 Windows 中都有效。
我做错了什么吗?
如果您在 Windows XP 命令行上尝试过您的命令,您会清楚地看到它失败的原因:
C:\>C:\WINDOWS\system32\sc.exe create Example start= delayed-auto binPath="C:\WINDOWS\system32\notepad.exe"
invalid start= field
...
您的 start=
参数无效。您必须使用以下有效值之一:
start= <boot|system|auto|demand|disabled>
delayed-auto
仅在 Windows Vista 及更高版本后才受支持。您必须在 Windows XP 上使用不同的启动选项。
如果您想在 Windows Vista 和更高版本上使用 delayed-auto
以及在 Windows XP 上使用另一个选项,请参阅 How to install a service with the delayed-auto startup type in Windows XP。