Path value in App Paths

R

Richard Ayling

My app loads a dll at runtime. The dll's directory is set
in the Path value under
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersio
n\App Paths\<app name>.exe

When my app is run from a shortcut, it receives the
extended PATH environment variable and finds the dll, as
per the documentation.

When one of my document files is double clicked in
explorer, my app is run but does not receive the extended
PATH environment variable and so can not find the dll. I
can not locate this behaviour in the MSDN or knowledge
base.

Does this mean the App Paths key should not be used? Or is
there something else I should be doing?
 
D

Davin Mickelson

Hi.

My first question is whether or not you have both full string values located
at the specific registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\<app
name>.exe

The two string values, (Default) and Path, should appear as:
(Default) = C:\Program Files\<folder name>\<app name>.exe
Path = C:\Program Files\<folder name>

Another idea is to add the folder's absolute path to the main Windows 2000
PATH variable. You can see/edit the PATH by right-clicking "My Computer" and
choosing "Properties". Click the "Advanced" tab and then click the button
that reads "Environment Variables...". There are two different "Path"
variables that you can modify - either for the current user or for the
system. Click the edit button to view and or modify.

The System Path variable is stored in a couple of different places, much
like the way Windows Services are registered. Notice that it is also located
in the "ControlSet<n>" folders. Here's where it was set on mine:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session
Manager\Environment
Path = "C:\WINNT\...<yada,yada,yada, long string>"

A quick way to see the path is to go to the Command Prompt, type in "PATH"
and click <ENTER>.
To see all the other Environment variables, type in "SET" and click
"<ENTER>".

There is a bug in getting this to work if you have an older OS, which I
doubt since you're asking this on a Win2k NG:
App Paths Bug in Win95/98/ME
http://support.microsoft.com/default.aspx?scid=kb;en-us;178883
They just recommend putting the DLL in the same folder where the EXE
resides.

I do not know your level of expertise so I apologize if you already tried
these ideas. You're right, there isn't much documentation on the "App Paths"
folders. Perhaps you should ask this question on the
http://www.installsite.org NG. They often have InstallShield and Wise folks
answering Windows Installer questions, and they would know what those
folders are for.

Good luck,
Davin Mickelson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top