Innosetup doesn't always create service (Windows)

I have an installer that installs an Xojo web app as a service by running a batch file to create a service after files are copied. I’m having a problem with some users reporting that the service didn’t start (wasn’t created either). I’m wondering if it has something to do with permission as the batch file needs administrator privileges to create the service.

Here is the relevant portion of the innosetup script.

Filename: “{app}\delete service.bat”; Flags: runhidden nowait shellexec runascurrentuser; StatusMsg: “Stopping existing service”
Filename: “{app}\Create Service.bat”; Flags: shellexec hidewizard runascurrentuser[/quote]

Here is the file that removes the old existing service. (delete service.bat)

[quote]sc stop “BC Spec Editor”
sc delete “BC Spec Editor”[/quote]

And here is the file that creates the service. (create service.bat)

[quote]sc create “BC Spec Editor” type= own start= auto binpath= “%ProgramFiles(x86)%\Building Creator\Spec Editor.exe”
sc description “BC Spec Editor” “This service is neccessary for the Sketchup Building Creator extension to work properly.”
sc start “BC Spec Editor”[/quote]

It makes me look unprofessional to have to tell the user to locate the ‘create service.bat’ file and execute it as administrator.

Ok I got it figured out. I had to create two separate create service batch files with a different path for 32 bit windows. Then I had to use a Check: IsWin64 to copy the appropriate batch file.

Source: “Builds\create service32.bat”; DestDir: “{app}”; DestName: “Create Service.bat”; Check: “not IsWin64”
Source: “Builds\create service.bat”; DestDir: “{app}”; DestName: “Create Service.bat”; Check: IsWin64[/quote]