Archive: System call doesn't work when installer run from network drive


System call doesn't work when installer run from network drive
I have created an installer that makes a call to the Palm condmgr.dll's CmGetHotSyncExecPath function. The installer works properly when run from the hard drive, but if the installer is run from a network drive, the path that I get is an empty string.

I assume that this is because the system can't find the dll for some reason (I don't know enough about what I'm doing to determine where exactly the problem lies). I am copying the dll to $INSTDIR before making the call. Is there something that I can do to make the installer work correctly when run from a network drive?

NSIS v.2.0b3


Did you put $INSTDIR in the System Call DLL path?


Well, I updated to 2.0b4 from CVS, and this problem fixed itself. (The NSIS Update Tool is very handy, by the way.)

Just to clarify your response, do you mean something like System::Call '$INSTDIR\CondMgr::CmGetHotSyncExecPath(....'? Does giving a full path like that work? Also, since it works without $INSTDIR does that mean that System is smart enough to look in $INSTDIR automatically?


You would have to ask brainsucker for details, but I think it accepts full paths. If it works with $INSTDIR, its always safer to use it unless bransucker can tell us whether is always looks there or only if it's the current directory.


It's probably because b4 fixes a SetOutPath bug that caused the current directory not to be set unless the directory was already there.

As for System.dll searching method, it uses GetModuleHandle and LoadLibrary. GetModuleHandle searches for loaded modules and LoadLibrary searches in the following order:

  1. The directory from which the application loaded.
  2. The current directory.
  3. The system directory. Use the GetSystemDirectory function to get the path of this directory.
  4. The 16-bit system directory. There is no function that obtains the path of this directory, but it is searched.
    Windows Me/98/95: This directory does not exist.
  5. The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
  6. The directories that are listed in the PATH environment variable.

That means that it only searches $INSTDIR if it's the current directory. If you have used SetOutPath $INSTDIR before the call then it will work fine.


Thanks for the info!

I'm slowly beginning to feel competent with NSIS ;).