Archive: System path


System path
My installer modifies the system path. It adds two directories to the system path. For Windows 9x machines it updates autoexec.bat. For Windows NT based machines it modifies HKLM\System\CurrentControlSet\Control\Session Manager\Environment\. After the system path has been updated, then I register an ocx file.

My ocx file has dependencies in the two directories I just added to the system path. The problem I am having is that I need the path updated before the installer exits because I need to register that ocx file. After adding these two directories to the system path, I do this:

SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000

I figured that this would refresh the system path for all running processes. This doesn't seem to be the case however. When I test my installer, I see that the path gets updated before the installer quits but the ocx file still fails to register. When the installer exits, I relaunch it and try installing again. The second time always works because I think the system path info is updated.

Is there any truth to this?


Oh, and I am testing on a Windows 2000 machine. I know on Windows 9x I will need a reboot.


why not creating a dir in $WINDIR

so you would have $WINDIR\Folder1 and $WINDIR\Folder2

with which you can work

registering the Dlls and ocx would look like this:

RegDLL "$WINDIR\Folder1\FirstOne.DLL"

this would be a much better way than changing the system path
I don't think you are able to do this, too


Use the second method from the archive for temporary path changes or simply set the output path to the directory you need, assuming it's not more than one.