Page 1 of 1

Problem installing file as a service

Posted: Tue Jun 02, 2009 4:22 am
by Erik
Hello,
As part of my setup project I want to install a file as a service. I try to do this using the install service command in msi code. When I run my installer I get an error message saying:
A portion of the folder path " is invalid. It is either empty or exceeds the length allowed by the system.

I try to install to $TARGETDIR$ which should be a valid path, I install all my other files to there with the Install Files command. I've isolated the error to the install service command by commenting it out. When I do, I don't get the error.

Any suggestions to what I'm doing wrong? I've attached images of what's going on.

Thanks,
Erik

Image

Image
Image
Image
Image

Posted: Tue Jun 02, 2009 5:26 am
by ALive
Hi!

Your problem is quiet obvious to me. As I can see the path is provided as a relative path, starting with ".." which is restricted in IA (as far as I know).

There's probably two solutions:
1. Use absolute path, like C:\\Folder1\\SubFolder2\\CommonFiles\\NAS2.exe (as example)
2. Use compiler variables (in case you need to use relative path). Like #OUTPUT_FILES_FOLDER#\\CommonFiles\\NAS2.exe

where #OUTPUT_FILES_FOLDER# could be equaled "C:\\Folder1\\SubFolder2\\"
or any path you like. This is the way that i use.

Hope this helps.

Posted: Tue Jun 02, 2009 7:07 am
by Erik
Moving the files to a folder without .. did the trick. I must say it wasn't so obvious to me since I use "Install files" from that same path and it works fine but "Install service" does not and they're both purple commands. Guess that's a quirk of msi or something.

Many thanks!

Posted: Tue Jun 02, 2009 7:26 am
by ALive
I'm very glad that i could be of assistance :)

By the way, can you confirm that deletion of a service after the uninstall is OK??

I've encountered a problem with all my services (Tomcat server, C# written Service, C++ written service, all of them). They are out of control by the command "Control Service Delete or Stop on Uninstall". So i couldn't stop or delete the service in the system.

If you could confirm that this is working or not, i would be very thankful.

Thanks in advance!

Posted: Tue Jun 02, 2009 9:47 am
by Erik
ALive wrote:I'm very glad that i could be of assistance :)

By the way, can you confirm that deletion of a service after the uninstall is OK??

I've encountered a problem with all my services (Tomcat server, C# written Service, C++ written service, all of them). They are out of control by the command "Control Service Delete or Stop on Uninstall". So i couldn't stop or delete the service in the system.

If you could confirm that this is working or not, i would be very thankful.

Thanks in advance!
I'm not sure if you're saying you are using the "Control Service Delete or Stop on Uninstall" or not but I've tried both. If I run without it the service will still be in the list of services after uninstall and reboot but it will be shown as stopped. If I add the control command right after the install command everything works fine, it's gone after uninstall.

Going back to my original problem, it seems it's not so much the .. causing my problem. It seems like it needs to be an absolute path like c:\\files\\myfile.exe, relative paths don't seem to work even without the dots.

Posted: Tue Jun 02, 2009 11:32 am
by ALive
Eric, you can use the method i described above, with compiler variables.
If you need, i can provide you with more info and an examples.

going back to Service Control command. What version of IA you are using?
When i used version 8.01 it was just fine, after migrating to 9.02 the mechanism of deleting services was broken (for all services at once). I even tried to create separate test solutions, and it was the same, i cannot delete the service.

Posted: Wed Jun 03, 2009 4:02 am
by Erik
ALive wrote:Eric, you can use the method i described above, with compiler variables.
If you need, i can provide you with more info and an examples.

going back to Service Control command. What version of IA you are using?
When i used version 8.01 it was just fine, after migrating to 9.02 the mechanism of deleting services was broken (for all services at once). I even tried to create separate test solutions, and it was the same, i cannot delete the service.
Thanks, I figured the compiler variables out myself and it works fine.

I'm using version 8-something. The splash screen says "InstallAware 8 (Build Âme - Rej.rtm.090408)", not quite sure how to interpret that.

Posted: Wed Jun 03, 2009 5:44 am
by ALive
Ehh... That's explains everything. In version 8.xx Service Control function worked perfectly. I was proud of my installer, when testers team never encountered a problem with something left after uninstall. Until we upgraded to 9.xx version... where the Control Service function was somehow changed and i have nothing left but using OS commands, which are sometimes does not work (and i don't know why). In other words in 95% there's a failure during uninstall now (without using Service Control). I wish it'll be repaired shortly. We have a version release in 2 weeks, it'll be a disaster to me...

Posted: Wed Jun 03, 2009 6:03 am
by MichaelNesmith
I have requested this before - please send a minimum reproducible project with your service file inside it, so I can investigate this issue further for you. So far my attempts have failed.