使用Inno Setup在Windows(Vista/XP/7)上安装服务 [英] Install a service on Windows (Vista/XP/7) using Inno Setup

查看:77
本文介绍了使用Inno Setup在Windows(Vista/XP/7)上安装服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

安装应用程序时需要安装并运行服务(使用Inno Setup创建installer.exe)

I need to install and run a service when install an application (installer.exe is created using Inno Setup)

我在下面使用了代码

[Run]
Filename:"{sys}\myservice.exe "; Parameters: "-install"

我不确定这是否正确

(我添加了一些代码来提醒重新启动,但是我想知道是否可以在安装后不重新启动pc的情况下立即运行该服务.)

(I add codes to reminder reboot but I wonder if it is possible to run the service immediately after installation without reboot pc.)

[Setup]
AlwaysRestart=yes

欢迎发表评论.

推荐答案

  1. 使用sc.exe,很简单,唯一的缺点是您可能必须截取并解析输出才能知道出了什么问题.
  2. 使用我的Inno设置服务库.它是SCM API上的Pascal脚本包装器,可让您完全控制服务.使用起来稍微复杂一点,但是它允许完整的错误检查和处理.有一些更高级别的功能旨在在标准可抑制的"Inno设置"对话框中显示错误.
  1. Use sc.exe, It is simple, the only drawback is you may have to intercept and parse output to know what went wrong, if it did.
  2. Use my Inno Setup service library. It's a Pascal Script wrapper over the SCM API, and let you to control the services fully. A little more complex to use, but it allows for full error checking and handling. There are some higher level functions designed to display errors in standard suppressible Inno Setup dialog boxes.

PS:请勿在任何Windows系统文件夹中安装服务.它们应被视为Windows专用文件夹.除非您有非常充分的理由在此处进行编写(即驱动程序),否则切勿在此处安装软件.将其安装在您的应用程序文件夹中.

PS: don't install your service in any of the Windows systems folder. They should be regarded as Windows private folders. Unless you have very, very good reasons to write there (i.e. drivers), you should never install software there. Install it in your application folders.

这篇关于使用Inno Setup在Windows(Vista/XP/7)上安装服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆