Service Problems - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

pworthing
Posts: 12
Joined: Fri Feb 01, 2008 5:32 pm
Location: Ottawa
Contact: Website

Service Problems

I have created an install with a FIT.exe that I want people to run as the initial setup and a FITService.exe (installs as service) that I want them to start manually when they choose later.

Reason for this is that the app starts up a browser that shows them how to connect the first time.

The FIT.exe works fine and I can connect to the port that is opened.
However, if I run the FITService.exe, it says it is running but I can not connect to it as I can with the other one. I can also not stop it?

Additionally, it looks like my app is reading in some unknown files (WEB.rc, cero.rc, oflc.rc, ..) and unable to find others when run as the service? Is it being started somewhere else ? This might be the ultimate problem. How is that controlled?
I searched for these files to no avail?

I added the JRE bundle to see if that would help, as per a previous article, but it did not help.

Thanks for your help.
pworthing
Posts: 12
Joined: Fri Feb 01, 2008 5:32 pm
Location: Ottawa
Contact: Website

I also noticed on Vista that there is a list of Services in the Services tab of the Tasklist Manager and they do not match the list if you press the services... button. If the difference is just based on permissions, should I not see the same list if I have admin priveledges?

Thanks for any help
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

I'm not sure in what way this is related with Advanced Installer. Can you please give me more details about this?

If the service is installed, registered and started correctly then there is no problem with the installation package (the problem is caused by the service itself).

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
pworthing
Posts: 12
Joined: Fri Feb 01, 2008 5:32 pm
Location: Ottawa
Contact: Website

I created two java products in your tool. FIT.exe which is set up as "Graphical User Interface" for the application type.
FitService.exe which is set up as a "Win32 Service" for the application type.
The FIT.exe runs our product just fine. However, when I start the service manually, it seems to be run from a different directory or something?

It appears that the service is starting from the Windows/System32 directory or something? I see error messages that it is trying to read some .rs files (which is a type we store in our app directory) such as esrb.rs. These appear to be in the System32 directory.

I think we use "." as the path for our config files. This has never been a problem before when the service was installed with srvany or invoker before we found your product.

Does this make any sense to you ?

Thanks
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

Please try using the "Set current directory to product folder" option in the "Settings" tab of the "Java Products" page:
http://www.advancedinstaller.com/user-g ... tings.html

Let me know if the problem persists even with this option.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
pworthing
Posts: 12
Joined: Fri Feb 01, 2008 5:32 pm
Location: Ottawa
Contact: Website

Sorry I did not see that option. That cleared up the first of my three problems. Thanks.

Problem 2. I think I just figured out the guts of the problem. It appears that you pass the name of the service to the Java application. In my case I called it "Fit Service" and I am getting both of these words as arguments which was messing things up for me. Is this correct? Is this controlled anywhere? Maybe I will just take the space out of the name and look for this as a parameter but it would be nice to control this as users may change the name of the service. ie: would be nicer as "ServiceName=" or something that I can look for. Anywhere to control this?

Problem 3: I can not seem to stop my service unless I stop it from within my application. The service controls do not work. I added the stop() method and I print out a message telling me that I got there, but the service gets stuck on "stopping". And the worst part is that the application stay bound to the port I use and I can not kill the process to get it back. Any ideas here?

Thanks for all your help!
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,
In my case I called it "Fit Service" and I am getting both of these words as arguments which was messing things up for me. Is this correct? Is this controlled anywhere?
I cannot reproduce this behavior on my test machine. Can you please send us the AIP or a small test case which reproduces this behavior to support at advancedinstaller dot com so we can investigate it?
I can not seem to stop my service unless I stop it from within my application. The service controls do not work.
Please note that the service must stop itself when receiving the stop command.

The Advanced Installer control operations only send a command to the service. If the service cannot apply this command then the problem is caused by the service (this cannot be controlled by Advanced Installer).

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
pworthing
Posts: 12
Joined: Fri Feb 01, 2008 5:32 pm
Location: Ottawa
Contact: Website

Thanks, the stop routine was actually never calling the exit. I am almost there now. My last problem is that I can still not stop the service from the services menu. I get "Error 1067, the process terminated unexpectedly". I have no problem if I issue [sc stop "FIT Service"] however?

Can I not call System.exit(0) ?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,
My last problem is that I can still not stop the service from the services menu.
Please note that this depends completely on your service and it is not related in any way with Advanced Installer.

Also, note that it is not recommended to rename the service. After you set a name for the service in the "Services" page, that name should never be changed during and after the installation is performed.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
pworthing
Posts: 12
Joined: Fri Feb 01, 2008 5:32 pm
Location: Ottawa
Contact: Website

Thanks for your note. I will tell my customers no to rename it!

Can you explain a bit more as to how it depends on the service. Error 1067 seems like a pretty straight forward error. And the fact that I can stop it from the command line properly implies that it works ok.

Is the System.exit(0) a problem? Does this stop it from returning maybe?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

This happens because the service is not stopped properly. Please try keeping the main function active until the stop command is received.

For example, you can use a "While" structure which contains a Sleep command. This structure will be executed in the main function until the stop command is received.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
drock
Posts: 3
Joined: Tue Mar 02, 2010 1:41 am

Re: Service Problems

We ran into this recently and found that calling System.exit(0) was too forceful. What worked for us was to set up logic to allow the main thread to eventually fall off when stop() was called (similar to how the service example works).

Return to “Common Problems”