Recommended Install location for service on Windows

2

1

I want to install a Java based service application on a Windows server. In Linux I would install it in /opt or /usr/local but for Windows I am not sure what the recommended practice is. Would it just be Program Files or is there a better place?

Note: This is a manual install, there is no installer.

Manfred Moser

Posted 2012-02-06T23:19:55.473

Reputation: 189

This is for a manual install of a bundle that has no installer... just a Java server with bundled app and JSW as part of it. Just wondering where to put it best. – Manfred Moser – 2012-02-06T23:25:01.350

Answers

1

Please note that the paths I mention have been introduced in Vista, so this is not valid for XP-area systems.

Generally speaking, if your application is not tied to a user account, because

  • several different user accounts on the machine use the application or
  • it's a service ran by the System account

you should put the application in the Program Files folder. Please note that on 64bit systems, 32bit application go into the Program Files (x86) folder and 64bit applications go into the Program Files folder.

If the application is installed for a single user, it should go into Users\<username>\AppData\Local folder.

However, you should never assume any of these locations exist by those names. You should always use the functions provided by the shell to look up the proper locations (like SHGetKnownFolderPath ).

Der Hochstapler

Posted 2012-02-06T23:19:55.473

Reputation: 77 228

I disagree - if you are not the developer of an application, and if the developer has not documented the correct installation procedure, it is safest to avoid paths containing spaces because you can't be sure that the developer has properly taken that possibility into account. I usually create a folder c:\apps and put this sort of application in there (one subfolder per application). – Harry Johnston – 2012-02-07T02:05:01.557

Question though. How can I prevent Windows from doing the shadowing of registry in the specific users registry and shadow folder. This seems to confuse my apps discovery of where it is running from? Or should I install it into the users home folder since it is supposed to run as a specific user. – Manfred Moser – 2012-02-07T23:52:49.860

@ManfredMoser I don't really understand the first question. If the application is ran as a specific user only, then, yes, install it in the users profile folder (AppData\Local). – Der Hochstapler – 2012-02-08T00:08:11.187

Due to the "File and Registry Virtualization" feature in Windows 7 and Vista writes are redirected(and subsequent reads) to a per-user location within the user’s profile. So if I install the app into programfiles but it will actually be run as a specific user data will end up in that users VirtualStore. This will confuse the server app, since it will not be able to determine its root directory properly. So would it be best to run it as a specific user and install it into that users folder like you mentioned then? – Manfred Moser – 2012-02-08T00:15:31.203

@ManfredMoser I really can't say right now. Maybe this warrants an additional question so other users can give their input? – Der Hochstapler – 2012-02-08T00:23:29.523

@ManfredMoser: it sounds as if this application is writing files to the same directory the executable lives in? In this case it definitely shouldn't be living in Program Files. Depending on context (mainly on whether the user needs to read the files being created) I'd suggest either the user's Documents folder or AppData\Local. – Harry Johnston – 2012-02-08T18:58:42.147

1

I would recommend Program Files. The Windows and System folders should not be used for non-OS apps, and the root of the drive is, well, so 90s.

Patrick Seymour

Posted 2012-02-06T23:19:55.473

Reputation: 7 662