Re: Why do Services and Console apps not use App Paths Key?
From: Raymond Chen (http://blogs.gotdotnet.com/raymondc/)
Date: 02/20/04
- Next message: Vinay: "File movement"
- Previous message: Doron Holan [MS]: "Re: better timer resolution"
- In reply to: Phill_H: "Re: Why do Services and Console apps not use App Paths Key?"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 19 Feb 2004 23:02:31 -0800
Or you can have a helper process that calls SetEnvironmentVariable(PATH) to
your custom path, and then launches the "real" program.
"Phill_H" <anonymous@discussions.microsoft.com> wrote in message
news:1364801c3f733$10d98730$a601280a@phx.gbl...
> >-----Original Message-----
> >AppPaths is a feature of ShellExecute/Ex. So if somebody
> uses raw
> >CreateProcess then AppPaths is not consulted.
>
> Thanks. So the Service Control Mgr must be calling Create
> Process to start my service. Also when I create a
> shortcut to a Console app that must use Create Process
> rather than ShellExecute, as in both cases the apps do not
> use App Paths key to load DLLs whereas a shortcut to a MFC
> app does use the App Paths Path to load DLLs. If this is
> the distinction then it sounds like there is no way to
> change the applications to resolve this problem. It looks
> like the only recourse is to copy the DLLs to multiple
> locations (in each apps lanch folder) or put the DLLs at
> some other folder in the LoadLibrary search tree. This
> whole issue started when we read a MS document that said
> to stop putting these DLLs in <WINSYSDIR> and put them
> under <CommonFiles>\CompanyName, but then the non-Win32GUI
> applications can't find that location. Alternativly it
> was suggested that copies of the many DLLs be put in each
> executable's folder. This would seem to conflict with the
> MSI unique WIC rule, where the same "resource" should not
> be in more than one windows Installer Component and each
> WIC can be only targeted to a single destination.
>
> Thanks for the info. Any thoughts on the best way to
> address this delima? Also I noticed that the Linker can
> set an "Image Version" but there is very little
> documentation on how the system uses this value. So even
> with the above concerns, I am also struggling to
> understand the behavior of LoadLibrary when a DLL of same
> name is in memory, but the binnary image is different from
> the one another app is trying to load. Does it load the
> new one or map to the existing one, and would setting the
> Image Version prevent the later.
- Next message: Vinay: "File movement"
- Previous message: Doron Holan [MS]: "Re: better timer resolution"
- In reply to: Phill_H: "Re: Why do Services and Console apps not use App Paths Key?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|