Problem installing file as a service

Got a problem you cannot solve? Try here.
Post Reply
Erik
Posts: 28
Joined: Thu Mar 12, 2009 4:55 am

Problem installing file as a service

Post 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
ALive
Posts: 109
Joined: Mon Apr 27, 2009 5:54 am
Location: Russia

Post 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.
Erik
Posts: 28
Joined: Thu Mar 12, 2009 4:55 am

Post 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!
ALive
Posts: 109
Joined: Mon Apr 27, 2009 5:54 am
Location: Russia

Post 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!
Erik
Posts: 28
Joined: Thu Mar 12, 2009 4:55 am

Post 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.
ALive
Posts: 109
Joined: Mon Apr 27, 2009 5:54 am
Location: Russia

Post 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.
Erik
Posts: 28
Joined: Thu Mar 12, 2009 4:55 am

Post 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.
ALive
Posts: 109
Joined: Mon Apr 27, 2009 5:54 am
Location: Russia

Post 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...
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Post 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.
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
Post Reply