Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install a Windows service with Inno Setup?

I wrote a batch script to execute after my installation that is made with Inno Setup. The problem is that I have the following command line for my service creation:

sc create MySQL start= auto DisplayName= MySQL binPath= "C:\MyApp\MySQL 5.5\bin\mysqld" --defaults-file="C:\MyApp\MySQL 5.5\my.ini"

The letters with accents are the problem of this code, I can't execute it if I open the bat file in cmd, but when I type the service is created normally. How can I fix that?

like image 709
juniorgarcia Avatar asked Mar 04 '13 15:03

juniorgarcia


1 Answers

You could try to add this command to [RUN] section (as TLama suggested) or create AfterInstall function in [CODE] section.

[Run] 
Filename: "{cmd}"; Parameters: "sc create MySQL start= auto DisplayName= MySQL 
binPath= ""C:\MyApp\MySQL 5.5\bin\mysqld"" 
--defaults-file=""C:\MyApp\MySQL 5.5\my.ini"""; 
Flags: runhidden
like image 192
RobeN Avatar answered Oct 13 '22 08:10

RobeN