Skip to content
⌘ NSIS Forum Archive

SetCurrentDirectory

7 posts

tenfour#

SetCurrentDirectory

In a nutshell: How do you get NSIS to set the current directory, ala SetCurrentDirectory()?

Here's my issue: I need to UnRegDLL a COM DLL in the uninstall section. That COM DLL is dependent on another DLL that's in the same dir as it, but of course loading the COM DLL fails because it can't find the dependency... the logical way to solve this is to use SetCurrentDirectory() to put the current directory in with the COM DLL, unregister it, and continue along.

I can't seem to find a way to change the current directory in code though :/
Guest#


SetOutPath controls the current dir.

-Hendri.
tenfour#
That's what I thought, but that doesn't work. SetOutPath appears only controls how NSIS will handle relative paths, it doesn't actually SetCurrentDirectory.

I've tried your suggestion, but UnRegDLL doesn't use $OUTDIR as the current directory.

tenfour
Guest#
tenfour,

I'm not sure that I understand what you want to do, but anyway, here's a dll that sets and gets (for checking purpose) the current dir. Does it work now?

Good luck, greetz,
-Hendri.
kichik#
Here is one without using any DLL or source changing:
Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.