Install a service on Windows (Vista/XP/7) using Inno Setup

前端 未结 3 948
别那么骄傲
别那么骄傲 2021-02-02 04:45

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

I used codes below

[Run]
Filename:\"{sys}\\my         


        
3条回答
  •  温柔的废话
    2021-02-02 05:00

    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: 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.

提交回复
热议问题